From 30491c46759c7a59f024ff3495f99cc1c7990c66 Mon Sep 17 00:00:00 2001 From: Karol Latecki Date: Tue, 14 Jul 2020 11:43:07 +0200 Subject: [PATCH] test/nvme_perf: allow CPU list from file Read CPU list to use in test directly from option value of from a file if it's an existing path. This will make running tests in CI a bit easier. Signed-off-by: Karol Latecki Change-Id: I174a38ab615c2f2cd2c3b4a95e0ebf886c478a51 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3333 Tested-by: SPDK CI Jenkins Community-CI: Mellanox Build Bot Reviewed-by: Paul Luse Reviewed-by: Darek Stojaczyk Reviewed-by: Tomasz Zawadzki Reviewed-by: Jim Harris --- test/nvme/perf/common.sh | 48 ++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/test/nvme/perf/common.sh b/test/nvme/perf/common.sh index 7f23ec3c2..52dabd722 100755 --- a/test/nvme/perf/common.sh +++ b/test/nvme/perf/common.sh @@ -510,26 +510,27 @@ function usage() { echo " Applicable only for fio-based tests." echo echo "Test setup parameters:" - echo " --driver=STR Selects tool used for testing. Choices available:" - echo " - spdk-perf-nvme (SPDK nvme perf)" - echo " - spdk-perf-bdev (SPDK bdev perf)" - echo " - spdk-plugin-nvme (SPDK nvme fio plugin)" - echo " - spdk-plugin-bdev (SPDK bdev fio plugin)" - echo " - kernel-classic-polling" - echo " - kernel-hybrid-polling" - echo " - kernel-libaio" - echo " - kernel-io-uring" - echo " --disk-config Configuration file containing PCI BDF addresses of NVMe disks to use in test." - echo " It consists a single column of PCI addresses. SPDK Bdev names will be assigned" - echo " and Kernel block device names detected." - echo " Lines starting with # are ignored as comments." - echo " --bdev-io-cache-size Set IO cache size for for SPDK bdev subsystem." - echo " --bdev-io-pool-size Set IO pool size for for SPDK bdev subsystem." - echo " --max-disk=INT,ALL Number of disks to test on, this will run multiple workloads with increasing number of disk each run." - echo " If =ALL then test on all found disk. [default=$DISKNO]" - echo " --cpu-allowed=INT Comma-separated list of CPU cores used to run the workload. [default=$CPUS_ALLOWED]" - echo " --no-preconditioning Skip preconditioning" - echo " --no-io-scaling Do not scale iodepth for each device in SPDK fio plugin. [default=$NOIOSCALING]" + echo " --driver=STR Selects tool used for testing. Choices available:" + echo " - spdk-perf-nvme (SPDK nvme perf)" + echo " - spdk-perf-bdev (SPDK bdev perf)" + echo " - spdk-plugin-nvme (SPDK nvme fio plugin)" + echo " - spdk-plugin-bdev (SPDK bdev fio plugin)" + echo " - kernel-classic-polling" + echo " - kernel-hybrid-polling" + echo " - kernel-libaio" + echo " - kernel-io-uring" + echo " --disk-config Configuration file containing PCI BDF addresses of NVMe disks to use in test." + echo " It consists a single column of PCI addresses. SPDK Bdev names will be assigned" + echo " and Kernel block device names detected." + echo " Lines starting with # are ignored as comments." + echo " --bdev-io-cache-size Set IO cache size for for SPDK bdev subsystem." + echo " --bdev-io-pool-size Set IO pool size for for SPDK bdev subsystem." + echo " --max-disk=INT,ALL Number of disks to test on, this will run multiple workloads with increasing number of disk each run." + echo " If =ALL then test on all found disk. [default=$DISKNO]" + echo " --cpu-allowed=INT/PATH Comma-separated list of CPU cores used to run the workload. Ranges allowed." + echo " Can also point to a file containing list of CPUs. [default=$CPUS_ALLOWED]" + echo " --no-preconditioning Skip preconditioning" + echo " --no-io-scaling Do not scale iodepth for each device in SPDK fio plugin. [default=$NOIOSCALING]" set -x } @@ -561,7 +562,12 @@ while getopts 'h-:' optchar; do bdev-io-cache-size=*) BDEV_CACHE="${OPTARG#*=}" ;; bdev-io-pool-size=*) BDEV_POOL="${OPTARG#*=}" ;; max-disk=*) DISKNO="${OPTARG#*=}" ;; - cpu-allowed=*) CPUS_ALLOWED="${OPTARG#*=}" ;; + cpu-allowed=*) + CPUS_ALLOWED="${OPTARG#*=}" + if [[ -f "$CPUS_ALLOWED" ]]; then + CPUS_ALLOWED=$(cat "$CPUS_ALLOWED") + fi + ;; no-preconditioning) PRECONDITIONING=false ;; no-io-scaling) NOIOSCALING=true ;; *)