Skip to contentSkip to conversation

selftests: rds: ROCE support follow ups

PATCH Applied Allison Henderson 2 participants 6 messages Jun 2 – Jun 5

Subsystems (5)
lore
Share & tools
lore

Allison Henderson

author maintainer
#0 lore raw

v3 cover selftests: rds: ROCE support follow ups

Hi all,

This is a follow up series to the "Add ROCE support to rds selftests" series. The first patch renames run.sh to rds_run.sh, which provides a self-describing name that appears on the netdev CI dashboard.

The second patch addresses a sashiko complaint that I thought was worth circling back for. In the patch "pin RDS sockets to their intended transport," sockets are pinned to the specific transport they are meant to test. By default, socket transports are implicitly selected based on the network topology, but it is possible that they can fail back to other transports if the underlying connection could not be established. So the patch pins them to the intended transport to avoid false positives.

The third patch "support RDS built as loadable modules," lifts the CONFIG_MODULES=n requirement, and updates the check_*conf_enabled() to allow modules set to "=m" and further load the backing modules for any component set as such. config.sh is updated to match.

The fourth patch converts the rdma-prerequisite checks to return XFAIL rather than SKIP, since the RDMA datapath is not run in netdev CI.

Questions, comments and feedback appreciated!

Thanks everyone!
Allison

Change log:
v3:
[PATCH net-next v2 1/4] selftests: rds: Rename run.sh to rds_run.sh
- Wrapped USAGE line to fix checkpatch 84-column warning

[PATCH net-next v2 3/4] selftests: rds: support RDS built as loadable modules
- Drop --disable CONFIG_MODULES from config.sh

[PATCH net-next v2 4/4] selftests: rds: report missing RDMA prereqs as XFAIL
- Corrected XFAIL rc from 5 to 2

v2:
[PATCH net-next v1 1/3] selftests: rds: add per-transport run wrappers
- Renamed to "selftests: rds: Rename run.sh to rds_run.sh"
- Removed rds_*_run.sh wrappers
- Dropped dangling wrapper paragraph from README

[PATCH net-next v1 3/3] selftests: rds: support RDS built as loadable modules
- Fixed long line length warning

[PATCH net-next v2 4/4] selftests: rds: report missing RDMA prereqs as XFAIL
- NEW

Allison Henderson (4):
selftests: rds: Rename run.sh to rds_run.sh
selftests: rds: pin RDS sockets to their intended transport
selftests: rds: support RDS built as loadable modules
selftests: rds: report missing RDMA prereqs as XFAIL

 tools/testing/selftests/net/rds/Makefile      |  2 +-
 tools/testing/selftests/net/rds/README.txt    |  8 +-
 tools/testing/selftests/net/rds/config        |  1 -
 tools/testing/selftests/net/rds/config.sh     |  3 -
 .../selftests/net/rds/{run.sh => rds_run.sh}  | 75 ++++++++++++-------
 tools/testing/selftests/net/rds/test.py       | 18 +++++
 6 files changed, 71 insertions(+), 36 deletions(-)
 rename tools/testing/selftests/net/rds/{run.sh => rds_run.sh} (78%)

base-commit: 1a1f055318d82e64485a6ff8420e5f70b4267998

Signature · 1 line
2.25.1
author maintainer
#1 lore raw

PATCH v3 1/4 selftests: rds: Rename run.sh to rds_run.sh

This patch renames run.sh to rds_run.sh. This gives the test a self-describing name that appears in the netdev CI dashboard.

---
 tools/testing/selftests/net/rds/Makefile               | 2 +-
 tools/testing/selftests/net/rds/README.txt             | 8 ++++----
 tools/testing/selftests/net/rds/{run.sh => rds_run.sh} | 7 ++++---
 3 files changed, 9 insertions(+), 8 deletions(-)
 rename tools/testing/selftests/net/rds/{run.sh => rds_run.sh} (96%)
tools/testing/selftests/net/rds/Makefile +1 -1
index fe363be8e3586..ec10ae24e4cf1 100644
@@ -3,7 +3,7 @@
 all:
 	@echo mk_build_dir="$(shell pwd)" > include.sh
 
-TEST_PROGS := run.sh
+TEST_PROGS := rds_run.sh
 
 TEST_FILES := \
 	include.sh \
tools/testing/selftests/net/rds/README.txt +4 -4
index bac6f15a80d52..8aa41148b1b5c 100644
@@ -14,9 +14,9 @@ configs required for the RDMA transport.  The kernel may optionally be
 configured to omit the coverage report as well.
 
 USAGE:
-	run.sh [-d logdir] [-l packet_loss] [-c packet_corruption]
-	       [-u packet_duplicate] [-t timeout]
-	       [-T tcp|rdma|tcp,rdma]
+	rds_run.sh [-d logdir] [-l packet_loss] [-c packet_corruption]
+	           [-u packet_duplicate] [-t timeout]
+	           [-T tcp|rdma|tcp,rdma]
 
 OPTIONS:
 	-d	Log directory.  If set, logs will be stored in the
