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 <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/442552
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Darek Stojaczyk 2019-01-29 12:57:26 +01:00 committed by Ben Walker
parent 0c0d9d4e0a
commit 20f4a21d84
2 changed files with 2 additions and 1 deletions

View File

@ -36,7 +36,7 @@ bdf=$(echo $bdfs|awk '{ print $1 }')
cd $spdk_nvme_cli cd $spdk_nvme_cli
make clean && make -j$(nproc) LDFLAGS="$(make -s -C $spdk_nvme_cli/spdk ldflags)" 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/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 list
./nvme id-ctrl $bdf ./nvme id-ctrl $bdf
./nvme list-ctrl $bdf ./nvme list-ctrl $bdf

View File

@ -74,6 +74,7 @@ nvme disconnect -n "nqn.2016-06.io.spdk:cnode2" || true
if [ -d $spdk_nvme_cli ]; then if [ -d $spdk_nvme_cli ]; then
# Test spdk/nvme-cli NVMe-oF commands: discover, connect and disconnect # Test spdk/nvme-cli NVMe-oF commands: discover, connect and disconnect
cd $spdk_nvme_cli 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 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_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" ./nvme connect -t rdma -n "nqn.2016-06.io.spdk:cnode1" -a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT"