test/vhost: Require vhost num as first arg to vhost_run
Making this explicit makes the tests clearer Change-Id: I6c37f873683b38b644bebc42532694d45a181d04 Signed-off-by: Ben Walker <benjamin.walker@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461387 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Maciej Szwed <maciej.szwed@intel.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
80494b8ec5
commit
10a0f053c9
@ -121,15 +121,14 @@ function vhost_list_all()
|
|||||||
function vhost_run()
|
function vhost_run()
|
||||||
{
|
{
|
||||||
local param
|
local param
|
||||||
local vhost_num=0
|
local vhost_num="$1"
|
||||||
local memory=1024
|
local memory=1024
|
||||||
|
|
||||||
|
assert_number "$vhost_num"
|
||||||
|
shift
|
||||||
|
|
||||||
for param in "$@"; do
|
for param in "$@"; do
|
||||||
case $param in
|
case $param in
|
||||||
--vhost-num=*)
|
|
||||||
vhost_num="${param#*=}"
|
|
||||||
assert_number "$vhost_num"
|
|
||||||
;;
|
|
||||||
--memory=*) local memory=${param#*=} ;;
|
--memory=*) local memory=${param#*=} ;;
|
||||||
--no-pci*) local no_pci="-u" ;;
|
--no-pci*) local no_pci="-u" ;;
|
||||||
*)
|
*)
|
||||||
|
@ -81,7 +81,7 @@ if [[ $test_type =~ "spdk_vhost" ]]; then
|
|||||||
notice ""
|
notice ""
|
||||||
notice "running SPDK"
|
notice "running SPDK"
|
||||||
notice ""
|
notice ""
|
||||||
vhost_run
|
vhost_run 0
|
||||||
vhost_json_config 0 $testdir/conf.json
|
vhost_json_config 0 $testdir/conf.json
|
||||||
notice ""
|
notice ""
|
||||||
fi
|
fi
|
||||||
|
@ -61,7 +61,7 @@ notice "==============="
|
|||||||
notice ""
|
notice ""
|
||||||
notice "running SPDK"
|
notice "running SPDK"
|
||||||
notice ""
|
notice ""
|
||||||
vhost_run
|
vhost_run 0
|
||||||
$rpc_py set_bdev_nvme_hotplug -e
|
$rpc_py set_bdev_nvme_hotplug -e
|
||||||
$rpc_py construct_split_vbdev Nvme0n1 16
|
$rpc_py construct_split_vbdev Nvme0n1 16
|
||||||
$rpc_py construct_malloc_bdev 128 512 -b Malloc
|
$rpc_py construct_malloc_bdev 128 512 -b Malloc
|
||||||
|
@ -88,7 +88,7 @@ function create_bdev_config()
|
|||||||
}
|
}
|
||||||
|
|
||||||
timing_enter vhost_run
|
timing_enter vhost_run
|
||||||
vhost_run
|
vhost_run 0
|
||||||
timing_exit vhost_run
|
timing_exit vhost_run
|
||||||
|
|
||||||
timing_enter create_bdev_config
|
timing_enter create_bdev_config
|
||||||
|
@ -60,7 +60,7 @@ trap 'error_exit "${FUNCNAME}" "${LINENO}"' SIGTERM SIGABRT ERR
|
|||||||
vm_kill_all
|
vm_kill_all
|
||||||
|
|
||||||
notice "Starting SPDK vhost"
|
notice "Starting SPDK vhost"
|
||||||
vhost_run
|
vhost_run 0
|
||||||
notice "..."
|
notice "..."
|
||||||
|
|
||||||
# Set up lvols and vhost controllers
|
# Set up lvols and vhost controllers
|
||||||
|
@ -120,7 +120,7 @@ trap 'error_exit "${FUNCNAME}" "${LINENO}"' SIGTERM SIGABRT ERR
|
|||||||
vm_kill_all
|
vm_kill_all
|
||||||
|
|
||||||
notice "running SPDK vhost"
|
notice "running SPDK vhost"
|
||||||
vhost_run
|
vhost_run 0
|
||||||
notice "..."
|
notice "..."
|
||||||
|
|
||||||
trap 'clean_lvol_cfg; error_exit "${FUNCNAME}" "${LINENO}"' SIGTERM SIGABRT ERR
|
trap 'clean_lvol_cfg; error_exit "${FUNCNAME}" "${LINENO}"' SIGTERM SIGABRT ERR
|
||||||
|
@ -57,7 +57,7 @@ function migration_tc1()
|
|||||||
local job_file="$testdir/migration-tc1.job"
|
local job_file="$testdir/migration-tc1.job"
|
||||||
|
|
||||||
# Run vhost
|
# Run vhost
|
||||||
vhost_run
|
vhost_run 0
|
||||||
migration_tc1_configure_vhost
|
migration_tc1_configure_vhost
|
||||||
|
|
||||||
notice "Setting up VMs"
|
notice "Setting up VMs"
|
||||||
|
@ -102,11 +102,11 @@ function migration_tc2_configure_vhost()
|
|||||||
$rootdir/scripts/gen_nvme.sh --json | $rpc_nvmf load_subsystem_config
|
$rootdir/scripts/gen_nvme.sh --json | $rpc_nvmf load_subsystem_config
|
||||||
timing_exit start_nvmf_tgt
|
timing_exit start_nvmf_tgt
|
||||||
|
|
||||||
vhost_run --memory=512 --vhost-num=0 --no-pci
|
vhost_run 0 --memory=512 --no-pci
|
||||||
# Those are global intentionally
|
# Those are global intentionally
|
||||||
vhost_1_reactor_mask=0x2
|
vhost_1_reactor_mask=0x2
|
||||||
vhost_1_master_core=1
|
vhost_1_master_core=1
|
||||||
vhost_run --memory=512 --vhost-num=1 --no-pci
|
vhost_run 1 --memory=512 --no-pci
|
||||||
|
|
||||||
local rdma_ip_list=$(get_available_rdma_ips)
|
local rdma_ip_list=$(get_available_rdma_ips)
|
||||||
local nvmf_target_ip=$(echo "$rdma_ip_list" | head -n 1)
|
local nvmf_target_ip=$(echo "$rdma_ip_list" | head -n 1)
|
||||||
|
@ -122,7 +122,7 @@ function host1_start_vhost()
|
|||||||
|
|
||||||
notice "Starting vhost0 instance on local server"
|
notice "Starting vhost0 instance on local server"
|
||||||
trap 'host1_cleanup_vhost; error_exit "${FUNCNAME}" "${LINENO}"' INT ERR EXIT
|
trap 'host1_cleanup_vhost; error_exit "${FUNCNAME}" "${LINENO}"' INT ERR EXIT
|
||||||
vhost_run --vhost-num=0 --no-pci
|
vhost_run 0 --no-pci
|
||||||
$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_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 construct_vhost_scsi_controller $incoming_vm_ctrlr
|
||||||
$rpc_0 add_vhost_scsi_lun $incoming_vm_ctrlr 0 Nvme0n1
|
$rpc_0 add_vhost_scsi_lun $incoming_vm_ctrlr 0 Nvme0n1
|
||||||
|
@ -69,7 +69,7 @@ if [[ $RUN_NIGHTLY -eq 1 ]]; then
|
|||||||
notice ""
|
notice ""
|
||||||
notice "running SPDK"
|
notice "running SPDK"
|
||||||
notice ""
|
notice ""
|
||||||
vhost_run
|
vhost_run 0
|
||||||
vhost_json_config 0 $testdir/conf.json
|
vhost_json_config 0 $testdir/conf.json
|
||||||
notice ""
|
notice ""
|
||||||
|
|
||||||
|
@ -245,7 +245,7 @@ if [[ "$ctrl_type" == "kernel_vhost" ]]; then
|
|||||||
else
|
else
|
||||||
# Run vhost process and prepare split vbdevs or lvol bdevs
|
# Run vhost process and prepare split vbdevs or lvol bdevs
|
||||||
notice "running SPDK vhost"
|
notice "running SPDK vhost"
|
||||||
vhost_run
|
vhost_run 0
|
||||||
notice "..."
|
notice "..."
|
||||||
|
|
||||||
if [[ $use_split == true ]]; then
|
if [[ $use_split == true ]]; then
|
||||||
|
@ -121,7 +121,7 @@ function blk_ro_tc1()
|
|||||||
vm_shutdown_all
|
vm_shutdown_all
|
||||||
}
|
}
|
||||||
|
|
||||||
vhost_run
|
vhost_run 0
|
||||||
if [[ -z $x ]]; then
|
if [[ -z $x ]]; then
|
||||||
set +x
|
set +x
|
||||||
fi
|
fi
|
||||||
|
@ -17,7 +17,7 @@ vhosttestinit
|
|||||||
|
|
||||||
trap 'error_exit "${FUNCNAME}" "${LINENO}"' ERR SIGTERM SIGABRT
|
trap 'error_exit "${FUNCNAME}" "${LINENO}"' ERR SIGTERM SIGABRT
|
||||||
|
|
||||||
vhost_run
|
vhost_run 0
|
||||||
|
|
||||||
$rpc_py construct_malloc_bdev -b Malloc 124 4096
|
$rpc_py construct_malloc_bdev -b Malloc 124 4096
|
||||||
$rpc_py construct_vhost_blk_controller Malloc.0 Malloc
|
$rpc_py construct_vhost_blk_controller Malloc.0 Malloc
|
||||||
|
@ -61,7 +61,7 @@ vhosttestinit
|
|||||||
timing_enter vhost_boot
|
timing_enter vhost_boot
|
||||||
trap 'err_clean "${FUNCNAME}" "${LINENO}"' ERR
|
trap 'err_clean "${FUNCNAME}" "${LINENO}"' ERR
|
||||||
timing_enter start_vhost
|
timing_enter start_vhost
|
||||||
vhost_run
|
vhost_run 0
|
||||||
timing_exit start_vhost
|
timing_exit start_vhost
|
||||||
|
|
||||||
timing_enter create_lvol
|
timing_enter create_lvol
|
||||||
|
@ -84,7 +84,7 @@ vm_kill_all
|
|||||||
# Violating this rule doesn't cause any issues for SPDK vhost,
|
# Violating this rule doesn't cause any issues for SPDK vhost,
|
||||||
# but triggers an assert, so we can only run Windows VMs with non-debug SPDK builds.
|
# but triggers an assert, so we can only run Windows VMs with non-debug SPDK builds.
|
||||||
notice "running SPDK vhost"
|
notice "running SPDK vhost"
|
||||||
vhost_run
|
vhost_run 0
|
||||||
notice "..."
|
notice "..."
|
||||||
|
|
||||||
# Prepare bdevs for later vhost controllers use
|
# Prepare bdevs for later vhost controllers use
|
||||||
|
@ -49,7 +49,7 @@ mkdir -p $testdir/results
|
|||||||
dd if=/dev/zero of=$aio_file bs=1M count=512
|
dd if=/dev/zero of=$aio_file bs=1M count=512
|
||||||
|
|
||||||
timing_enter vhost_run
|
timing_enter vhost_run
|
||||||
vhost_run
|
vhost_run 0
|
||||||
$rpc_py set_bdev_nvme_hotplug -e
|
$rpc_py set_bdev_nvme_hotplug -e
|
||||||
$rpc_py construct_malloc_bdev 256 4096 -b Malloc0
|
$rpc_py construct_malloc_bdev 256 4096 -b Malloc0
|
||||||
$rpc_py construct_aio_bdev $aio_file Aio0 512
|
$rpc_py construct_aio_bdev $aio_file Aio0 512
|
||||||
|
Loading…
Reference in New Issue
Block a user