test/vhost: change spdk and qemu masks to decimal format

Change-Id: Ia3122d7680e34b2270218a96770b2a2662b732ad
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/416526
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Karol Latecki 2018-06-15 13:43:55 +02:00 committed by Daniel Verkamp
parent 17777bcad7
commit dfe497c27b
6 changed files with 61 additions and 50 deletions

View File

@ -1,38 +1,38 @@
vhost_0_reactor_mask=0x1
vhost_0_reactor_mask="[0]"
vhost_0_master_core=0
VM_0_qemu_mask=0x6
VM_0_qemu_mask=1-2
VM_0_qemu_numa_node=0
VM_1_qemu_mask=0x18
VM_1_qemu_mask=3-4
VM_1_qemu_numa_node=0
VM_2_qemu_mask=0x60
VM_2_qemu_mask=5-6
VM_2_qemu_numa_node=0
VM_3_qemu_mask=0x180
VM_3_qemu_mask=7-8
VM_3_qemu_numa_node=0
VM_4_qemu_mask=0x600
VM_4_qemu_mask=9-10
VM_4_qemu_numa_node=0
VM_5_qemu_mask=0x1800
VM_5_qemu_mask=11-12
VM_5_qemu_numa_node=0
VM_6_qemu_mask=0x1800000
VM_6_qemu_mask=13-14
VM_6_qemu_numa_node=1
VM_7_qemu_mask=0x6000000
VM_7_qemu_mask=15-16
VM_7_qemu_numa_node=1
VM_8_qemu_mask=0x18000000
VM_8_qemu_mask=17-18
VM_8_qemu_numa_node=1
VM_9_qemu_mask=0x60000000
VM_9_qemu_mask=19-20
VM_9_qemu_numa_node=1
VM_10_qemu_mask=0x180000000
VM_10_qemu_mask=21-22
VM_10_qemu_numa_node=1
VM_11_qemu_mask=0x600000000
VM_11_qemu_mask=23-24
VM_11_qemu_numa_node=1

View File

@ -635,7 +635,7 @@ function vm_setup()
local task_mask=${!qemu_mask_param}
notice "TASK MASK: $task_mask"
local cmd="taskset -a $task_mask $QEMU_PREFIX/bin/qemu-system-x86_64 ${eol}"
local cmd="taskset -a -c $task_mask $QEMU_PREFIX/bin/qemu-system-x86_64 ${eol}"
local vm_socket_offset=$(( 10000 + 100 * vm_num ))
local ssh_socket=$(( vm_socket_offset + 0 ))
@ -648,9 +648,20 @@ function vm_setup()
local cpu_num=0
set +x
for ((cpu=0; cpu<$(nproc --all); cpu++))
do
(($task_mask&1<<$cpu)) && ((cpu_num++)) || :
# cpu list for taskset can be comma separated or range
# or both at the same time, so first split on commas
cpu_list=$(echo $task_mask | tr "," "\n")
queue_number=0
for c in $cpu_list; do
# if range is detected - count how many cpus
if [[ $c =~ [0-9]+-[0-9]+ ]]; then
val=$(($c-1))
val=${val#-}
else
val=1
fi
cpu_num=$((cpu_num+val))
queue_number=$((queue_number+val))
done
if [ -z $queue_number ]; then

View File

@ -177,7 +177,7 @@ for vm_num in $used_vms; do
qemu_mask_param="VM_${vm_num}_qemu_mask"
host_name="VM-$vm_num-${!qemu_mask_param}"
host_name="VM-$vm_num"
notice "Setting up hostname: $host_name"
vm_ssh $vm_num "hostname $host_name"
vm_start_fio_server $fio_bin $readonly $vm_num

View File

@ -1,5 +1,5 @@
vhost_0_reactor_mask=0x1
vhost_0_reactor_mask=["0"]
vhost_0_master_core=0
VM_0_qemu_mask=0x7FE
VM_0_qemu_mask=1-10
VM_0_qemu_numa_node=0

View File

@ -1,74 +1,74 @@
vhost_0_reactor_mask=0xfffffffff
vhost_0_reactor_mask="[0-31]"
vhost_0_master_core=0
VM_0_qemu_mask=0x2
VM_0_qemu_mask=1
VM_0_qemu_numa_node=0
VM_1_qemu_mask=0x4
VM_1_qemu_mask=2
VM_1_qemu_numa_node=0
VM_2_qemu_mask=0x8
VM_2_qemu_mask=3
VM_2_qemu_numa_node=0
VM_3_qemu_mask=0x10
VM_3_qemu_mask=4
VM_3_qemu_numa_node=0
VM_4_qemu_mask=0x20
VM_4_qemu_mask=5
VM_4_qemu_numa_node=0
VM_5_qemu_mask=0x40
VM_5_qemu_mask=6
VM_5_qemu_numa_node=0
VM_6_qemu_mask=0x80
VM_6_qemu_mask=7
VM_6_qemu_numa_node=0
VM_7_qemu_mask=0x100
VM_7_qemu_mask=8
VM_7_qemu_numa_node=0
VM_8_qemu_mask=0x200
VM_8_qemu_mask=9
VM_8_qemu_numa_node=0
VM_9_qemu_mask=0x400
VM_9_qemu_mask=10
VM_9_qemu_numa_node=0
VM_10_qemu_mask=0x800
VM_10_qemu_mask=11
VM_10_qemu_numa_node=0
VM_11_qemu_mask=0x1000
VM_11_qemu_mask=12
VM_11_qemu_numa_node=0
VM_12_qemu_mask=0x40000
VM_12_qemu_mask=13
VM_12_qemu_numa_node=1
VM_13_qemu_mask=0x80000
VM_13_qemu_mask=14
VM_13_qemu_numa_node=1
VM_14_qemu_mask=0x100000
VM_14_qemu_mask=15
VM_14_qemu_numa_node=1
VM_15_qemu_mask=0x200000
VM_15_qemu_mask=16
VM_15_qemu_numa_node=1
VM_16_qemu_mask=0x400000
VM_16_qemu_mask=17
VM_16_qemu_numa_node=1
VM_17_qemu_mask=0x800000
VM_17_qemu_mask=18
VM_17_qemu_numa_node=1
VM_18_qemu_mask=0x1000000
VM_18_qemu_mask=19
VM_18_qemu_numa_node=1
VM_19_qemu_mask=0x2000000
VM_19_qemu_mask=20
VM_19_qemu_numa_node=1
VM_20_qemu_mask=0x4000000
VM_20_qemu_mask=21
VM_20_qemu_numa_node=1
VM_21_qemu_mask=0x8000000
VM_21_qemu_mask=22
VM_21_qemu_numa_node=1
VM_22_qemu_mask=0x10000000
VM_22_qemu_mask=23
VM_22_qemu_numa_node=1
VM_23_qemu_mask=0x20000000
VM_23_qemu_mask=24
VM_23_qemu_numa_node=1

View File

@ -1,14 +1,14 @@
vhost_0_reactor_mask=0x1
vhost_0_reactor_mask=["0"]
vhost_0_master_core=0
vhost_1_reactor_mask=0x1
vhost_1_reactor_mask=["0"]
vhost_1_master_core=0
VM_0_qemu_mask=0x1
VM_0_qemu_mask=1
VM_0_qemu_numa_node=0
VM_1_qemu_mask=0x1
VM_1_qemu_mask=1
VM_1_qemu_numa_node=0
VM_2_qemu_mask=0x1
VM_2_qemu_mask=1
VM_2_qemu_numa_node=0