From 5f7409c89b16629e83a08a1b8e08e964bd03054d Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Mon, 20 Feb 2023 23:26:10 +0100 Subject: [PATCH] test/vhost: Switch from msdos to gpt Disks used under the vhost benchmarks can be > 2TB so the msdos pt is not very suitable here. Use something more robust like gpt. Signed-off-by: Michal Berger Change-Id: I3e98bcb655c2f55a515f4000b0668b26d71c8fca Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16889 Tested-by: SPDK CI Jenkins Reviewed-by: Shuhei Matsumoto Reviewed-by: Jim Harris Reviewed-by: Karol Latecki --- test/vhost/perf_bench/vhost_perf.sh | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/test/vhost/perf_bench/vhost_perf.sh b/test/vhost/perf_bench/vhost_perf.sh index eb0c15fd4..d5ef153a3 100755 --- a/test/vhost/perf_bench/vhost_perf.sh +++ b/test/vhost/perf_bench/vhost_perf.sh @@ -121,7 +121,7 @@ function cleanup_split_cfg() { function cleanup_parted_config() { notice "Removing parted disk configuration" for disk in "${disk_cfg_kernel_names[@]}"; do - parted -s /dev/${disk}n1 rm 1 + wipefs --all "/dev/${disk}n1" done } @@ -303,30 +303,27 @@ if [[ "$ctrl_type" == "kernel_vhost" ]]; then for ((i = 0; i < ${#disk_cfg_kernel_names[@]}; i++)); do 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% + notice " Creating partition table (GPT) on /dev/${nvme}n1" + parted -s /dev/${nvme}n1 mklabel gpt part_size=$((100 / ${disk_cfg_splits[$i]})) # Split 100% of disk into roughly even parts echo " Creating ${splits} partitions of relative disk size ${part_size}" for p in $(seq 0 $((splits - 1))); do p_start=$((p * part_size)) p_end=$((p_start + part_size)) - parted -s /dev/${nvme}n1 mkpart logical ${p_start}% ${p_end}% - sleep 3 + parted -s "/dev/${nvme}n1" mkpart "part$p" ${p_start}% ${p_end}% done + sleep 3 + # 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+') + partitions=("/dev/${nvme}n1p"*) # Create block backstores for vhost kernel process - for p in $partitions; do + 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