diff --git a/test/nvme/aer/aer.c b/test/nvme/aer/aer.c index d0ea4e4e3..66708bfd8 100644 --- a/test/nvme/aer/aer.c +++ b/test/nvme/aer/aer.c @@ -237,6 +237,7 @@ usage(const char *program_name) printf("%s [options]", program_name); printf("\n"); printf("options:\n"); + printf(" -g use single file descriptor for DPDK memory segments]\n"); printf(" -T enable temperature tests\n"); printf(" -n expected Namespace attribute notice ID\n"); printf(" -t touch specified file when ready to receive AER\n"); @@ -257,7 +258,7 @@ usage(const char *program_name) } static int -parse_args(int argc, char **argv) +parse_args(int argc, char **argv, struct spdk_env_opts *env_opts) { int op, rc; long int val; @@ -265,7 +266,7 @@ parse_args(int argc, char **argv) spdk_nvme_trid_populate_transport(&g_trid, SPDK_NVME_TRANSPORT_PCIE); snprintf(g_trid.subnqn, sizeof(g_trid.subnqn), "%s", SPDK_NVMF_DISCOVERY_NQN); - while ((op = getopt(argc, argv, "n:r:t:HL:T")) != -1) { + while ((op = getopt(argc, argv, "n:gr:t:HL:T")) != -1) { switch (op) { case 'n': val = spdk_strtol(optarg, 10); @@ -275,6 +276,9 @@ parse_args(int argc, char **argv) } g_expected_ns_test = (uint32_t)val; break; + case 'g': + env_opts->hugepage_single_segments = true; + break; case 'r': if (spdk_nvme_transport_id_parse(&g_trid, optarg) != 0) { fprintf(stderr, "Error parsing transport address\n"); @@ -476,7 +480,7 @@ int main(int argc, char **argv) int rc; struct spdk_nvme_detach_ctx *detach_ctx = NULL; - rc = parse_args(argc, argv); + rc = parse_args(argc, argv, &opts); if (rc != 0) { return rc; } diff --git a/test/nvmf/target/nvmf_vfio_user.sh b/test/nvmf/target/nvmf_vfio_user.sh index cefa84dad..a587d2ac2 100755 --- a/test/nvmf/target/nvmf_vfio_user.sh +++ b/test/nvmf/target/nvmf_vfio_user.sh @@ -14,6 +14,33 @@ rpc_py="$rootdir/scripts/rpc.py" export TEST_TRANSPORT=VFIOUSER +function aer_vfio_user() { + + local traddr=$1 + local subnqn=$2 + local malloc_num=Malloc$(($3 + NUM_DEVICES)) + $rpc_py nvmf_get_subsystems + + AER_TOUCH_FILE=/tmp/aer_touch_file + + # Namespace Attribute Notice Tests + $rootdir/test/nvme/aer/aer -r "\ + trtype:$TEST_TRANSPORT \ + traddr:$traddr \ + subnqn:$subnqn" -n $NUM_DEVICES -g -t $AER_TOUCH_FILE & + aerpid=$! + + # Waiting for aer start to work + waitforfile $AER_TOUCH_FILE + rm -f $AER_TOUCH_FILE + # Add a new namespace + $rpc_py bdev_malloc_create $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE --name $malloc_num + $rpc_py nvmf_subsystem_add_ns $subnqn $malloc_num -n $NUM_DEVICES + $rpc_py nvmf_get_subsystems + + wait $aerpid +} + rm -rf /var/run/vfio-user # Start the target @@ -58,6 +85,8 @@ for i in $(seq 1 $NUM_DEVICES); do sleep 1 $nvmeappdir/overhead/overhead -s 4096 -t 1 -H -g -d 256 -r "trtype:$TEST_TRANSPORT traddr:$test_traddr subnqn:$test_subnqn" sleep 1 + aer_vfio_user $test_traddr $test_subnqn $i + sleep 1 done killprocess $nvmfpid