summaryrefslogtreecommitdiffstats
path: root/fs/ksmbd/transport_rdma.c
diff options
context:
space:
mode:
authorHyunchul Lee <hyc.lee@gmail.com>2021-07-13 16:09:34 +0900
committerNamjae Jeon <namjae.jeon@samsung.com>2021-07-13 17:22:51 +0900
commit03d8d4f1896eba2240aa946ce591e86e538504cd (patch)
tree521964715a410005c9f5e1c9fa15cdfba8fcf6f9 /fs/ksmbd/transport_rdma.c
parent96ad4ec51c06c6fafc10b4e3a20753e127ce27d4 (diff)
downloadlinux-03d8d4f1896eba2240aa946ce591e86e538504cd.tar.bz2
ksmbd: set RDMA capability for FSCTL_QUERY_NETWORK_INTERFACE_INFO
set RDMA capability for FSCTL_QUERY_NETWORK_INTERFACE_INFO. Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com> Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/ksmbd/transport_rdma.c')
-rw-r--r--fs/ksmbd/transport_rdma.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/ksmbd/transport_rdma.c b/fs/ksmbd/transport_rdma.c
index d5728c84a15a..f818fe358f31 100644
--- a/fs/ksmbd/transport_rdma.c
+++ b/fs/ksmbd/transport_rdma.c
@@ -2033,6 +2033,20 @@ int ksmbd_rdma_destroy(void)
return 0;
}
+bool ksmbd_rdma_capable_netdev(struct net_device *netdev)
+{
+ struct ib_device *ibdev;
+ bool rdma_capable = false;
+
+ ibdev = ib_device_get_by_netdev(netdev, RDMA_DRIVER_UNKNOWN);
+ if (ibdev) {
+ if (rdma_frwr_is_supported(&ibdev->attrs))
+ rdma_capable = true;
+ ib_device_put(ibdev);
+ }
+ return rdma_capable;
+}
+
static struct ksmbd_transport_ops ksmbd_smb_direct_transport_ops = {
.prepare = smb_direct_prepare,
.disconnect = smb_direct_disconnect,