Skip to contentSkip to conversation

ksmbd: use ib_device_get_netdev() instead of calling ops.get_netdev

PATCH In review Namjae Jeon 2 participants 2 messages Mar 22, 2025 – Mar 25, 2025

Subsystems (3)
lore
Share & tools
lore

Namjae Jeon

author maintainer
#0 lore raw

PATCH 1/1 ksmbd: use ib_device_get_netdev() instead of calling ops.get_netdev

ULPs are not supposed to call to ops.* directly.

---
 fs/smb/server/transport_rdma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
fs/smb/server/transport_rdma.c +2 -4
index 9837a41641ce..4998df04ab95 100644
@@ -2142,8 +2142,7 @@ static int smb_direct_ib_client_add(struct ib_device *ib_dev)
 	if (ib_dev->node_type != RDMA_NODE_IB_CA)
 		smb_direct_port = SMB_DIRECT_PORT_IWARP;
 
-	if (!ib_dev->ops.get_netdev ||
-	    !rdma_frwr_is_supported(&ib_dev->attrs))
+	if (!rdma_frwr_is_supported(&ib_dev->attrs))
 		return 0;
 
 	smb_dev = kzalloc(sizeof(*smb_dev), KSMBD_DEFAULT_GFP);
@@ -2243,8 +2242,7 @@ bool ksmbd_rdma_capable_netdev(struct net_device *netdev)
 		for (i = 0; i < smb_dev->ib_dev->phys_port_cnt; i++) {
 			struct net_device *ndev;
 
-			ndev = smb_dev->ib_dev->ops.get_netdev(smb_dev->ib_dev,
-							       i + 1);
+			ndev = ib_device_get_netdev(smb_dev->ib_dev, i + 1);
 			if (!ndev)
 				continue;
 
Signature · 1 line
2.25.1