]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
smb: smbdirect: introduce smbdirect_frwr_is_supported()
authorStefan Metzmacher <metze@samba.org>
Thu, 28 Aug 2025 14:45:23 +0000 (16:45 +0200)
committerSteve French <stfrench@microsoft.com>
Thu, 16 Apr 2026 02:58:18 +0000 (21:58 -0500)
This will replace frwr_is_supported() on the client and
rdma_frwr_is_supported() on the server.

Cc: Steve French <smfrench@gmail.com>
Cc: Tom Talpey <tom@talpey.com>
Cc: Long Li <longli@microsoft.com>
Cc: Namjae Jeon <linkinjeon@kernel.org>
Cc: linux-cifs@vger.kernel.org
Cc: samba-technical@lists.samba.org
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/common/smbdirect/smbdirect_socket.c

index b5ce5f6443f601a477a81e17ab8d4f02e72af338..05a284526aa2179dfdf5ff07c966e9d6fb6451fd 100644 (file)
@@ -6,6 +6,22 @@
 
 #include "smbdirect_internal.h"
 
+__maybe_unused /* this is temporary while this file is included in others */
+static bool smbdirect_frwr_is_supported(const struct ib_device_attr *attrs)
+{
+       /*
+        * Test if FRWR (Fast Registration Work Requests) is supported on the
+        * device This implementation requires FRWR on RDMA read/write return
+        * value: true if it is supported
+        */
+
+       if (!(attrs->device_cap_flags & IB_DEVICE_MEM_MGT_EXTENSIONS))
+               return false;
+       if (attrs->max_fast_reg_page_list_len == 0)
+               return false;
+       return true;
+}
+
 static void smbdirect_socket_cleanup_work(struct work_struct *work);
 
 __maybe_unused /* this is temporary while this file is included in others */