aboutsummaryrefslogtreecommitdiffstats
path: root/include/rdma
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 /include/rdma
parentRDMA/mlx5: Allocate IB device with net namespace supplied from core dev (diff)
downloadlinux-f1208b05574f63c52e88109d8c75afdf4fc6bf42.tar.gz
linux-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 'include/rdma')
-rw-r--r--include/rdma/ib_verbs.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index b91a81234832..7da27f01eeb6 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -4871,6 +4871,11 @@ static inline int ibdev_to_node(struct ib_device *ibdev)
bool rdma_dev_access_netns(const struct ib_device *device,
const struct net *net);
+static inline struct net *rdma_dev_net(struct ib_device *device)
+{
+ return read_pnet(&device->coredev.rdma_net);
+}
+
#define IB_ROCE_UDP_ENCAP_VALID_PORT_MIN (0xC000)
#define IB_ROCE_UDP_ENCAP_VALID_PORT_MAX (0xFFFF)
#define IB_GRH_FLOWLABEL_MASK (0x000FFFFF)