[RFC PATCH 2/2] RDMA/nldev: remove the unused dellink link op
From: Serhat Kumral
Date: Sat Jul 18 2026 - 10:42:39 EST
rxe was the only driver implementing rdma_link_ops.dellink and does
not need it anymore now that its UDP tunnel sockets follow the GID
table. Remove the callback, the nldev code invoking it, the mutex
that serialized it and the now unused ib_device::link_ops field the
invocation looked it up through.
Assisted-by: Claude:claude-fable-5
Signed-off-by: Serhat Kumral <serhatkumral1@xxxxxxxxx>
---
drivers/infiniband/core/nldev.c | 15 ---------------
include/rdma/ib_verbs.h | 2 --
include/rdma/rdma_netlink.h | 1 -
3 files changed, 18 deletions(-)
diff --git a/drivers/infiniband/core/nldev.c b/drivers/infiniband/core/nldev.c
index f599c24b34e8..0d1e749d78e1 100644
--- a/drivers/infiniband/core/nldev.c
+++ b/drivers/infiniband/core/nldev.c
@@ -51,7 +51,6 @@
* a controlled QKEY.
*/
static bool privileged_qkey;
-static DEFINE_MUTEX(nldev_dellink_mutex);
typedef int (*res_fill_func_t)(struct sk_buff*, bool,
struct rdma_restrack_entry*, uint32_t);
@@ -1866,20 +1865,6 @@ static int nldev_dellink(struct sk_buff *skb, struct nlmsghdr *nlh,
return -EINVAL;
}
- /*
- * This path is triggered by the 'rdma link delete' administrative command.
- * For Soft-RoCE (RXE), we ensure that transport sockets are closed here.
- * Note: iWARP driver does not implement .dellink, so this logic is
- * implicitly scoped to the driver supporting dynamic link deletion like RXE.
- */
- if (device->link_ops && device->link_ops->dellink) {
- mutex_lock(&nldev_dellink_mutex);
- err = device->link_ops->dellink(device);
- mutex_unlock(&nldev_dellink_mutex);
- if (err)
- return err;
- }
-
ib_unregister_device_and_put(device);
return 0;
}
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 794746de8db0..620f00f5d026 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -2984,8 +2984,6 @@ struct ib_device {
struct completion unreg_completion;
struct work_struct unregistration_work;
- const struct rdma_link_ops *link_ops;
-
/* Protects compat_devs xarray modifications */
struct mutex compat_devs_mutex;
/* Maintains compat devices for each net namespace */
diff --git a/include/rdma/rdma_netlink.h b/include/rdma/rdma_netlink.h
index 2fd1358ea57d..d1a7186f7436 100644
--- a/include/rdma/rdma_netlink.h
+++ b/include/rdma/rdma_netlink.h
@@ -127,7 +127,6 @@ struct rdma_link_ops {
struct list_head list;
const char *type;
int (*newlink)(const char *ibdev_name, struct net_device *ndev);
- int (*dellink)(struct ib_device *dev);
};
void rdma_link_register(struct rdma_link_ops *ops);
--
2.54.0