Skip to contentSkip to conversation

ksmbd: detect RDMA capable lower devices when bridge and vlan netdev is used

PATCH New Namjae Jeon 1 participant 2 messages Oct 27, 2025

Subsystems (3)
lore
Share & tools
lore

Namjae Jeon

author maintainer
#0 lore raw

PATCH 1/2 ksmbd: detect RDMA capable lower devices when bridge and vlan netdev is used

If user set bridge interface as actual RDMA-capable NICs are lower devices, ksmbd can not detect as RDMA capable. This patch can detect the RDMA capable lower devices from bridge master or VLAN. With this change, ksmbd can accept both TCP and RDMA connections through the same bridge IP address, allowing mixed transport operation without requiring separate interfaces.

---
 fs/smb/server/transport_rdma.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)
fs/smb/server/transport_rdma.c +19 -1
index 7d86553fcc7c..4a8aeb1df0cc 100644
@@ -2606,7 +2606,7 @@ void ksmbd_rdma_destroy(void)
 	}
 }
 
-bool ksmbd_rdma_capable_netdev(struct net_device *netdev)
+static bool ksmbd_find_rdma_capable_netdev(struct net_device *netdev)
 {
 	struct smb_direct_device *smb_dev;
 	int i;
@@ -2648,6 +2648,24 @@ bool ksmbd_rdma_capable_netdev(struct net_device *netdev)
 	return rdma_capable;
 }
 
+bool ksmbd_rdma_capable_netdev(struct net_device *netdev)
+{
+	struct net_device *lower_dev;
+	struct list_head *iter;
+
+	if (ksmbd_find_rdma_capable_netdev(netdev))
+		return true;
+
+	/* check if netdev is bridge or VLAN */
+	if (netif_is_bridge_master(netdev) ||
+	    netdev->priv_flags & IFF_802_1Q_VLAN)
+		netdev_for_each_lower_dev(netdev, lower_dev, iter)
+			if (ksmbd_find_rdma_capable_netdev(lower_dev))
+				return true;
+
+	return false;
+}
+
 static const struct ksmbd_transport_ops ksmbd_smb_direct_transport_ops = {
 	.prepare	= smb_direct_prepare,
 	.disconnect	= smb_direct_disconnect,
Signature · 1 line
2.25.1
author maintainer
#1 lore raw

PATCH 2/2 ksmbd: detect RDMA capable netdevs include IPoIB

Current ksmbd_rdma_capable_netdev fails to mark certain RDMA-capable inerfaces such as IPoIB as RDMA capable after reverting GUID matching code due to layer violation.
This patch check the ARPHRD_INFINIBAND type safely identifies an IPoIB interface without introducing a layer violation, ensuring RDMA functionality is correctly enabled for these interfaces.

---
 fs/smb/server/transport_rdma.c | 4 ++++
 1 file changed, 4 insertions(+)
fs/smb/server/transport_rdma.c +4 -0
index 4a8aeb1df0cc..5d3b48e77012 100644
@@ -2663,6 +2663,10 @@ bool ksmbd_rdma_capable_netdev(struct net_device *netdev)
 			if (ksmbd_find_rdma_capable_netdev(lower_dev))
 				return true;
 
+	/* check if netdev is IPoIB safely without layer violation */
+	if (netdev->type == ARPHRD_INFINIBAND)
+		return true;
+
 	return false;
 }
 
Signature · 1 line
2.25.1