diff options
| author | Mark Bloch <mbloch@nvidia.com> | 2025-06-17 11:44:03 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-08-15 16:39:02 +0200 |
| commit | cd024be70b4ba049c629882de20cb59aaf7410b9 (patch) | |
| tree | f5daebae3bc3423581875f17f1e63bfe6fd96d15 /include/rdma | |
| parent | 4ecd2d763013c7629f563ae0ad8f2ab77ed92171 (diff) | |
| download | linux-cd024be70b4ba049c629882de20cb59aaf7410b9.tar.gz linux-cd024be70b4ba049c629882de20cb59aaf7410b9.tar.bz2 linux-cd024be70b4ba049c629882de20cb59aaf7410b9.zip | |
RDMA/ipoib: Use parent rdma device net namespace
[ Upstream commit f1208b05574f63c52e88109d8c75afdf4fc6bf42 ]
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>
Stable-dep-of: f458ccd2aa2c ("RDMA/uverbs: Check CAP_NET_RAW in user namespace for flow create")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/rdma')
| -rw-r--r-- | include/rdma/ib_verbs.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index af43a8d2a74a..c83e5a375cd6 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -4855,6 +4855,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) |
