2018-06-22 07:38:39 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2019-05-10 17:54:24 +00:00
|
|
|
testdir=$(readlink -f $(dirname $0))
|
|
|
|
rootdir=$(readlink -f $testdir/../../..)
|
|
|
|
source $rootdir/test/common/autotest_common.sh
|
|
|
|
source $rootdir/test/vhost/common.sh
|
|
|
|
|
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 <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464565
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-08 15:29:49 +00:00
|
|
|
vhost_num="0"
|
2018-06-22 07:38:39 +00:00
|
|
|
vm_memory=2048
|
2018-11-21 15:48:18 +00:00
|
|
|
vm_sar_enable=false
|
2019-08-07 11:49:45 +00:00
|
|
|
host_sar_enable=false
|
|
|
|
sar_delay="0"
|
|
|
|
sar_interval="1"
|
|
|
|
sar_count="10"
|
2018-11-21 15:48:18 +00:00
|
|
|
vm_throttle=""
|
2021-07-06 08:50:26 +00:00
|
|
|
bpf_traces=()
|
2018-06-22 07:38:39 +00:00
|
|
|
ctrl_type="spdk_vhost_scsi"
|
|
|
|
use_split=false
|
2018-11-21 15:48:18 +00:00
|
|
|
kernel_cpus=""
|
2019-03-25 09:52:38 +00:00
|
|
|
run_precondition=false
|
2018-06-22 07:38:39 +00:00
|
|
|
lvol_stores=()
|
|
|
|
lvol_bdevs=()
|
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 <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464565
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-08 15:29:49 +00:00
|
|
|
split_bdevs=()
|
2018-06-22 07:38:39 +00:00
|
|
|
used_vms=""
|
2018-11-21 15:48:18 +00:00
|
|
|
wwpn_prefix="naa.5001405bc6498"
|
2020-06-01 11:05:32 +00:00
|
|
|
packed_ring=false
|
2018-06-22 07:38:39 +00:00
|
|
|
|
2019-04-11 15:36:40 +00:00
|
|
|
fio_iterations=1
|
2020-07-23 13:01:58 +00:00
|
|
|
fio_gtod=""
|
2020-03-02 19:55:44 +00:00
|
|
|
precond_fio_bin=$CONFIG_FIO_SOURCE_DIR/fio
|
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 <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464565
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-08 15:29:49 +00:00
|
|
|
disk_map=""
|
|
|
|
|
|
|
|
disk_cfg_bdfs=()
|
|
|
|
disk_cfg_spdk_names=()
|
|
|
|
disk_cfg_splits=()
|
|
|
|
disk_cfg_vms=()
|
|
|
|
disk_cfg_kernel_names=()
|
2018-06-22 07:38:39 +00:00
|
|
|
|
2020-05-07 11:27:06 +00:00
|
|
|
function usage() {
|
|
|
|
[[ -n $2 ]] && (
|
|
|
|
echo "$2"
|
|
|
|
echo ""
|
|
|
|
)
|
2018-06-22 07:38:39 +00:00
|
|
|
echo "Shortcut script for doing automated test"
|
|
|
|
echo "Usage: $(basename $1) [OPTIONS]"
|
|
|
|
echo
|
|
|
|
echo "-h, --help Print help and exit"
|
|
|
|
echo " --fio-bin=PATH Path to FIO binary on host.;"
|
|
|
|
echo " Binary will be copied to VM, static compilation"
|
|
|
|
echo " of binary is recommended."
|
2020-04-16 09:10:37 +00:00
|
|
|
echo " --fio-jobs=PATH Comma separated list of fio config files to use for test."
|
2019-04-11 15:36:40 +00:00
|
|
|
echo " --fio-iterations=INT Number of times to run specified workload."
|
2020-07-23 13:01:58 +00:00
|
|
|
echo " --fio-gtod-reduce Enable fio gtod_reduce option in test."
|
2018-06-22 07:38:39 +00:00
|
|
|
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."
|
2021-03-18 14:13:10 +00:00
|
|
|
echo " Default: \$DEPENDENCY_DIR/spdk_test_image.qcow2"
|
2019-08-07 11:49:45 +00:00
|
|
|
echo " --vm-sar-enable Measure CPU utilization in guest VMs using sar."
|
|
|
|
echo " --host-sar-enable Measure CPU utilization on host using sar."
|
|
|
|
echo " --sar-delay=INT Wait for X seconds before starting SAR measurement. Default: 0."
|
|
|
|
echo " --sar-interval=INT Interval (seconds) argument for SAR. Default: 1s."
|
|
|
|
echo " --sar-count=INT Count argument for SAR. Default: 10."
|
2021-07-06 08:50:26 +00:00
|
|
|
echo " --bpf-traces=LIST Comma delimited list of .bt scripts for enabling BPF traces."
|
|
|
|
echo " List of .bt scripts available in scripts/bpf"
|
2018-11-21 15:48:18 +00:00
|
|
|
echo " --vm-throttle-iops=INT I/Os throttle rate in IOPS for each device on the VMs."
|
2018-06-22 07:38:39 +00:00
|
|
|
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"
|
2018-11-21 15:48:18 +00:00
|
|
|
echo " kernel_vhost - use kernel vhost scsi"
|
2018-06-22 07:38:39 +00:00
|
|
|
echo " Default: spdk_vhost_scsi"
|
2020-06-01 11:05:32 +00:00
|
|
|
echo " --packed-ring Use packed ring support. Requires Qemu 4.2.0 or greater. Default: disabled."
|
2018-06-22 07:38:39 +00:00
|
|
|
echo " --use-split Use split vbdevs instead of Logical Volumes"
|
2018-11-21 15:48:18 +00:00
|
|
|
echo " --limit-kernel-vhost=INT Limit kernel vhost to run only on a number of CPU cores."
|
2019-03-25 09:52:38 +00:00
|
|
|
echo " --run-precondition Precondition lvols after creating. Default: true."
|
2020-03-02 19:55:44 +00:00
|
|
|
echo " --precond-fio-bin FIO binary used for SPDK fio plugin precondition. Default: $CONFIG_FIO_SOURCE_DIR/fio."
|
2018-06-22 07:38:39 +00:00
|
|
|
echo " --custom-cpu-cfg=PATH Custom CPU config for test."
|
|
|
|
echo " Default: spdk/test/vhost/common/autotest.config"
|
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 <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464565
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-08 15:29:49 +00:00
|
|
|
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"
|
2018-06-22 07:38:39 +00:00
|
|
|
echo "-x set -x for script debug"
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
2020-05-07 11:27:06 +00:00
|
|
|
function cleanup_lvol_cfg() {
|
2018-06-22 07:38:39 +00:00
|
|
|
notice "Removing lvol bdevs"
|
|
|
|
for lvol_bdev in "${lvol_bdevs[@]}"; do
|
2019-08-29 10:33:16 +00:00
|
|
|
$rpc_py bdev_lvol_delete $lvol_bdev
|
2018-06-22 07:38:39 +00:00
|
|
|
notice "lvol bdev $lvol_bdev removed"
|
|
|
|
done
|
|
|
|
|
|
|
|
notice "Removing lvol stores"
|
|
|
|
for lvol_store in "${lvol_stores[@]}"; do
|
2019-08-29 12:07:56 +00:00
|
|
|
$rpc_py bdev_lvol_delete_lvstore -u $lvol_store
|
2018-06-22 07:38:39 +00:00
|
|
|
notice "lvol store $lvol_store removed"
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2020-05-07 11:27:06 +00:00
|
|
|
function cleanup_split_cfg() {
|
2018-06-22 07:38:39 +00:00
|
|
|
notice "Removing split vbdevs"
|
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 <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464565
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-08 15:29:49 +00:00
|
|
|
for disk in "${disk_cfg_spdk_names[@]}"; do
|
|
|
|
$rpc_py bdev_split_delete ${disk}n1
|
2018-06-22 07:38:39 +00:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2020-05-07 11:27:06 +00:00
|
|
|
function cleanup_parted_config() {
|
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 <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464565
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-08 15:29:49 +00:00
|
|
|
notice "Removing parted disk configuration"
|
|
|
|
for disk in "${disk_cfg_kernel_names[@]}"; do
|
|
|
|
parted -s /dev/${disk}n1 rm 1
|
2018-11-21 15:48:18 +00:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2020-05-07 11:27:06 +00:00
|
|
|
function cleanup_kernel_vhost() {
|
2018-11-21 15:48:18 +00:00
|
|
|
notice "Cleaning kernel vhost configration"
|
|
|
|
targetcli clearconfig confirm=True
|
|
|
|
cleanup_parted_config
|
|
|
|
}
|
|
|
|
|
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 <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464565
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-08 15:29:49 +00:00
|
|
|
function create_vm() {
|
|
|
|
vm_num=$1
|
|
|
|
setup_cmd="vm_setup --disk-type=$ctrl_type --force=$vm_num --memory=$vm_memory --os=$VM_IMAGE"
|
|
|
|
if [[ "$ctrl_type" == "kernel_vhost" ]]; then
|
|
|
|
x=$(printf %03d $vm_num)
|
|
|
|
setup_cmd+=" --disks=${wwpn_prefix}${x}"
|
|
|
|
else
|
|
|
|
setup_cmd+=" --disks=0"
|
|
|
|
fi
|
2020-06-01 11:05:32 +00:00
|
|
|
|
|
|
|
if $packed_ring; then
|
|
|
|
setup_cmd+=" --packed"
|
|
|
|
fi
|
|
|
|
|
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 <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464565
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-08 15:29:49 +00:00
|
|
|
$setup_cmd
|
|
|
|
used_vms+=" $vm_num"
|
|
|
|
echo "Added to used vms"
|
|
|
|
echo $used_vms
|
|
|
|
}
|
|
|
|
|
|
|
|
function create_spdk_controller() {
|
|
|
|
vm_num=$1
|
|
|
|
bdev=$2
|
|
|
|
|
|
|
|
if [[ "$ctrl_type" == "spdk_vhost_scsi" ]]; then
|
|
|
|
$rpc_py vhost_create_scsi_controller naa.0.$vm_num
|
|
|
|
notice "Created vhost scsi controller naa.0.$vm_num"
|
|
|
|
$rpc_py vhost_scsi_controller_add_target naa.0.$vm_num 0 $bdev
|
|
|
|
notice "Added LUN 0/$bdev to controller naa.0.$vm_num"
|
|
|
|
elif [[ "$ctrl_type" == "spdk_vhost_blk" ]]; then
|
2020-06-01 11:05:32 +00:00
|
|
|
if $packed_ring; then
|
|
|
|
p_opt="-p"
|
|
|
|
fi
|
|
|
|
|
|
|
|
$rpc_py vhost_create_blk_controller naa.0.$vm_num $bdev $p_opt
|
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 <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464565
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-08 15:29:49 +00:00
|
|
|
notice "Created vhost blk controller naa.0.$vm_num $bdev"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2018-06-22 07:38:39 +00:00
|
|
|
while getopts 'xh-:' optchar; do
|
|
|
|
case "$optchar" in
|
|
|
|
-)
|
2020-05-07 11:27:06 +00:00
|
|
|
case "$OPTARG" in
|
|
|
|
help) usage $0 ;;
|
|
|
|
fio-bin=*) fio_bin="--fio-bin=${OPTARG#*=}" ;;
|
|
|
|
fio-jobs=*) fio_jobs="${OPTARG#*=}" ;;
|
|
|
|
fio-iterations=*) fio_iterations="${OPTARG#*=}" ;;
|
2020-07-23 13:01:58 +00:00
|
|
|
fio-gtod-reduce) fio_gtod="--gtod-reduce" ;;
|
2020-05-07 11:27:06 +00:00
|
|
|
vm-memory=*) vm_memory="${OPTARG#*=}" ;;
|
|
|
|
vm-image=*) VM_IMAGE="${OPTARG#*=}" ;;
|
|
|
|
vm-sar-enable) vm_sar_enable=true ;;
|
|
|
|
host-sar-enable) host_sar_enable=true ;;
|
|
|
|
sar-delay=*) sar_delay="${OPTARG#*=}" ;;
|
|
|
|
sar-interval=*) sar_interval="${OPTARG#*=}" ;;
|
|
|
|
sar-count=*) sar_count="${OPTARG#*=}" ;;
|
2021-07-06 08:50:26 +00:00
|
|
|
bpf-traces=*) IFS="," read -r -a bpf_traces <<< "${OPTARG#*=}" ;;
|
2020-05-07 11:27:06 +00:00
|
|
|
vm-throttle-iops=*) vm_throttle="${OPTARG#*=}" ;;
|
|
|
|
ctrl-type=*) ctrl_type="${OPTARG#*=}" ;;
|
2020-06-01 11:05:32 +00:00
|
|
|
packed-ring) packed_ring=true ;;
|
2020-05-07 11:27:06 +00:00
|
|
|
use-split) use_split=true ;;
|
|
|
|
run-precondition) run_precondition=true ;;
|
|
|
|
precond-fio-bin=*) precond_fio_bin="${OPTARG#*=}" ;;
|
|
|
|
limit-kernel-vhost=*) kernel_cpus="${OPTARG#*=}" ;;
|
|
|
|
custom-cpu-cfg=*) custom_cpu_cfg="${OPTARG#*=}" ;;
|
|
|
|
disk-map=*) disk_map="${OPTARG#*=}" ;;
|
|
|
|
*) usage $0 "Invalid argument '$OPTARG'" ;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
h) usage $0 ;;
|
|
|
|
x)
|
|
|
|
set -x
|
|
|
|
x="-x"
|
|
|
|
;;
|
|
|
|
*) usage $0 "Invalid argument '$OPTARG'" ;;
|
2018-06-22 07:38:39 +00:00
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2019-06-04 20:55:21 +00:00
|
|
|
rpc_py="$rootdir/scripts/rpc.py -s $(get_vhost_dir 0)/rpc.sock"
|
2018-06-22 07:38:39 +00:00
|
|
|
|
|
|
|
if [[ -n $custom_cpu_cfg ]]; then
|
|
|
|
source $custom_cpu_cfg
|
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 <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464565
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-08 15:29:49 +00:00
|
|
|
vhost_reactor_mask="vhost_${vhost_num}_reactor_mask"
|
|
|
|
vhost_reactor_mask="${!vhost_reactor_mask}"
|
2020-11-30 20:20:12 +00:00
|
|
|
vhost_main_core="vhost_${vhost_num}_main_core"
|
|
|
|
vhost_main_core="${!vhost_main_core}"
|
2018-06-22 07:38:39 +00:00
|
|
|
fi
|
|
|
|
|
2020-04-16 09:10:37 +00:00
|
|
|
if [[ -z $fio_jobs ]]; then
|
|
|
|
error "No FIO job specified!"
|
2018-06-22 07:38:39 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
trap 'error_exit "${FUNCNAME}" "${LINENO}"' INT ERR
|
|
|
|
|
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 <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464565
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-08 15:29:49 +00:00
|
|
|
if [[ -z $disk_map ]]; then
|
|
|
|
fail "No disk map provided for test. Exiting."
|
2018-06-22 07:38:39 +00:00
|
|
|
fi
|
|
|
|
|
2021-06-29 09:36:51 +00:00
|
|
|
# ===== Enable "performance" cpu governor =====
|
|
|
|
if hash cpupower; then
|
|
|
|
cpupower frequency-set -g performance
|
|
|
|
else
|
|
|
|
echo "WARNING: Missing CPUPOWER!!! Please install."
|
|
|
|
fi
|
|
|
|
current_governor=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)
|
|
|
|
echo "INFO: Using $current_governor cpu governor for test."
|
|
|
|
|
2019-03-25 09:52:38 +00:00
|
|
|
# ===== Precondition NVMes if specified =====
|
|
|
|
if [[ $run_precondition == true ]]; then
|
|
|
|
# Using the same precondition routine possible for lvols thanks
|
|
|
|
# to --clear-method option. Lvols should not UNMAP on creation.
|
2020-05-07 11:27:06 +00:00
|
|
|
json_cfg=$rootdir/nvme.json
|
2020-10-21 10:59:09 +00:00
|
|
|
$rootdir/scripts/gen_nvme.sh --json-with-subsystems > "$json_cfg"
|
2020-05-07 11:27:06 +00:00
|
|
|
mapfile -t nvmes < <(grep -oP "Nvme\d+" "$json_cfg")
|
|
|
|
fio_filename=$(printf ":%sn1" "${nvmes[@]}")
|
|
|
|
fio_filename=${fio_filename:1}
|
|
|
|
$precond_fio_bin --name="precondition" \
|
2020-05-28 18:39:36 +00:00
|
|
|
--ioengine="${rootdir}/build/fio/spdk_bdev" \
|
2020-05-07 11:27:06 +00:00
|
|
|
--rw="write" --spdk_json_conf="$json_cfg" --thread="1" \
|
|
|
|
--group_reporting --direct="1" --size="100%" --loops="2" --bs="256k" \
|
|
|
|
--iodepth=32 --filename="${fio_filename}" || true
|
2019-03-25 09:52:38 +00:00
|
|
|
fi
|
|
|
|
|
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 <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464565
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-08 15:29:49 +00:00
|
|
|
set +x
|
|
|
|
readarray disk_cfg < $disk_map
|
|
|
|
for line in "${disk_cfg[@]}"; do
|
|
|
|
echo $line
|
|
|
|
IFS=","
|
|
|
|
s=($line)
|
|
|
|
disk_cfg_bdfs+=(${s[0]})
|
|
|
|
disk_cfg_spdk_names+=(${s[1]})
|
|
|
|
disk_cfg_splits+=(${s[2]})
|
|
|
|
disk_cfg_vms+=("${s[3]}")
|
|
|
|
|
|
|
|
# Find kernel nvme names
|
|
|
|
if [[ "$ctrl_type" == "kernel_vhost" ]]; then
|
|
|
|
tmp=$(find /sys/devices/pci* -name ${s[0]} -print0 | xargs sh -c 'ls $0/nvme')
|
|
|
|
disk_cfg_kernel_names+=($tmp)
|
|
|
|
IFS=" "
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
unset IFS
|
|
|
|
set -x
|
|
|
|
|
2018-11-21 15:48:18 +00:00
|
|
|
if [[ "$ctrl_type" == "kernel_vhost" ]]; then
|
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 <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464565
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-08 15:29:49 +00:00
|
|
|
notice "Configuring kernel vhost..."
|
2018-11-21 15:48:18 +00:00
|
|
|
trap 'vm_kill_all; sleep 1; cleanup_kernel_vhost; error_exit "${FUNCNAME}" "${LINENO}"' INT ERR
|
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 <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464565
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-08 15:29:49 +00:00
|
|
|
|
2018-11-21 15:48:18 +00:00
|
|
|
# Split disks using parted for kernel vhost
|
|
|
|
newline=$'\n'
|
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 <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464565
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-08 15:29:49 +00:00
|
|
|
backstores=()
|
2020-05-07 11:27:06 +00:00
|
|
|
for ((i = 0; i < ${#disk_cfg_kernel_names[@]}; i++)); do
|
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 <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464565
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-08 15:29:49 +00:00
|
|
|
nvme=${disk_cfg_kernel_names[$i]}
|
|
|
|
splits=${disk_cfg_splits[$i]}
|
|
|
|
notice " Creating extended partition on disk /dev/${nvme}n1"
|
|
|
|
parted -s /dev/${nvme}n1 mklabel msdos
|
|
|
|
parted -s /dev/${nvme}n1 mkpart extended 2048s 100%
|
|
|
|
|
2020-05-07 11:27:06 +00:00
|
|
|
part_size=$((100 / ${disk_cfg_splits[$i]})) # Split 100% of disk into roughly even parts
|
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 <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464565
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-08 15:29:49 +00:00
|
|
|
echo " Creating ${splits} partitions of relative disk size ${part_size}"
|
|
|
|
for p in $(seq 0 $((splits - 1))); do
|
2020-05-07 11:27:06 +00:00
|
|
|
p_start=$((p * part_size))
|
|
|
|
p_end=$((p_start + part_size))
|
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 <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464565
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-08 15:29:49 +00:00
|
|
|
parted -s /dev/${nvme}n1 mkpart logical ${p_start}% ${p_end}%
|
|
|
|
sleep 3
|
2018-06-22 07:38:39 +00:00
|
|
|
done
|
2018-11-21 15:48:18 +00:00
|
|
|
|
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 <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464565
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-08 15:29:49 +00:00
|
|
|
# Prepare kernel vhost configuration
|
|
|
|
# Below grep: match only NVMe partitions which are not "Extended" type.
|
|
|
|
# For example: will match nvme0n1p15 but not nvme0n1p1
|
|
|
|
partitions=$(find /dev -name "${nvme}n1*" | sort --version-sort | grep -P 'p(?!1$)\d+')
|
|
|
|
# Create block backstores for vhost kernel process
|
|
|
|
for p in $partitions; do
|
|
|
|
backstore_name=$(basename $p)
|
|
|
|
backstores+=("$backstore_name")
|
|
|
|
targetcli backstores/block create $backstore_name $p
|
|
|
|
done
|
|
|
|
partitions=($partitions)
|
|
|
|
|
|
|
|
# Create kernel vhost controllers and add LUNs
|
|
|
|
# Setup VM configurations
|
|
|
|
vms_to_run=(${disk_cfg_vms[i]})
|
2020-05-07 11:27:06 +00:00
|
|
|
for ((j = 0; j < ${#vms_to_run[@]}; j++)); do
|
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 <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464565
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-08 15:29:49 +00:00
|
|
|
# WWPN prefix misses 3 characters. Need to complete it
|
|
|
|
# using block backstore number
|
|
|
|
x=$(printf %03d ${vms_to_run[$j]})
|
|
|
|
wwpn="${wwpn_prefix}${x}"
|
|
|
|
targetcli vhost/ create $wwpn
|
|
|
|
targetcli vhost/$wwpn/tpg1/luns create /backstores/block/$(basename ${partitions[$j]})
|
|
|
|
create_vm ${vms_to_run[j]}
|
|
|
|
sleep 1
|
|
|
|
done
|
2018-11-21 15:48:18 +00:00
|
|
|
done
|
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 <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464565
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-08 15:29:49 +00:00
|
|
|
targetcli ls
|
2018-06-22 07:38:39 +00:00
|
|
|
else
|
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 <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464565
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-08 15:29:49 +00:00
|
|
|
notice "Configuring SPDK vhost..."
|
2021-03-03 17:34:59 +00:00
|
|
|
vhost_run -n "${vhost_num}" -g -a "-p ${vhost_main_core} -m ${vhost_reactor_mask}"
|
2018-11-21 15:48:18 +00:00
|
|
|
notice "..."
|
2021-07-06 08:50:26 +00:00
|
|
|
if [[ ${#bpf_traces[@]} -gt 0 ]]; then
|
|
|
|
notice "Enabling BPF traces: ${bpf_traces[*]}"
|
|
|
|
vhost_dir="$(get_vhost_dir 0)"
|
|
|
|
vhost_pid="$(cat $vhost_dir/vhost.pid)"
|
|
|
|
|
|
|
|
bpf_cmd=("$rootdir/scripts/bpftrace.sh")
|
|
|
|
bpf_cmd+=("$vhost_pid")
|
|
|
|
for trace in "${bpf_traces[@]}"; do
|
|
|
|
bpf_cmd+=("$rootdir/scripts/bpf/$trace")
|
|
|
|
done
|
|
|
|
|
|
|
|
BPF_OUTFILE="$VHOST_DIR/bpftraces.txt" "${bpf_cmd[@]}" &
|
|
|
|
bpf_script_pid=$!
|
|
|
|
|
|
|
|
# Wait a bit for trace capture to start
|
|
|
|
sleep 3
|
|
|
|
fi
|
2018-11-21 15:48:18 +00:00
|
|
|
|
|
|
|
if [[ $use_split == true ]]; then
|
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 <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464565
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-08 15:29:49 +00:00
|
|
|
notice "Configuring split bdevs configuration..."
|
2018-11-21 15:48:18 +00:00
|
|
|
trap 'cleanup_split_cfg; error_exit "${FUNCNAME}" "${LINENO}"' INT ERR
|
2020-05-07 11:27:06 +00:00
|
|
|
for ((i = 0; i < ${#disk_cfg_bdfs[@]}; i++)); do
|
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 <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464565
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-08 15:29:49 +00:00
|
|
|
nvme_bdev=$($rpc_py bdev_nvme_attach_controller -b ${disk_cfg_spdk_names[$i]} -t pcie -a ${disk_cfg_bdfs[$i]})
|
|
|
|
notice "Created NVMe Bdev: $nvme_bdev with BDF ${disk_cfg_bdfs[$i]}"
|
|
|
|
|
|
|
|
splits=$($rpc_py bdev_split_create $nvme_bdev ${disk_cfg_splits[$i]})
|
|
|
|
splits=($splits)
|
|
|
|
notice "Created splits: ${splits[*]} on Bdev ${nvme_bdev}"
|
|
|
|
for s in "${splits[@]}"; do
|
|
|
|
split_bdevs+=($s)
|
2018-11-21 15:48:18 +00:00
|
|
|
done
|
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 <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464565
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-08 15:29:49 +00:00
|
|
|
|
|
|
|
vms_to_run=(${disk_cfg_vms[i]})
|
2020-05-07 11:27:06 +00:00
|
|
|
for ((j = 0; j < ${#vms_to_run[@]}; j++)); do
|
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 <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464565
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-08 15:29:49 +00:00
|
|
|
notice "Setting up VM ${vms_to_run[j]}"
|
|
|
|
create_spdk_controller "${vms_to_run[j]}" ${splits[j]}
|
|
|
|
create_vm ${vms_to_run[j]}
|
|
|
|
done
|
|
|
|
echo " "
|
2018-06-22 07:38:39 +00:00
|
|
|
done
|
2018-11-21 15:48:18 +00:00
|
|
|
bdevs=("${split_bdevs[@]}")
|
|
|
|
else
|
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 <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464565
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-08 15:29:49 +00:00
|
|
|
notice "Configuring LVOLs..."
|
2018-11-21 15:48:18 +00:00
|
|
|
trap 'cleanup_lvol_cfg; error_exit "${FUNCNAME}" "${LINENO}"' INT ERR
|
2020-05-07 11:27:06 +00:00
|
|
|
for ((i = 0; i < ${#disk_cfg_bdfs[@]}; i++)); do
|
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 <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464565
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-08 15:29:49 +00:00
|
|
|
nvme_bdev=$($rpc_py bdev_nvme_attach_controller -b ${disk_cfg_spdk_names[$i]} -t pcie -a ${disk_cfg_bdfs[$i]})
|
|
|
|
notice "Created NVMe Bdev: $nvme_bdev with BDF ${disk_cfg_bdfs[$i]}"
|
|
|
|
|
|
|
|
ls_guid=$($rpc_py bdev_lvol_create_lvstore $nvme_bdev lvs_$i --clear-method none)
|
2018-11-21 15:48:18 +00:00
|
|
|
lvol_stores+=("$ls_guid")
|
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 <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464565
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-08 15:29:49 +00:00
|
|
|
notice "Created Lvol Store: $ls_guid on Bdev $nvme_bdev"
|
|
|
|
|
|
|
|
vms_to_run=(${disk_cfg_vms[i]})
|
2020-05-07 11:27:06 +00:00
|
|
|
for ((j = 0; j < ${disk_cfg_splits[$i]}; j++)); do
|
2018-11-21 15:48:18 +00:00
|
|
|
free_mb=$(get_lvs_free_mb "$ls_guid")
|
2020-05-07 11:27:06 +00:00
|
|
|
size=$((free_mb / ((${disk_cfg_splits[$i]} - j))))
|
2019-08-29 11:01:30 +00:00
|
|
|
lb_name=$($rpc_py bdev_lvol_create -u $ls_guid lbd_$j $size --clear-method none)
|
2018-11-21 15:48:18 +00:00
|
|
|
lvol_bdevs+=("$lb_name")
|
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 <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464565
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-08 15:29:49 +00:00
|
|
|
notice "Created LVOL Bdev $lb_name on Lvol Store $ls_guid on Bdev $nvme_bdev"
|
|
|
|
|
|
|
|
notice "Setting up VM ${vms_to_run[j]}"
|
|
|
|
create_spdk_controller "${vms_to_run[j]}" ${lb_name}
|
|
|
|
create_vm ${vms_to_run[j]}
|
2018-11-21 15:48:18 +00:00
|
|
|
done
|
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 <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464565
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-08 15:29:49 +00:00
|
|
|
echo " "
|
2018-11-21 15:48:18 +00:00
|
|
|
done
|
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 <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464565
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-08 15:29:49 +00:00
|
|
|
$rpc_py bdev_lvol_get_lvstores
|
2018-11-21 15:48:18 +00:00
|
|
|
fi
|
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 <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464565
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-08 15:29:49 +00:00
|
|
|
$rpc_py bdev_get_bdevs
|
|
|
|
$rpc_py vhost_get_controllers
|
2018-11-21 15:48:18 +00:00
|
|
|
fi
|
|
|
|
|
2018-06-22 07:38:39 +00:00
|
|
|
# Start VMs
|
|
|
|
# Run VMs
|
|
|
|
vm_run $used_vms
|
|
|
|
vm_wait_for_boot 300 $used_vms
|
|
|
|
|
2018-11-21 15:48:18 +00:00
|
|
|
if [[ -n "$kernel_cpus" ]]; then
|
2021-02-16 10:02:56 +00:00
|
|
|
echo "+cpuset" > /sys/fs/cgroup/cgroup.subtree_control
|
|
|
|
mkdir -p /sys/fs/cgroup/spdk
|
2018-11-21 15:48:18 +00:00
|
|
|
kernel_mask=$vhost_0_reactor_mask
|
|
|
|
kernel_mask=${kernel_mask#"["}
|
|
|
|
kernel_mask=${kernel_mask%"]"}
|
|
|
|
|
2021-02-16 10:02:56 +00:00
|
|
|
echo "threaded" > /sys/fs/cgroup/spdk/cgroup.type
|
|
|
|
echo "$kernel_mask" > /sys/fs/cgroup/spdk/cpuset.cpus
|
|
|
|
echo "0-1" > /sys/fs/cgroup/spdk/cpuset.mems
|
2018-11-21 15:48:18 +00:00
|
|
|
|
2019-08-30 11:12:56 +00:00
|
|
|
kernel_vhost_pids=$(pgrep "vhost" -U root)
|
2018-11-21 15:48:18 +00:00
|
|
|
for kpid in $kernel_vhost_pids; do
|
|
|
|
echo "Limiting kernel vhost pid ${kpid}"
|
2021-02-16 10:02:56 +00:00
|
|
|
echo "${kpid}" > /sys/fs/cgroup/spdk/cgroup.threads
|
2018-11-21 15:48:18 +00:00
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
2018-06-22 07:38:39 +00:00
|
|
|
# Run FIO
|
|
|
|
fio_disks=""
|
|
|
|
for vm_num in $used_vms; do
|
|
|
|
host_name="VM-$vm_num"
|
2019-06-04 22:00:09 +00:00
|
|
|
vm_exec $vm_num "hostname $host_name"
|
2018-06-22 07:38:39 +00:00
|
|
|
vm_start_fio_server $fio_bin $vm_num
|
|
|
|
|
|
|
|
if [[ "$ctrl_type" == "spdk_vhost_scsi" ]]; then
|
|
|
|
vm_check_scsi_location $vm_num
|
|
|
|
elif [[ "$ctrl_type" == "spdk_vhost_blk" ]]; then
|
|
|
|
vm_check_blk_location $vm_num
|
2018-11-21 15:48:18 +00:00
|
|
|
elif [[ "$ctrl_type" == "kernel_vhost" ]]; then
|
|
|
|
vm_check_scsi_location $vm_num
|
|
|
|
fi
|
|
|
|
|
2021-01-19 08:57:02 +00:00
|
|
|
block=$(printf '%s' $SCSI_DISK)
|
|
|
|
vm_exec "$vm_num" "echo none > /sys/class/block/$block/queue/scheduler"
|
|
|
|
|
2018-11-21 15:48:18 +00:00
|
|
|
if [[ -n "$vm_throttle" ]]; then
|
2021-01-19 07:47:19 +00:00
|
|
|
# Check whether cgroups or cgroupsv2 is used on guest system
|
|
|
|
# Simple, naive & quick approach as it should do the trick for simple
|
|
|
|
# VMs used for performance tests
|
|
|
|
c_gr_ver=2
|
|
|
|
if vm_exec "$vm_num" "grep '^cgroup ' /proc/mounts"; then
|
|
|
|
c_gr_ver=1
|
|
|
|
fi
|
2019-06-04 22:00:09 +00:00
|
|
|
major_minor=$(vm_exec "$vm_num" "cat /sys/block/$block/dev")
|
2021-01-19 07:47:19 +00:00
|
|
|
|
|
|
|
if [[ $c_gr_ver == 1 ]]; then
|
|
|
|
vm_exec "$vm_num" "echo \"$major_minor $vm_throttle\" > /sys/fs/cgroup/blkio/blkio.throttle.read_iops_device"
|
|
|
|
vm_exec "$vm_num" "echo \"$major_minor $vm_throttle\" > /sys/fs/cgroup/blkio/blkio.throttle.write_iops_device"
|
|
|
|
elif [[ $c_gr_ver == 2 ]]; then
|
|
|
|
vm_exec "$vm_num" "echo '+io' > /sys/fs/cgroup/cgroup.subtree_control"
|
|
|
|
vm_exec "$vm_num" "echo \"$major_minor riops=$vm_throttle wiops=$vm_throttle\" > /sys/fs/cgroup/user.slice/io.max"
|
|
|
|
fi
|
2018-06-22 07:38:39 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
fio_disks+=" --vm=${vm_num}$(printf ':/dev/%s' $SCSI_DISK)"
|
|
|
|
done
|
|
|
|
|
|
|
|
# Run FIO traffic
|
2020-04-16 09:10:37 +00:00
|
|
|
for fio_job in ${fio_jobs//,/ }; do
|
|
|
|
fio_job_fname=$(basename $fio_job)
|
|
|
|
fio_log_fname="${fio_job_fname%%.*}.log"
|
|
|
|
for i in $(seq 1 $fio_iterations); do
|
|
|
|
echo "Running FIO iteration $i for $fio_job_fname"
|
2020-07-23 13:01:58 +00:00
|
|
|
run_fio $fio_bin --hide-results --job-file="$fio_job" --out="$VHOST_DIR/fio_results" --json $fio_disks $fio_gtod &
|
2020-04-16 09:10:37 +00:00
|
|
|
fio_pid=$!
|
|
|
|
|
|
|
|
if $host_sar_enable || $vm_sar_enable; then
|
|
|
|
pids=""
|
|
|
|
mkdir -p $VHOST_DIR/fio_results/sar_stats
|
|
|
|
sleep $sar_delay
|
|
|
|
fi
|
|
|
|
|
|
|
|
if $host_sar_enable; then
|
|
|
|
sar -P ALL $sar_interval $sar_count > "$VHOST_DIR/fio_results/sar_stats/sar_stats_host.txt" &
|
2019-04-11 15:36:40 +00:00
|
|
|
pids+=" $!"
|
2020-04-16 09:10:37 +00:00
|
|
|
fi
|
2019-08-07 11:49:45 +00:00
|
|
|
|
2020-04-16 09:10:37 +00:00
|
|
|
if $vm_sar_enable; then
|
|
|
|
for vm_num in $used_vms; do
|
|
|
|
vm_exec "$vm_num" "mkdir -p /root/sar; sar -P ALL $sar_interval $sar_count >> /root/sar/sar_stats_VM${vm_num}_run${i}.txt" &
|
|
|
|
pids+=" $!"
|
|
|
|
done
|
|
|
|
fi
|
2019-08-07 11:49:45 +00:00
|
|
|
|
2020-04-16 09:10:37 +00:00
|
|
|
for j in $pids; do
|
2020-05-07 11:27:06 +00:00
|
|
|
wait $j
|
2019-04-11 15:36:40 +00:00
|
|
|
done
|
2018-11-21 15:48:18 +00:00
|
|
|
|
2020-04-16 09:10:37 +00:00
|
|
|
if $vm_sar_enable; then
|
|
|
|
for vm_num in $used_vms; do
|
|
|
|
vm_scp "$vm_num" "root@127.0.0.1:/root/sar/sar_stats_VM${vm_num}_run${i}.txt" "$VHOST_DIR/fio_results/sar_stats"
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
wait $fio_pid
|
|
|
|
mv $VHOST_DIR/fio_results/$fio_log_fname $VHOST_DIR/fio_results/$fio_log_fname.$i
|
|
|
|
sleep 1
|
|
|
|
done
|
2020-07-08 15:43:39 +00:00
|
|
|
|
|
|
|
parse_fio_results "$VHOST_DIR/fio_results" "$fio_log_fname"
|
2019-04-11 15:36:40 +00:00
|
|
|
done
|
2018-06-22 07:38:39 +00:00
|
|
|
|
|
|
|
notice "Shutting down virtual machines..."
|
|
|
|
vm_shutdown_all
|
|
|
|
|
2018-11-21 15:48:18 +00:00
|
|
|
if [[ "$ctrl_type" == "kernel_vhost" ]]; then
|
|
|
|
cleanup_kernel_vhost || true
|
2018-06-22 07:38:39 +00:00
|
|
|
else
|
2018-11-21 15:48:18 +00:00
|
|
|
notice "Shutting down SPDK vhost app..."
|
|
|
|
if [[ $use_split == true ]]; then
|
|
|
|
cleanup_split_cfg
|
|
|
|
else
|
|
|
|
cleanup_lvol_cfg
|
|
|
|
fi
|
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 <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464565
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-08 15:29:49 +00:00
|
|
|
vhost_kill "${vhost_num}"
|
2021-07-06 08:50:26 +00:00
|
|
|
|
|
|
|
if ((bpf_script_pid)); then
|
|
|
|
wait $bpf_script_pid
|
|
|
|
fi
|
2018-11-21 15:48:18 +00:00
|
|
|
fi
|