summaryrefslogtreecommitdiff
path: root/drivers/infiniband/ulp
diff options
context:
space:
mode:
authorMark Bloch <mbloch@nvidia.com>2025-06-17 11:44:03 +0300
committerLeon Romanovsky <leon@kernel.org>2025-06-26 08:13:47 -0400
commitf1208b05574f63c52e88109d8c75afdf4fc6bf42 (patch)
tree53a07e7022d201593725c615d75ebd87f8be2b85 /drivers/infiniband/ulp
parent611d08207d313500d010d8792424346ce70d0cfb (diff)
downloadlwn-f1208b05574f63c52e88109d8c75afdf4fc6bf42.tar.gz
lwn-f1208b05574f63c52e88109d8c75afdf4fc6bf42.zip
RDMA/ipoib: Use parent rdma device net namespace
Use the net namespace of the underlying rdma device. After honoring the rdma device's namespace, the ipoib netdev now also runs in the same net namespace of the rdma device. Add an API to read the net namespace of the rdma device so that ULP such as IPoIB can use it to initialize its netdev. Signed-off-by: Parav Pandit <parav@nvidia.com> Signed-off-by: Mark Bloch <mbloch@nvidia.com> Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Diffstat (limited to 'drivers/infiniband/ulp')
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index f2f5465f2a90..7acafc5c0e09 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -2577,6 +2577,8 @@ static struct net_device *ipoib_add_port(const char *format,
ndev->rtnl_link_ops = ipoib_get_link_ops();
+ dev_net_set(ndev, rdma_dev_net(hca));
+
result = register_netdev(ndev);
if (result) {
pr_warn("%s: couldn't register ipoib port %d; error %d\n",