From b64ff135c5e1e292571a9c70a460efa8f0365b4d Mon Sep 17 00:00:00 2001 From: paul luse Date: Mon, 20 May 2019 15:25:03 -0400 Subject: [PATCH] test/compress: add bdevio and bdevperf tests Will execute short run per patch, longer nightly. This path only covers the ISAL PMD as there are QAT upgrades needed in CI. It does so by using the new 'perform_tests' RPC in both bdevio and bdevperf. Change-Id: I93afda336d7411b695b2ddd0332cce0050d075a4 Signed-off-by: paul luse Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455113 Reviewed-by: Ben Walker Reviewed-by: Jim Harris Reviewed-by: Broadcom SPDK FC-NVMe CI Reviewed-by: Chunyang Hui Tested-by: SPDK CI Jenkins --- autotest.sh | 4 ++ lib/bdev/compress/vbdev_compress_rpc.c | 3 +- test/compress/compress.sh | 72 ++++++++++++++++++++++++++ 3 files changed, 78 insertions(+), 1 deletion(-) create mode 100755 test/compress/compress.sh diff --git a/autotest.sh b/autotest.sh index b53f1d464..7ce4736f6 100755 --- a/autotest.sh +++ b/autotest.sh @@ -148,6 +148,10 @@ fi if [ $SPDK_RUN_FUNCTIONAL_TEST -eq 1 ]; then timing_enter lib + if [ $SPDK_TEST_REDUCE -eq 1 ]; then + run_test suite ./test/compress/compress.sh + fi + run_test suite test/env/env.sh run_test suite test/rpc_client/rpc_client.sh run_test suite ./test/json_config/json_config.sh diff --git a/lib/bdev/compress/vbdev_compress_rpc.c b/lib/bdev/compress/vbdev_compress_rpc.c index 69c7ca25a..2381f2147 100644 --- a/lib/bdev/compress/vbdev_compress_rpc.c +++ b/lib/bdev/compress/vbdev_compress_rpc.c @@ -80,7 +80,8 @@ spdk_rpc_set_compress_pmd(struct spdk_jsonrpc_request *request, spdk_jsonrpc_end_result(request, w); } } -SPDK_RPC_REGISTER("set_compress_pmd", spdk_rpc_set_compress_pmd, SPDK_RPC_RUNTIME) +SPDK_RPC_REGISTER("set_compress_pmd", spdk_rpc_set_compress_pmd, + SPDK_RPC_STARTUP | SPDK_RPC_RUNTIME) /* Structure to hold the parameters for this RPC method. */ struct rpc_construct_compress { diff --git a/test/compress/compress.sh b/test/compress/compress.sh new file mode 100755 index 000000000..fe63bd31f --- /dev/null +++ b/test/compress/compress.sh @@ -0,0 +1,72 @@ +#!/usr/bin/env bash + +set -e + +testdir=$(readlink -f $(dirname $0)) +rootdir=$(readlink -f $testdir/../..) +plugindir=$rootdir/examples/bdev/fio_plugin +rpc_py="$rootdir/scripts/rpc.py" +source "$rootdir/scripts/common.sh" +source "$rootdir/test/common/autotest_common.sh" + +function compress_err_cleanup() { + rm -rf /tmp/pmem + $rootdir/examples/nvme/perf/perf -q 1 -o 131072 -w write -t 2 +} + +# use the bdev svc to create a compress bdev, this assumes +# there is no other metadata on the nvme device, we will put a +# compress vol on a thin provisioned lvol on nvme +mkdir -p /tmp/pmem +$rootdir/test/app/bdev_svc/bdev_svc & +bdev_svc_pid=$! +trap "killprocess $bdev_svc_pid; compress_err_cleanup; exit 1" SIGINT SIGTERM EXIT +waitforlisten $bdev_svc_pid +bdf=$(iter_pci_class_code 01 08 02 | head -1) +$rpc_py construct_nvme_bdev -b "Nvme0" -t "pcie" -a $bdf +lvs_u=$($rpc_py construct_lvol_store Nvme0n1 lvs0) +$rpc_py construct_lvol_bdev -t -u $lvs_u lv0 100 +# this will force isal_pmd as some of the CI systems need a qat driver update +$rpc_py set_compress_pmd -p 2 +compress_bdev=$($rpc_py construct_compress_bdev -b lvs0/lv0 -p /tmp) +trap - SIGINT SIGTERM EXIT +killprocess $bdev_svc_pid + +# run bdevio test +timing_enter compress_test +$rootdir/test/bdev/bdevio/bdevio -w & +bdevio_pid=$! +trap "killprocess $bdevio_pid; compress_err_cleanup; exit 1" SIGINT SIGTERM EXIT +waitforlisten $bdevio_pid +$rpc_py set_compress_pmd -p 2 +$rpc_py construct_nvme_bdev -b "Nvme0" -t "pcie" -a $bdf +waitforbdev $compress_bdev +$rootdir/test/bdev/bdevio/tests.py perform_tests +trap - SIGINT SIGTERM EXIT +killprocess $bdevio_pid + +#run bdevperf with slightly different params for nightly +qd=32 +runtime=3 +iosize=4096 +if [ $RUN_NIGHTLY -eq 1 ]; then + qd=64 + runtime=30 + iosize=16384 +fi +$rootdir/test/bdev/bdevperf/bdevperf -z -q $qd -o $iosize -w verify -t $runtime & +bdevperf_pid=$! +trap "killprocess $bdevperf_pid; compress_err_cleanup; exit 1" SIGINT SIGTERM EXIT +waitforlisten $bdevperf_pid +$rpc_py set_compress_pmd -p 2 +$rpc_py construct_nvme_bdev -b "Nvme0" -t "pcie" -a $bdf +waitforbdev $compress_bdev +$rootdir/test/bdev/bdevperf/bdevperf.py perform_tests + +# now cleanup the vols, deleting the compression vol also deletes the pmem file +$rpc_py delete_compress_bdev COMP_lvs0/lv0 +$rpc_py destroy_lvol_store -l lvs0 + +trap - SIGINT SIGTERM EXIT +killprocess $bdevperf_pid +timing_exit compress_test