Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

RDMA/nldev: Add dellink function pointer

Add a dellink function pointer to rdma_link_ops to
allow drivers to clean up resources created during
newlink.

Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
Link: https://patch.msgid.link/20260313023058.13020-2-yanjun.zhu@linux.dev
Signed-off-by: Leon Romanovsky <leon@kernel.org>

authored by

Zhu Yanjun and committed by
Leon Romanovsky
a60e3f3d 5aa437c9

+14
+12
drivers/infiniband/core/nldev.c
··· 1839 1839 return -EINVAL; 1840 1840 } 1841 1841 1842 + /* 1843 + * This path is triggered by the 'rdma link delete' administrative command. 1844 + * For Soft-RoCE (RXE), we ensure that transport sockets are closed here. 1845 + * Note: iWARP driver does not implement .dellink, so this logic is 1846 + * implicitly scoped to the driver supporting dynamic link deletion like RXE. 1847 + */ 1848 + if (device->link_ops && device->link_ops->dellink) { 1849 + err = device->link_ops->dellink(device); 1850 + if (err) 1851 + return err; 1852 + } 1853 + 1842 1854 ib_unregister_device_and_put(device); 1843 1855 return 0; 1844 1856 }
+2
include/rdma/rdma_netlink.h
··· 5 5 6 6 #include <linux/netlink.h> 7 7 #include <uapi/rdma/rdma_netlink.h> 8 + #include <rdma/ib_verbs.h> 8 9 9 10 struct ib_device; 10 11 ··· 127 126 struct list_head list; 128 127 const char *type; 129 128 int (*newlink)(const char *ibdev_name, struct net_device *ndev); 129 + int (*dellink)(struct ib_device *dev); 130 130 }; 131 131 132 132 void rdma_link_register(struct rdma_link_ops *ops);