* [PATCH net-next v3 0/4] selftests: rds: ROCE support follow ups
@ 2026-06-02 5:06 Allison Henderson
2026-06-02 5:06 ` [PATCH net-next v3 1/4] selftests: rds: Rename run.sh to rds_run.sh Allison Henderson
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Allison Henderson @ 2026-06-02 5:06 UTC (permalink / raw)
To: netdev, pabeni, edumazet, kuba, horms, linux-rdma, achender,
linux-kselftest, shuah
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
--
2.25.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH net-next v3 1/4] selftests: rds: Rename run.sh to rds_run.sh
2026-06-02 5:06 [PATCH net-next v3 0/4] selftests: rds: ROCE support follow ups Allison Henderson
@ 2026-06-02 5:06 ` Allison Henderson
2026-06-02 5:06 ` [PATCH net-next v3 2/4] selftests: rds: pin RDS sockets to their intended transport Allison Henderson
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Allison Henderson @ 2026-06-02 5:06 UTC (permalink / raw)
To: netdev, pabeni, edumazet, kuba, horms, linux-rdma, achender,
linux-kselftest, shuah
This patch renames run.sh to rds_run.sh. This gives the test a
self-describing name that appears in the netdev CI dashboard.
Suggested-by: Matthieu Baerts <matttbe@kernel.org>
Signed-off-by: Allison Henderson <achender@kernel.org>
---
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%)
diff --git a/tools/testing/selftests/net/rds/Makefile b/tools/testing/selftests/net/rds/Makefile
index fe363be8e3586..ec10ae24e4cf1 100644
--- a/tools/testing/selftests/net/rds/Makefile
+++ b/tools/testing/selftests/net/rds/Makefile
@@ -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 \
diff --git a/tools/testing/selftests/net/rds/README.txt b/tools/testing/selftests/net/rds/README.txt
index bac6f15a80d52..8aa41148b1b5c 100644
--- a/tools/testing/selftests/net/rds/README.txt
+++ b/tools/testing/selftests/net/rds/README.txt
@@ -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"
diff --git a/tools/testing/selftests/net/rds/run.sh b/tools/testing/selftests/net/rds/rds_run.sh
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
--- a/tools/testing/selftests/net/rds/run.sh
+++ b/tools/testing/selftests/net/rds/rds_run.sh
@@ -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
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH net-next v3 2/4] selftests: rds: pin RDS sockets to their intended transport
2026-06-02 5:06 [PATCH net-next v3 0/4] selftests: rds: ROCE support follow ups Allison Henderson
2026-06-02 5:06 ` [PATCH net-next v3 1/4] selftests: rds: Rename run.sh to rds_run.sh Allison Henderson
@ 2026-06-02 5:06 ` Allison Henderson
2026-06-02 5:06 ` [PATCH net-next v3 3/4] selftests: rds: support RDS built as loadable modules Allison Henderson
2026-06-02 5:06 ` [PATCH net-next v3 4/4] selftests: rds: report missing RDMA prereqs as XFAIL Allison Henderson
3 siblings, 0 replies; 5+ messages in thread
From: Allison Henderson @ 2026-06-02 5:06 UTC (permalink / raw)
To: netdev, pabeni, edumazet, kuba, horms, linux-rdma, achender,
linux-kselftest, shuah
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.
Signed-off-by: Allison Henderson <achender@kernel.org>
---
tools/testing/selftests/net/rds/test.py | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/tools/testing/selftests/net/rds/test.py b/tools/testing/selftests/net/rds/test.py
index 08f2a846a8ab5..9e4df01cb0d4b 100755
--- a/tools/testing/selftests/net/rds/test.py
+++ b/tools/testing/selftests/net/rds/test.py
@@ -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}")
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH net-next v3 3/4] selftests: rds: support RDS built as loadable modules
2026-06-02 5:06 [PATCH net-next v3 0/4] selftests: rds: ROCE support follow ups Allison Henderson
2026-06-02 5:06 ` [PATCH net-next v3 1/4] selftests: rds: Rename run.sh to rds_run.sh Allison Henderson
2026-06-02 5:06 ` [PATCH net-next v3 2/4] selftests: rds: pin RDS sockets to their intended transport Allison Henderson
@ 2026-06-02 5:06 ` Allison Henderson
2026-06-02 5:06 ` [PATCH net-next v3 4/4] selftests: rds: report missing RDMA prereqs as XFAIL Allison Henderson
3 siblings, 0 replies; 5+ messages in thread
From: Allison Henderson @ 2026-06-02 5:06 UTC (permalink / raw)
To: netdev, pabeni, edumazet, kuba, horms, linux-rdma, achender,
linux-kselftest, shuah
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.
Signed-off-by: Allison Henderson <achender@kernel.org>
---
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(-)
diff --git a/tools/testing/selftests/net/rds/config b/tools/testing/selftests/net/rds/config
index 3d62d0c750a80..97db7ecb892aa 100644
--- a/tools/testing/selftests/net/rds/config
+++ b/tools/testing/selftests/net/rds/config
@@ -1,4 +1,3 @@
-CONFIG_MODULES=n
CONFIG_NET_NS=y
CONFIG_NET_SCH_NETEM=y
CONFIG_RDS=y
diff --git a/tools/testing/selftests/net/rds/config.sh b/tools/testing/selftests/net/rds/config.sh
index be0668359a070..2df2226310efe 100755
--- a/tools/testing/selftests/net/rds/config.sh
+++ b/tools/testing/selftests/net/rds/config.sh
@@ -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
diff --git a/tools/testing/selftests/net/rds/rds_run.sh b/tools/testing/selftests/net/rds/rds_run.sh
index 63080fef492b7..f01c81415331f 100755
--- a/tools/testing/selftests/net/rds/rds_run.sh
+++ b/tools/testing/selftests/net/rds/rds_run.sh
@@ -93,38 +93,58 @@ check_gcov_conf()
fi
}
+# Checks if a kconfig is enabled (set to =y or =m)
+# $1: kconfig symbol to check
+# $2: (optional) module name backing $1
+# Ex: check_conf_enabled CONFIG_RDS_TCP rds_tcp
+# Modules for configs set to =m will be probed
+# If omitted, only a built-in (=y) config is accepted.
+# Returns on success. exits 4 on failure
# Kselftest framework requirement - SKIP code is 4.
check_conf_enabled() {
- if ! grep -x "$1=y" "$kconfig" > /dev/null 2>&1; then
- echo "selftests: [SKIP] This test requires $1 enabled"
- echo "Please run tools/testing/selftests/net/rds/config.sh and rebuild the kernel"
- exit 4
+ if grep -x "$1=y" "$kconfig" > /dev/null 2>&1; then
+ return
fi
+ if [ -n "${2:-}" ] && grep -x "$1=m" "$kconfig" > /dev/null 2>&1; then
+ probe_module "$2"
+ return
+ fi
+ echo "selftests: [SKIP] This test requires $1 enabled"
+ echo "Please run" \
+ "tools/testing/selftests/net/rds/config.sh and rebuild the kernel"
+ exit 4
}
check_rdma_conf_enabled() {
- if ! grep -x "$1=y" "$kconfig" > /dev/null 2>&1; then
- echo "selftests: [SKIP] rdma transport requires $1 enabled"
- echo "To enable, run " \
- "tools/testing/selftests/net/rds/config.sh -r and rebuild"
- exit 4
+ if grep -x "$1=y" "$kconfig" > /dev/null 2>&1; then
+ return
+ fi
+ if [ -n "${2:-}" ] && grep -x "$1=m" "$kconfig" > /dev/null 2>&1; then
+ probe_module "$2"
+ return
fi
+ echo "selftests: [SKIP] rdma transport requires $1 enabled"
+ echo "To enable, run" \
+ "tools/testing/selftests/net/rds/config.sh -r and rebuild"
+ exit 4
}
-check_conf_disabled() {
- if grep -x "$1=y" "$kconfig" > /dev/null 2>&1; then
- echo "selftests: [SKIP] This test requires $1 disabled"
- echo "Please run tools/testing/selftests/net/rds/config.sh and rebuild the kernel"
+# Load the module backing a config that is built as a loadable module
+# (=m). Built-in (=y) configs are already available and don't reach
+# here. Exits with the SKIP code if a required module cannot be loaded.
+probe_module() {
+ if ! modprobe -q "$1"; then
+ echo "selftests: [SKIP] could not load required module $1"
exit 4
fi
}
+
check_conf() {
- check_conf_enabled CONFIG_NET_SCH_NETEM
- check_conf_enabled CONFIG_VETH
+ check_conf_enabled CONFIG_NET_SCH_NETEM sch_netem
+ check_conf_enabled CONFIG_VETH veth
check_conf_enabled CONFIG_NET_NS
- check_conf_enabled CONFIG_RDS_TCP
- check_conf_enabled CONFIG_RDS
- check_conf_disabled CONFIG_MODULES
+ check_conf_enabled CONFIG_RDS_TCP rds_tcp
+ check_conf_enabled CONFIG_RDS rds
}
# Check kernel config and host environment for RDS-RDMA support.
@@ -139,8 +159,8 @@ check_rdma_conf()
# Kconfig will enforce CONFIG_INFINIBAND_* as dependencies
# of CONFIG_RDMA_RXE
- check_rdma_conf_enabled CONFIG_RDMA_RXE
- check_rdma_conf_enabled CONFIG_RDS_RDMA
+ check_rdma_conf_enabled CONFIG_RDMA_RXE rdma_rxe
+ 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'" \
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH net-next v3 4/4] selftests: rds: report missing RDMA prereqs as XFAIL
2026-06-02 5:06 [PATCH net-next v3 0/4] selftests: rds: ROCE support follow ups Allison Henderson
` (2 preceding siblings ...)
2026-06-02 5:06 ` [PATCH net-next v3 3/4] selftests: rds: support RDS built as loadable modules Allison Henderson
@ 2026-06-02 5:06 ` Allison Henderson
3 siblings, 0 replies; 5+ messages in thread
From: Allison Henderson @ 2026-06-02 5:06 UTC (permalink / raw)
To: netdev, pabeni, edumazet, kuba, horms, linux-rdma, achender,
linux-kselftest, shuah
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].
Signed-off-by: Allison Henderson <achender@kernel.org>
---
tools/testing/selftests/net/rds/rds_run.sh | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/tools/testing/selftests/net/rds/rds_run.sh b/tools/testing/selftests/net/rds/rds_run.sh
index f01c81415331f..cdf487ec97dcc 100755
--- a/tools/testing/selftests/net/rds/rds_run.sh
+++ b/tools/testing/selftests/net/rds/rds_run.sh
@@ -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
}
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-06-02 5:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-02 5:06 [PATCH net-next v3 0/4] selftests: rds: ROCE support follow ups Allison Henderson
2026-06-02 5:06 ` [PATCH net-next v3 1/4] selftests: rds: Rename run.sh to rds_run.sh Allison Henderson
2026-06-02 5:06 ` [PATCH net-next v3 2/4] selftests: rds: pin RDS sockets to their intended transport Allison Henderson
2026-06-02 5:06 ` [PATCH net-next v3 3/4] selftests: rds: support RDS built as loadable modules Allison Henderson
2026-06-02 5:06 ` [PATCH net-next v3 4/4] selftests: rds: report missing RDMA prereqs as XFAIL Allison Henderson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox