On Wed, May 06, 2026 at 02:03:05PM +0800, Chenguang Zhao wrote: > This adds a minimal RDMA CM selftest suite that captures observability > baselines and runs trace, counter-delta, and fault-injection-oriented > checks, plus a review-loop helper for repeated validation rounds. > > Signed-off-by: Chenguang Zhao <[email protected]> > --- > v3: > TARGET += rdma is already present, remove it > as suggested by Yanjun. > > v2: > > https://lore.kernel.org/all/[email protected]/ > > v1: > > https://lore.kernel.org/all/[email protected]/ > --- > tools/testing/selftests/rdma/Makefile | 10 ++ > tools/testing/selftests/rdma/config | 6 + > .../selftests/rdma/rdma_cm_baseline.sh | 58 ++++++++ > .../selftests/rdma/rdma_cm_counter_delta.sh | 72 ++++++++++ > .../selftests/rdma/rdma_cm_fault_injection.sh | 95 +++++++++++++ > .../selftests/rdma/rdma_cm_review_loop.sh | 35 +++++ > .../selftests/rdma/rdma_cm_trace_sequence.sh | 83 ++++++++++++ > tools/testing/selftests/rdma/rdma_common.sh | 126 ++++++++++++++++++ > 8 files changed, 485 insertions(+) > create mode 100755 tools/testing/selftests/rdma/rdma_cm_baseline.sh > create mode 100755 tools/testing/selftests/rdma/rdma_cm_counter_delta.sh > create mode 100755 tools/testing/selftests/rdma/rdma_cm_fault_injection.sh > create mode 100755 tools/testing/selftests/rdma/rdma_cm_review_loop.sh > create mode 100755 tools/testing/selftests/rdma/rdma_cm_trace_sequence.sh > create mode 100755 tools/testing/selftests/rdma/rdma_common.sh > > diff --git a/tools/testing/selftests/rdma/Makefile > b/tools/testing/selftests/rdma/Makefile > index 7dd7cba7a73c..04c52db4b9d9 100644 > --- a/tools/testing/selftests/rdma/Makefile > +++ b/tools/testing/selftests/rdma/Makefile > @@ -4,4 +4,14 @@ TEST_PROGS := rxe_rping_between_netns.sh \ > rxe_socket_with_netns.sh \ > rxe_test_NETDEV_UNREGISTER.sh > > +TEST_PROGS += \ > + rdma_cm_baseline.sh \ > + rdma_cm_trace_sequence.sh \ > + rdma_cm_counter_delta.sh \ > + rdma_cm_fault_injection.sh > + > +TEST_FILES += \ > + rdma_common.sh \ > + rdma_cm_review_loop.sh > + > include ../lib.mk > diff --git a/tools/testing/selftests/rdma/config > b/tools/testing/selftests/rdma/config > index 4ffb814e253b..e22141838c19 100644 > --- a/tools/testing/selftests/rdma/config > +++ b/tools/testing/selftests/rdma/config > @@ -1,3 +1,9 @@ > CONFIG_TUN > CONFIG_VETH > CONFIG_RDMA_RXE > +CONFIG_DEBUG_KERNEL > +CONFIG_FAULT_INJECTION > +CONFIG_SYSFS > +CONFIG_DEBUG_FS > +CONFIG_FAULT_INJECTION_DEBUG_FS > +CONFIG_FAILSLAB > diff --git a/tools/testing/selftests/rdma/rdma_cm_baseline.sh > b/tools/testing/selftests/rdma/rdma_cm_baseline.sh > new file mode 100755 > index 000000000000..b0d8b3e46470 > --- /dev/null > +++ b/tools/testing/selftests/rdma/rdma_cm_baseline.sh > @@ -0,0 +1,58 @@ > +#!/bin/bash > +# SPDX-License-Identifier: GPL-2.0 > + > +set -euo pipefail > + > +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" > +source "${SCRIPT_DIR}/rdma_common.sh" > + > +require_root > +require_cmd date > +require_cmd uname > + > +trace_dir="$(tracefs_dir || true)" > +counter_root="$(find_cm_counter_root || true)" > +out_dir="/tmp/rdma_cm_baseline.$(date +%s)" > +dmesg_lines=400 > +dmesg_pattern="ib_cm|infiniband|rdma|roce|mlx|hns_roce|irdma|siw|rxe"
Sorry that it took so long to review this. Please address Sashiko’s comments regarding 'fault injection most likely not enabled here' and 'statistics check in wrong port': https://sashiko.dev/#/patchset/[email protected] Also, 'dmesg_pattern' is not a scalable option. You should not rely on the dmesg print format. Thanks
