Skip to content

RDMA/rxe: Add the support that rxe can work in net namespace

Zhu Yanjun linux-kselftest linux-rdma 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4RDMA/rxe: Add testcase for net namespace rxeMAINTAINERS tools/testing/selftests/Makefile tools/testing/selftests/rdma/Makefile +4 more+178 -01 reply
2/4RDMA/nldev: Add dellink function pointerdrivers/infiniband/core/nldev.c include/rdma/rdma_netlink.h+8 -00 replies
3/4RDMA/rxe: Add net namespace support for IPv4/IPv6 socketsdrivers/infiniband/sw/rxe/Makefile drivers/infiniband/sw/rxe/rxe_ns.c drivers/infiniband/sw/rxe/rxe_ns.h+153 -12 replies
4/4RDMA/rxe: Support RDMA link creation and destruction per net namespacedrivers/infiniband/sw/rxe/rxe.c drivers/infiniband/sw/rxe/rxe_net.c drivers/infiniband/sw/rxe/rxe_net.h +1 more+154 -403 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/4] RDMA/rxe: Add the support that rxe can work in net namespace

Currently rxe does not work correctly in network namespaces.

When the rdma_rxe module is loaded, a UDP socket listening on port 4791 is created in init_net. When users run:

ip link add ... type rxe

inside another network namespace, the RXE RDMA link is created but it cannot function properly because the underlying UDP socket belongs to init_net. Other network namespaces cannot use that socket.

To address this issue, this series introduces net namespace support for rxe and moves socket management to be per network namespace.

The series first introduces per-net namespace management for the IPv4 and IPv6 sockets used by rxe. The sockets are created when the network namespace becomes active and are released when the namespace is destroyed.

Based on this infrastructure, rxe RDMA links are then created and destroyed within each network namespace. This ensures that both the UDP sockets and RDMA links are correctly scoped to the namespace in which they are used.

With these changes, rxe RDMA links can be created and used both in init_net and in other network namespaces, and resources are properly cleaned up during namespace teardown.

The series also includes a selftest to verify RXE functionality in network namespaces.

Zhu Yanjun (4):
RDMA/rxe: Add testcase for net namespace rxe
RDMA/nldev: Add dellink function pointer
RDMA/rxe: Add net namespace support for IPv4/IPv6 sockets RDMA/rxe: Support RDMA link creation and destruction per net namespace

 MAINTAINERS                                   |   1 +
 drivers/infiniband/core/nldev.c               |   6 +
 drivers/infiniband/sw/rxe/Makefile            |   3 +-
 drivers/infiniband/sw/rxe/rxe.c               |  41 ++++-
 drivers/infiniband/sw/rxe/rxe_net.c           | 122 ++++++++++----
 drivers/infiniband/sw/rxe/rxe_net.h           |   9 +-
 drivers/infiniband/sw/rxe/rxe_ns.c            | 156 ++++++++++++++++++
 drivers/infiniband/sw/rxe/rxe_ns.h            |  17 ++
 include/rdma/rdma_netlink.h                   |   2 +
 tools/testing/selftests/Makefile              |   1 +
 tools/testing/selftests/rdma/Makefile         |   5 +
 tools/testing/selftests/rdma/config           |   3 +
 .../selftests/rdma/rping_between_netns.sh     |  57 +++++++
 tools/testing/selftests/rdma/rxe_ipv6.sh      |  47 ++++++
 .../testing/selftests/rdma/socket_with_rxe.sh |  64 +++++++
 15 files changed, 493 insertions(+), 41 deletions(-)
 create mode 100644 drivers/infiniband/sw/rxe/rxe_ns.c
 create mode 100644 drivers/infiniband/sw/rxe/rxe_ns.h
 create mode 100644 tools/testing/selftests/rdma/Makefile
 create mode 100644 tools/testing/selftests/rdma/config
 create mode 100755 tools/testing/selftests/rdma/rping_between_netns.sh
 create mode 100755 tools/testing/selftests/rdma/rxe_ipv6.sh
 create mode 100755 tools/testing/selftests/rdma/socket_with_rxe.sh
Signature · 1 line
2.52.0