From 20f4a21d84053e147758a944f3da9d068233dfc0 Mon Sep 17 00:00:00 2001 From: Darek Stojaczyk Date: Tue, 29 Jan 2019 12:57:26 +0100 Subject: [PATCH] test/nvmf/nvme-cli: don't run nvme-cli as secondary process nvme-cli in NVMf tests currently fails to initialize the NVMe driver and exits straight away [1]. It expects the primary process to initialize the driver first, but since the primary process doesn't operate on any NVMe devices, it doesn't initialize the driver at all. Fix this by running nvme-cli without multi-process mode. In NVMf tests, nvme-cli is only used to discover, connect and disconnect from an SPDK NVMf target. It does not need to access any shared memory resources. This wasn't an issue before, because we used an outdated DPDK version for nvme-cli which didn't detect any other shared memory processes of SPDK. [1] nvme.c: 337:nvme_driver_init: *ERROR*: primary process is not started yet Change-Id: Id56f94c6655049e87ab9d93ee38853faf40a11e5 Signed-off-by: Darek Stojaczyk Reviewed-on: https://review.gerrithub.io/c/442552 Chandler-Test-Pool: SPDK Automated Test System Tested-by: SPDK CI Jenkins Reviewed-by: Seth Howell Reviewed-by: Jim Harris Reviewed-by: Ben Walker --- test/nvme/spdk_nvme_cli.sh | 2 +- test/nvmf/nvme_cli/nvme_cli.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/test/nvme/spdk_nvme_cli.sh b/test/nvme/spdk_nvme_cli.sh index 0051df1d1..bf53cc6eb 100755 --- a/test/nvme/spdk_nvme_cli.sh +++ b/test/nvme/spdk_nvme_cli.sh @@ -36,7 +36,7 @@ bdf=$(echo $bdfs|awk '{ print $1 }') cd $spdk_nvme_cli make clean && make -j$(nproc) LDFLAGS="$(make -s -C $spdk_nvme_cli/spdk ldflags)" sed -i 's/spdk=0/spdk=1/g' spdk.conf -sed -i 's/shm_id=1/shm_id=0/g' spdk.conf +sed -i 's/shm_id=.*/shm_id=0/g' spdk.conf ./nvme list ./nvme id-ctrl $bdf ./nvme list-ctrl $bdf diff --git a/test/nvmf/nvme_cli/nvme_cli.sh b/test/nvmf/nvme_cli/nvme_cli.sh index c8b40794e..6039b97a5 100755 --- a/test/nvmf/nvme_cli/nvme_cli.sh +++ b/test/nvmf/nvme_cli/nvme_cli.sh @@ -74,6 +74,7 @@ nvme disconnect -n "nqn.2016-06.io.spdk:cnode2" || true if [ -d $spdk_nvme_cli ]; then # Test spdk/nvme-cli NVMe-oF commands: discover, connect and disconnect cd $spdk_nvme_cli + sed -i 's/shm_id=.*/shm_id=-1/g' spdk.conf ./nvme discover -t rdma -a $NVMF_FIRST_TARGET_IP -s "$NVMF_PORT" nvme_num_before_connection=$(nvme list |grep "/dev/nvme*"|awk '{print $1}'|wc -l) ./nvme connect -t rdma -n "nqn.2016-06.io.spdk:cnode1" -a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT"