From 2ab0506ef7352b86299bc93ee0c56d2134b58220 Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Mon, 29 Jun 2020 10:55:46 -0700 Subject: [PATCH] test/nvmf: Don't load kernel modules for custom transports For custom transports, skip the kernel module loading and unloading steps. Signed-off-by: Ben Walker Change-Id: I193c62ffa0a9a5060b4bc504b39db3b6f660e1a3 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3584 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Reviewed-by: Aleksey Marchuk Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto --- test/nvmf/common.sh | 49 +++++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/test/nvmf/common.sh b/test/nvmf/common.sh index ca9abfa25..29499418e 100644 --- a/test/nvmf/common.sh +++ b/test/nvmf/common.sh @@ -194,23 +194,26 @@ function get_ip_address() { function nvmfcleanup() { sync - set +e - for i in {1..20}; do - modprobe -v -r nvme-$TEST_TRANSPORT - if modprobe -v -r nvme-fabrics; then - set -e - return 0 - fi - sleep 1 - done - set -e - # So far unable to remove the kernel modules. Try - # one more time and let it fail. - # Allow the transport module to fail for now. See Jim's comment - # about the nvme-tcp module below. - modprobe -v -r nvme-$TEST_TRANSPORT || true - modprobe -v -r nvme-fabrics + if [ "$TEST_TRANSPORT" == "tcp" ] || [ "$TEST_TRANSPORT" == "rdma" ]; then + set +e + for i in {1..20}; do + modprobe -v -r nvme-$TEST_TRANSPORT + if modprobe -v -r nvme-fabrics; then + set -e + return 0 + fi + sleep 1 + done + set -e + + # So far unable to remove the kernel modules. Try + # one more time and let it fail. + # Allow the transport module to fail for now. See Jim's comment + # about the nvme-tcp module below. + modprobe -v -r nvme-$TEST_TRANSPORT || true + modprobe -v -r nvme-fabrics + fi } function nvmf_veth_init() { @@ -329,12 +332,14 @@ function nvmftestinit() { NVMF_TRANSPORT_OPTS="$NVMF_TRANSPORT_OPTS -o" fi - # currently we run the host/perf test for TCP even on systems without kernel nvme-tcp - # support; that's fine since the host/perf test uses the SPDK initiator - # maybe later we will enforce modprobe to succeed once we have systems in the test pool - # with nvme-tcp kernel support - but until then let this pass so we can still run the - # host/perf test with the tcp transport - modprobe nvme-$TEST_TRANSPORT || true + if [ "$TEST_TRANSPORT" == "tcp" ] || [ "$TEST_TRANSPORT" == "rdma" ]; then + # currently we run the host/perf test for TCP even on systems without kernel nvme-tcp + # support; that's fine since the host/perf test uses the SPDK initiator + # maybe later we will enforce modprobe to succeed once we have systems in the test pool + # with nvme-tcp kernel support - but until then let this pass so we can still run the + # host/perf test with the tcp transport + modprobe nvme-$TEST_TRANSPORT || true + fi } function nvmfappstart() {