From 6df2fa8c2e4df78ea82dbd7e4f626e0f3522d9a6 Mon Sep 17 00:00:00 2001 From: Karol Latecki Date: Thu, 8 Aug 2019 17:29:49 +0200 Subject: [PATCH] test/vhost_perf: refactor test scripts to use disk map Use provided configuration file via --disk-map option instead of creating bdevs and VMs in ordered sequence (e.g. 0 to 10, etc.). This allows to: - specify which NVMe device we want to use (PCI BDF identifier) - how to name it in SPDK nvme bdev configuration - how many splits or lvol bdevs to create on this device - which VMs should use created bdevs With CPU mask configuration file this allows to better control resources when running the test (especially in case of NUMA optimization where using sequential for/while loops is not a good approach). vm_count and max_disks parameters removed. These are not needed anymore as they're controlled by config file. Example of config file contents: (BDF,Spdk NvmeBdev name,Split count,VM list) 0000:1b:00.0,Nvme1,2,2 3 0000:89:00.0,Nvme3,4,4 5 6 7 Change-Id: I9fc73458825d8072537aa04880765a048e034ce4 Signed-off-by: Karol Latecki Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464565 Reviewed-by: Shuhei Matsumoto Reviewed-by: Jim Harris Tested-by: SPDK CI Jenkins --- test/vhost/perf_bench/vhost_perf.sh | 279 ++++++++++++++++------------ 1 file changed, 161 insertions(+), 118 deletions(-) diff --git a/test/vhost/perf_bench/vhost_perf.sh b/test/vhost/perf_bench/vhost_perf.sh index 5305aeef6..e69e0bf89 100755 --- a/test/vhost/perf_bench/vhost_perf.sh +++ b/test/vhost/perf_bench/vhost_perf.sh @@ -5,7 +5,7 @@ rootdir=$(readlink -f $testdir/../../..) source $rootdir/test/common/autotest_common.sh source $rootdir/test/vhost/common.sh -vm_count=1 +vhost_num="0" vm_memory=2048 vm_sar_enable=false host_sar_enable=false @@ -13,19 +13,26 @@ sar_delay="0" sar_interval="1" sar_count="10" vm_throttle="" -max_disks="" ctrl_type="spdk_vhost_scsi" use_split=false kernel_cpus="" run_precondition=false lvol_stores=() lvol_bdevs=() +split_bdevs=() used_vms="" wwpn_prefix="naa.5001405bc6498" fio_bin="--fio-bin=/home/sys_sgsw/fio_ubuntu" fio_iterations=1 precond_fio_bin="/usr/src/fio/fio" +disk_map="" + +disk_cfg_bdfs=() +disk_cfg_spdk_names=() +disk_cfg_splits=() +disk_cfg_vms=() +disk_cfg_kernel_names=() function usage() { @@ -39,10 +46,6 @@ function usage() echo " of binary is recommended." echo " --fio-job=PATH Fio config to use for test." echo " --fio-iterations=INT Number of times to run specified workload." - echo " --vm-count=INT Total number of virtual machines to launch in this test;" - echo " Each VM will get one bdev (lvol or split vbdev)" - echo " to run FIO test." - echo " Default: 1" echo " --vm-memory=INT Amount of RAM memory (in MB) to pass to a single VM." echo " Default: 2048 MB" echo " --vm-image=PATH OS image to use for running the VMs." @@ -53,8 +56,6 @@ function usage() echo " --sar-interval=INT Interval (seconds) argument for SAR. Default: 1s." echo " --sar-count=INT Count argument for SAR. Default: 10." echo " --vm-throttle-iops=INT I/Os throttle rate in IOPS for each device on the VMs." - echo " --max-disks=INT Maximum number of NVMe drives to use in test." - echo " Default: will use all available NVMes." echo " --ctrl-type=TYPE Controller type to use for test:" echo " spdk_vhost_scsi - use spdk vhost scsi" echo " spdk_vhost_blk - use spdk vhost block" @@ -66,6 +67,12 @@ function usage() echo " --precond-fio-bin FIO binary used for SPDK fio plugin precondition. Default: /usr/src/fio/fio." echo " --custom-cpu-cfg=PATH Custom CPU config for test." echo " Default: spdk/test/vhost/common/autotest.config" + echo " --disk-map Disk map for given test. Specify which disks to use, their SPDK name," + echo " how many times to split them and which VMs should be attached to created bdevs." + echo " Example:" + echo " NVME PCI BDF,Spdk Bdev Name,Split Count,VM List" + echo " 0000:1a:00.0,Nvme0,2,0 1" + echo " 0000:1b:00.0,Nvme1,2,2 3" echo "-x set -x for script debug" exit 0 } @@ -88,17 +95,16 @@ function cleanup_lvol_cfg() function cleanup_split_cfg() { notice "Removing split vbdevs" - for (( i=0; i