From f0ab59a3252a6b2d2bd694ef5b1caeec8415bf55 Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Wed, 17 Aug 2016 15:42:21 -0700 Subject: [PATCH] nvmf: Include the JSON RPC server This allows live configuration of the target, much like the iSCSI target. More function calls will be added over time. Also, make the tests wait until the target is listening on the RPC port to determine that the target is ready. Change-Id: I8f762e49511d482ef820f6b25a7d3ad9a8bb41f9 Signed-off-by: Ben Walker --- app/nvmf_tgt/Makefile | 2 ++ test/nvmf/common.sh | 1 + test/nvmf/discovery/discovery.sh | 2 +- test/nvmf/filesystem/filesystem.sh | 2 +- test/nvmf/fio/fio.sh | 2 +- test/nvmf/nvme_cli/nvme_cli.sh | 2 +- test/nvmf/nvmf.conf | 3 +++ 7 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/nvmf_tgt/Makefile b/app/nvmf_tgt/Makefile index a47d7f2fb..d4fe20d7b 100644 --- a/app/nvmf_tgt/Makefile +++ b/app/nvmf_tgt/Makefile @@ -59,6 +59,8 @@ SPDK_LIBS = \ $(SPDK_ROOT_DIR)/lib/rpc/libspdk_rpc.a \ $(SPDK_ROOT_DIR)/lib/jsonrpc/libspdk_jsonrpc.a \ $(SPDK_ROOT_DIR)/lib/json/libspdk_json.a \ + $(SPDK_ROOT_DIR)/lib/event/rpc/libspdk_app_rpc.a \ + $(SPDK_ROOT_DIR)/lib/log/rpc/libspdk_log_rpc.a \ LIBS += $(BLOCKDEV_MODULES_LINKER_ARGS) \ $(COPY_MODULES_LINKER_ARGS) diff --git a/test/nvmf/common.sh b/test/nvmf/common.sh index 031541363..ba781ba3f 100755 --- a/test/nvmf/common.sh +++ b/test/nvmf/common.sh @@ -4,6 +4,7 @@ NVMF_PORT=4420 NVMF_IP_PREFIX="192.168.100" NVMF_IP_LEAST_ADDR=8 NVMF_FIRST_TARGET_IP=$NVMF_IP_PREFIX.$NVMF_IP_LEAST_ADDR +RPC_PORT=5260 function load_ib_rdma_modules() { diff --git a/test/nvmf/discovery/discovery.sh b/test/nvmf/discovery/discovery.sh index b078e852a..3dce3cfec 100755 --- a/test/nvmf/discovery/discovery.sh +++ b/test/nvmf/discovery/discovery.sh @@ -25,7 +25,7 @@ nvmfpid=$! trap "killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT -sleep 10 +waitforlisten $nvmfpid ${RPC_PORT} modprobe -v nvme-rdma diff --git a/test/nvmf/filesystem/filesystem.sh b/test/nvmf/filesystem/filesystem.sh index 1bac9b27f..1310c2756 100755 --- a/test/nvmf/filesystem/filesystem.sh +++ b/test/nvmf/filesystem/filesystem.sh @@ -20,7 +20,7 @@ nvmfpid=$! trap "killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT -sleep 5 +waitforlisten $nvmfpid ${RPC_PORT} modprobe -v nvme-rdma diff --git a/test/nvmf/fio/fio.sh b/test/nvmf/fio/fio.sh index 7a0780eca..8606c5d81 100755 --- a/test/nvmf/fio/fio.sh +++ b/test/nvmf/fio/fio.sh @@ -20,7 +20,7 @@ nvmfpid=$! trap "killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT -sleep 10 +waitforlisten $nvmfpid ${RPC_PORT} modprobe -v nvme-rdma diff --git a/test/nvmf/nvme_cli/nvme_cli.sh b/test/nvmf/nvme_cli/nvme_cli.sh index f5e8fde01..1ec8ce9fc 100755 --- a/test/nvmf/nvme_cli/nvme_cli.sh +++ b/test/nvmf/nvme_cli/nvme_cli.sh @@ -19,7 +19,7 @@ nvmfpid=$! trap "killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT -sleep 5 +waitforlisten $nvmfpid ${RPC_PORT} modprobe -v nvme-rdma diff --git a/test/nvmf/nvmf.conf b/test/nvmf/nvmf.conf index 7cbde3a15..2f4f6d445 100644 --- a/test/nvmf/nvmf.conf +++ b/test/nvmf/nvmf.conf @@ -2,6 +2,9 @@ Comment "Global section" LogFacility "local7" +[Rpc] + Enable Yes + [Nvmf] MaxQueuesPerSession 4