@@ -73,5 +73,5 @@ EXAMPLE:
         "export PYTHONPATH=tools/testing/selftests/net/; \
          export SUDO_USER=example_user; \
          export RDS_LOG_DIR=tools/testing/selftests/net/rds/rds_logs; \
-         tools/testing/selftests/net/rds/run.sh -T tcp,rdma"
+         tools/testing/selftests/net/rds/rds_run.sh -T tcp,rdma"
 
tools/testing/selftests/net/rds/rds_run.sh renamed from tools/testing/selftests/net/rds/run.sh +4 -3
similarity index 96%
rename from tools/testing/selftests/net/rds/run.sh
rename to tools/testing/selftests/net/rds/rds_run.sh
index 07af2f927a2a7..63080fef492b7 100755
@@ -209,8 +209,9 @@ while getopts "d:l:c:u:t:T:" opt; do
       TRANSPORT=${OPTARG}
       ;;
     :)
-      echo "USAGE: run.sh [-d logdir] [-l packet_loss] [-c packet_corruption]" \
-           "[-u packet_duplicate] [-t timeout] [-T tcp|rdma|tcp,rdma]"
+      echo "USAGE: rds_run.sh [-d logdir] [-l packet_loss]" \
+           "[-c packet_corruption] [-u packet_duplicate] [-t timeout]" \
+           "[-T tcp|rdma|tcp,rdma]"
       exit 1
       ;;
     ?)
@@ -224,7 +225,7 @@ done
 IFS=',' read -ra transports <<< "$TRANSPORT"
 for t in "${transports[@]}"; do
     if [ "$t" != "tcp" ] && [ "$t" != "rdma" ]; then
-        echo "run.sh: unknown transport '$t' (expected tcp or rdma)"
+        echo "rds_run.sh: unknown transport '$t' (expected tcp or rdma)"
         exit 1
     fi
 done

base-commit: 1a1f055318d82e64485a6ff8420e5f70b4267998

Signature · 1 line
2.25.1
author maintainer
#2 lore raw

PATCH v3 2/4 selftests: rds: pin RDS sockets to their intended transport

In reply to Allison Henderson

The RDS selftests create AF_RDS sockets but never selects a transport, so the transport is chosen implicitly based on network topology when the socket is bound. If underlying connection establishment fails, RDS can fall back to another transport (e.g. loopback) and the test still passes, silently bypassing the intended datapath it is meant to exercise.

Set SO_RDS_TRANSPORT to the proper RDS_TRANS_IB or RDS_TRANS_TCP before they are bound, so the test fails loudly if the intended transport is unavailable rather than passing on a different path.

---
 tools/testing/selftests/net/rds/test.py | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
tools/testing/selftests/net/rds/test.py +18 -0
index 08f2a846a8ab5..9e4df01cb0d4b 100755
@@ -59,6 +59,14 @@ rdma_addrs = [
 OP_FLAG_TCP     = 0x1
 OP_FLAG_RDMA    = 0x2
 
+# from include/uapi/linux/rds.h: SO_RDS_TRANSPORT pins a socket to a
+# specific RDS transport so connection setup cannot silently fall back
+# to another (e.g. loopback) transport.
+SOL_RDS          = 276
+SO_RDS_TRANSPORT = 8
+RDS_TRANS_TCP    = 2
+RDS_TRANS_IB     = 0
+
 signal_handler_label = ""
 
 tap_idx = 0
@@ -214,11 +222,21 @@ def snd_rcv_packets(env):
             netns_socket(netns_list[0], socket.AF_RDS, socket.SOCK_SEQPACKET),
             netns_socket(netns_list[1], socket.AF_RDS, socket.SOCK_SEQPACKET),
         ]
+
+        # Pin the sockets to the TCP transport so it doesn't fail over to a
+        # different transport during this test
+        for s in sockets:
+            s.setsockopt(SOL_RDS, SO_RDS_TRANSPORT, RDS_TRANS_TCP)
     elif flags & OP_FLAG_RDMA:
         sockets = [
             socket.socket(socket.AF_RDS, socket.SOCK_SEQPACKET),
             socket.socket(socket.AF_RDS, socket.SOCK_SEQPACKET),
         ]
+
+        # Pin the sockets to the RDMA transport so it doesn't fail over to a
+        # different transport during this test
+        for s in sockets:
+            s.setsockopt(SOL_RDS, SO_RDS_TRANSPORT, RDS_TRANS_IB)
     else:
         raise RuntimeError(f"Invalid transport flag sets no transports: {flags}")
 
Signature · 1 line
2.25.1
author maintainer
#3 lore raw

PATCH v3 3/4 selftests: rds: support RDS built as loadable modules

In reply to Allison Henderson

Commit 92cc6708f4a2 ("selftests: rds: config: disable modules") set CONFIG_MODULES=n since run.sh required this kconfig. But disabling modules also forces every =m option to =n rather than =y, which can silently drop unrelated features.

This patch removes CONFIG_MODULES=n from the rds selftest config and updates the check_*conf_enabled() routines to accept a config as either built-in (=y) or modular (=m). A new probe_module() function is added to load the backing module when a component is set to be modular (=m). config.sh no longer forces CONFIG_MODULES=n, so a user who follows the SKIP message to run config.sh does not silently end up with modules disabled again.

rds.ko itself is auto-loaded on socket creation, and rds_rdma.ko is auto-loaded when SO_RDS_TRANSPORT is set with RDS_TRANS_IB, but the TCP transport (rds_tcp.ko) is not auto-loaded on the bind path, so the backing modules are loaded explicitly here.

---
 tools/testing/selftests/net/rds/config     |  1 -
 tools/testing/selftests/net/rds/config.sh  |  3 --
 tools/testing/selftests/net/rds/rds_run.sh | 60 ++++++++++++++--------
 3 files changed, 40 insertions(+), 24 deletions(-)
tools/testing/selftests/net/rds/config +0 -1
index 3d62d0c750a80..97db7ecb892aa 100644
@@ -1,4 +1,3 @@
-CONFIG_MODULES=n
 CONFIG_NET_NS=y
 CONFIG_NET_SCH_NETEM=y
 CONFIG_RDS=y
tools/testing/selftests/net/rds/config.sh +0 -3
index be0668359a070..2df2226310efe 100755
@@ -37,9 +37,6 @@ if [[ "$CONF_FILE" != "" ]]; then
 	FLAGS=(--file "$CONF_FILE")
 fi
 
-# no modules
-scripts/config "${FLAGS[@]}" --disable CONFIG_MODULES
-
 # enable RDS
 scripts/config "${FLAGS[@]}" --enable CONFIG_RDS
 scripts/config "${FLAGS[@]}" --enable CONFIG_RDS_TCP
tools/testing/selftests/net/rds/rds_run.sh +40 -20

86 lines not on this page · raw message

Signature · 1 line
2.25.1
author maintainer
#4 lore raw

PATCH v3 4/4 selftests: rds: report missing RDMA prereqs as XFAIL

In reply to Allison Henderson

Make the RDMA test return XFAIL rather than skip when RXE is not available, since the RDMA datapath is not run in netdev CI.

Change the three RDMA-prerequisite checks in check_rdma_conf() and check_rdma_conf_enabled() to exit with KSFT_XFAIL (2) and tag their messages [XFAIL] instead of [SKIP].

---
 tools/testing/selftests/net/rds/rds_run.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
tools/testing/selftests/net/rds/rds_run.sh +6 -6
index f01c81415331f..cdf487ec97dcc 100755
@@ -123,10 +123,10 @@ check_rdma_conf_enabled() {
 		probe_module "$2"
 		return
 	fi
-	echo "selftests: [SKIP] rdma transport requires $1 enabled"
+	echo "selftests: [XFAIL] rdma transport requires $1 enabled"
 	echo "To enable, run" \
 	     "tools/testing/selftests/net/rds/config.sh -r and rebuild"
-	exit 4
+	exit 2
 }
 
 # Load the module backing a config that is built as a loadable module
@@ -148,7 +148,7 @@ check_conf() {
 }
 
 # Check kernel config and host environment for RDS-RDMA support.
-# Exits with SKIP (4) if the user requested rdma but prerequisites
+# Exits with XFAIL (2) if the user requested rdma but prerequisites
 # are not met.
 check_rdma_conf()
 {
@@ -163,9 +163,9 @@ check_rdma_conf()
 	check_rdma_conf_enabled CONFIG_RDS_RDMA rds_rdma
 
 	if ! which rdma > /dev/null 2>&1; then
-		echo "selftests: [SKIP] rdma transport requires the 'rdma'" \
-		      " tool (iproute2)"
-		exit 4
+		echo "selftests: [XFAIL] rdma transport requires the 'rdma'" \
+		      "tool (iproute2)"
+		exit 2
 	fi
 }
 
Signature · 1 line
2.25.1
#5 lore raw
In reply to Allison Henderson
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 15 lines · On Mon, 1 Jun 2026 22:06:53 -0700 you wrote:

Hi all,

This is a follow up series to the "Add ROCE support to rds selftests" series. The first patch renames run.sh to rds_run.sh, which provides a self-describing name that appears on the netdev CI dashboard.

The second patch addresses a sashiko complaint that I thought was worth circling back for. In the patch "pin RDS sockets to their intended transport," sockets are pinned to the specific transport they are meant to test. By default, socket transports are implicitly selected based on the network topology, but it is possible that they can fail back to other transports if the underlying connection could not be established. So the patch pins them to the intended transport to avoid false positives.

Quoted 1 line

[...]

Here is the summary with links:
- [net-next,v3,1/4] selftests: rds: Rename run.sh to rds_run.sh

    https://git.kernel.org/netdev/net-next/c/6d05d3cb44c5
  - [net-next,v3,2/4] selftests: rds: pin RDS sockets to their intended transport
    https://git.kernel.org/netdev/net-next/c/d2e76c5b1418
  - [net-next,v3,3/4] selftests: rds: support RDS built as loadable modules
    https://git.kernel.org/netdev/net-next/c/c5eb137685f3
  - [net-next,v3,4/4] selftests: rds: report missing RDMA prereqs as XFAIL
    https://git.kernel.org/netdev/net-next/c/e3ab0affc10f

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html