Skip to content

RDMA net namespace

Zhu Yanjun linux-rdma 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 29 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3RDMA/core: Move ib device to the same net namespace with net devicedrivers/infiniband/core/device.c+57 -00 replies
2/3RDMA/core: The legacy IB devices still work with shared/exclusive modedrivers/infiniband/core/device.c+13 -20 replies
3/3RDMA/core: Get all the ib devices from net devicesdrivers/infiniband/core/device.c+37 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] RDMA net namespace

From: Zhu Yanjun <[email protected]>

There are shared and exclusive modes in RDMA net namespace. After discussion with Leon, the above modes are compatible with legacy IB device.

To the RoCE and iWARP devices, the ib devices should be in the same net namespace with the related net devices regardless of in shared or exclusive mode.

In the first commit, when the net devices are moved to a new net namespace, the related ib devices are also moved to the same net namespace.

In the second commit, the shared/exclusive modes still work with legacy ib devices. To the RoCE and iWARP devices, these modes will not be considered.

Because MLX4/5 do not call the function ib_device_set_netdev to map ib devices and the related net devices, the function ib_device_get_by_netdev can not get ib devices from net devices. In the third commit, all the registered ib devices are parsed to get the net devices, then compared with the given net devices.

The steps to make tests:
1) Create a new net namespace net0

ip netns add net0

2) Show the rdma links in init_net

rdma link

"
link mlx5_0/1 state DOWN physical_state DISABLED netdev enp7s0np1 "

3) Move the net device to net namespace net0

ip link set enp7s0np1 netns net0

4) Show the rdma links in init_net again

rdma link

There is no rdma links

5) Show the rdma links in net0

ip netns exec net0 rdma link

"
link mlx5_0/1 state DOWN physical_state DISABLED netdev enp7s0np1 "

We can confirm that rdma links are moved to the same net namespace with the net devices.

Zhu Yanjun (3):
RDMA/core: Move ib device to the same net namespace with net device RDMA/core: The legacy IB devices still work with shared/exclusive mode RDMA/core: Get all the ib devices from net devices

 drivers/infiniband/core/device.c | 107 ++++++++++++++++++++++++++++++-
 1 file changed, 105 insertions(+), 2 deletions(-)
Signature · 1 line
2.27.0