From cefe9145e4deeb66f05376ca4df1323a1846f0c5 Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Wed, 5 Jun 2019 12:44:29 -0700 Subject: [PATCH] test/vhost: Let users pass command line arguments to vhost_run Change-Id: Ia5df6e74048ae9b4690fcfd9debf17718777c6ea Signed-off-by: Ben Walker Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461388 Tested-by: SPDK CI Jenkins Reviewed-by: Darek Stojaczyk Reviewed-by: Jim Harris --- test/vhost/common.sh | 26 +------------------------- test/vhost/migration/migration-tc2.sh | 11 ++++------- test/vhost/migration/migration-tc3a.sh | 2 +- test/vhost/migration/migration-tc3b.sh | 2 +- 4 files changed, 7 insertions(+), 34 deletions(-) diff --git a/test/vhost/common.sh b/test/vhost/common.sh index 5e4e9335c..e5d605066 100644 --- a/test/vhost/common.sh +++ b/test/vhost/common.sh @@ -120,24 +120,11 @@ function vhost_list_all() function vhost_run() { - local param local vhost_num="$1" - local memory=1024 assert_number "$vhost_num" shift - for param in "$@"; do - case $param in - --memory=*) local memory=${param#*=} ;; - --no-pci*) local no_pci="-u" ;; - *) - error "Invalid parameter '$param'" - return 1 - ;; - esac - done - local vhost_dir="$(get_vhost_dir $vhost_num)" local vhost_app="$rootdir/app/vhost/vhost" local vhost_log_file="$vhost_dir/vhost.log" @@ -153,18 +140,7 @@ function vhost_run() return 1 fi - local reactor_mask="vhost_${vhost_num}_reactor_mask" - reactor_mask="${!reactor_mask}" - - local master_core="vhost_${vhost_num}_master_core" - master_core="${!master_core}" - - if [[ -z "$reactor_mask" ]] || [[ -z "$master_core" ]]; then - error "Parameters vhost_${vhost_num}_reactor_mask or vhost_${vhost_num}_master_core not found in autotest.config file" - return 1 - fi - - local cmd="$vhost_app -m $reactor_mask -p $master_core -s $memory -r $vhost_dir/rpc.sock $no_pci" + local cmd="$vhost_app -r $vhost_dir/rpc.sock $2" notice "Loging to: $vhost_log_file" notice "Socket: $vhost_socket" diff --git a/test/vhost/migration/migration-tc2.sh b/test/vhost/migration/migration-tc2.sh index cec1d9871..18a9da8b5 100644 --- a/test/vhost/migration/migration-tc2.sh +++ b/test/vhost/migration/migration-tc2.sh @@ -86,8 +86,8 @@ function migration_tc2_configure_vhost() # Run nvmf_tgt and two vhost instances: # nvmf_tgt uses core id 2 (-m 0x4) - # First uses core id 0 (vhost_0_reactor_mask=0x1) - # Second uses core id 1 (vhost_1_reactor_mask=0x2) + # First uses core id 0 + # Second uses core id 1 # This force to use VM 1 and 2. timing_enter start_nvmf_tgt notice "Running nvmf_tgt..." @@ -102,11 +102,8 @@ function migration_tc2_configure_vhost() $rootdir/scripts/gen_nvme.sh --json | $rpc_nvmf load_subsystem_config timing_exit start_nvmf_tgt - vhost_run 0 --memory=512 --no-pci - # Those are global intentionally - vhost_1_reactor_mask=0x2 - vhost_1_master_core=1 - vhost_run 1 --memory=512 --no-pci + vhost_run 0 "-m 0x1 -s 512 -u" + vhost_run 1 "-m 0x2 -s 512 -u" local rdma_ip_list=$(get_available_rdma_ips) local nvmf_target_ip=$(echo "$rdma_ip_list" | head -n 1) diff --git a/test/vhost/migration/migration-tc3a.sh b/test/vhost/migration/migration-tc3a.sh index fcc1d4441..261e69be1 100644 --- a/test/vhost/migration/migration-tc3a.sh +++ b/test/vhost/migration/migration-tc3a.sh @@ -122,7 +122,7 @@ function host1_start_vhost() notice "Starting vhost0 instance on local server" trap 'host1_cleanup_vhost; error_exit "${FUNCNAME}" "${LINENO}"' INT ERR EXIT - vhost_run 0 --no-pci + vhost_run 0 "-u" $rpc_0 construct_nvme_bdev -b Nvme0 -t rdma -f ipv4 -a $RDMA_TARGET_IP -s 4420 -n "nqn.2018-02.io.spdk:cnode1" $rpc_0 construct_vhost_scsi_controller $incoming_vm_ctrlr $rpc_0 add_vhost_scsi_lun $incoming_vm_ctrlr 0 Nvme0n1 diff --git a/test/vhost/migration/migration-tc3b.sh b/test/vhost/migration/migration-tc3b.sh index 26a76f066..a94a6af77 100644 --- a/test/vhost/migration/migration-tc3b.sh +++ b/test/vhost/migration/migration-tc3b.sh @@ -33,7 +33,7 @@ function host_2_start_vhost() notice "Starting vhost 1 instance on remote server" trap 'host_2_cleanup_vhost; error_exit "${FUNCNAME}" "${LINENO}"' INT ERR EXIT - vhost_run --vhost-num=1 --no-pci + vhost_run 1 "-u" $rpc construct_nvme_bdev -b Nvme0 -t rdma -f ipv4 -a $RDMA_TARGET_IP -s 4420 -n "nqn.2018-02.io.spdk:cnode1" $rpc construct_vhost_scsi_controller $target_vm_ctrl