mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-08-09 06:14:34 +02:00
Commit 92cc6708f4 ("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>
Link: https://patch.msgid.link/20260602050657.26389-4-achender@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
69 lines
1.6 KiB
Bash
Executable File
69 lines
1.6 KiB
Bash
Executable File
#! /bin/bash
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
set -e
|
|
set -u
|
|
set -x
|
|
|
|
unset KBUILD_OUTPUT
|
|
CONF_FILE=""
|
|
FLAGS=()
|
|
|
|
GENERATE_GCOV_REPORT=0
|
|
ENABLE_RDMA=0
|
|
while getopts "gc:r" opt; do
|
|
case ${opt} in
|
|
g)
|
|
GENERATE_GCOV_REPORT=1
|
|
;;
|
|
c)
|
|
CONF_FILE=$OPTARG
|
|
;;
|
|
r)
|
|
ENABLE_RDMA=1
|
|
;;
|
|
:)
|
|
echo "USAGE: config.sh [-g] [-c config] [-r]"
|
|
exit 1
|
|
;;
|
|
?)
|
|
echo "Invalid option: -${OPTARG}."
|
|
exit 1
|
|
;;
|
|
esac
|
|
done
|
|
|
|
if [[ "$CONF_FILE" != "" ]]; then
|
|
FLAGS=(--file "$CONF_FILE")
|
|
fi
|
|
|
|
# enable RDS
|
|
scripts/config "${FLAGS[@]}" --enable CONFIG_RDS
|
|
scripts/config "${FLAGS[@]}" --enable CONFIG_RDS_TCP
|
|
|
|
if [ "$GENERATE_GCOV_REPORT" -eq 1 ]; then
|
|
# instrument RDS and only RDS
|
|
scripts/config "${FLAGS[@]}" --enable CONFIG_GCOV_KERNEL
|
|
scripts/config "${FLAGS[@]}" --disable GCOV_PROFILE_ALL
|
|
scripts/config "${FLAGS[@]}" --enable GCOV_PROFILE_RDS
|
|
else
|
|
scripts/config "${FLAGS[@]}" --disable CONFIG_GCOV_KERNEL
|
|
scripts/config "${FLAGS[@]}" --disable GCOV_PROFILE_ALL
|
|
scripts/config "${FLAGS[@]}" --disable GCOV_PROFILE_RDS
|
|
fi
|
|
|
|
# need network namespaces to run tests with veth network interfaces
|
|
scripts/config "${FLAGS[@]}" --enable CONFIG_NET_NS
|
|
scripts/config "${FLAGS[@]}" --enable CONFIG_VETH
|
|
|
|
# simulate packet loss
|
|
scripts/config "${FLAGS[@]}" --enable CONFIG_NET_SCH_NETEM
|
|
|
|
if [ "$ENABLE_RDMA" -eq 1 ]; then
|
|
# enable RDS over InfiniBand / RDMA (rds_rdma test)
|
|
scripts/config "${FLAGS[@]}" --enable CONFIG_INFINIBAND
|
|
scripts/config "${FLAGS[@]}" --enable CONFIG_INFINIBAND_ADDR_TRANS
|
|
scripts/config "${FLAGS[@]}" --enable CONFIG_RDMA_RXE
|
|
scripts/config "${FLAGS[@]}" --enable CONFIG_RDS_RDMA
|
|
fi
|