test/sma: limit number of vhost-blk devices to 2
We *really* don't need to fill the whole bus with virtio-blk controllers, the intention is just to verify that they can be created on two different buses. So, instead of looping through 33 devices, specify two addresses that will translate to bus 0 and bus 1. This significantly reduces the amount of necessary resources needed for this test. Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com> Change-Id: I6d60bd0fa840596d2231f50fc10ccde6b47ac60e Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17032 Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
1be4e82d15
commit
dc4cb8bf83
@ -47,6 +47,8 @@ function delete_device() {
|
|||||||
trap "cleanup; exit 1" SIGINT SIGTERM EXIT
|
trap "cleanup; exit 1" SIGINT SIGTERM EXIT
|
||||||
|
|
||||||
vm_no=0
|
vm_no=0
|
||||||
|
bus_size=32
|
||||||
|
|
||||||
timing_enter setup_vm
|
timing_enter setup_vm
|
||||||
vm_setup \
|
vm_setup \
|
||||||
--force=$vm_no \
|
--force=$vm_no \
|
||||||
@ -79,9 +81,9 @@ $rootdir/scripts/sma.py -c <(
|
|||||||
params:
|
params:
|
||||||
buses:
|
buses:
|
||||||
- name: 'pci.spdk.0'
|
- name: 'pci.spdk.0'
|
||||||
count: 32
|
count: $bus_size
|
||||||
- name: 'pci.spdk.1'
|
- name: 'pci.spdk.1'
|
||||||
count: 32
|
count: $bus_size
|
||||||
qmp_addr: 127.0.0.1
|
qmp_addr: 127.0.0.1
|
||||||
qmp_port: 9090
|
qmp_port: 9090
|
||||||
crypto:
|
crypto:
|
||||||
@ -145,24 +147,19 @@ delete_device "$devid1"
|
|||||||
# At the end check if vhost devices are gone
|
# At the end check if vhost devices are gone
|
||||||
[[ $(vm_exec $vm_no "lsblk | grep -E \"^vd.\" | wc -l") -eq 0 ]]
|
[[ $(vm_exec $vm_no "lsblk | grep -E \"^vd.\" | wc -l") -eq 0 ]]
|
||||||
|
|
||||||
# Create 31 bdevs, two already exist
|
|
||||||
for ((i = 2; i < 33; i++)); do
|
|
||||||
rpc_cmd bdev_null_create null$i 100 4096
|
|
||||||
done
|
|
||||||
|
|
||||||
devids=()
|
devids=()
|
||||||
|
|
||||||
# Now try to add 33 devices, max for one bus + one device on the next bus
|
# Create two devices, one on each bus
|
||||||
for ((i = 0; i < 33; i++)); do
|
uuid=$(rpc_cmd bdev_get_bdevs -b null0 | jq -r '.[].uuid')
|
||||||
uuid=$(rpc_cmd bdev_get_bdevs -b null$i | jq -r '.[].uuid')
|
devids[0]=$(create_device 0 $uuid | jq -r '.handle')
|
||||||
devids[i]=$(create_device $i $uuid | jq -r '.handle')
|
uuid=$(rpc_cmd bdev_get_bdevs -b null1 | jq -r '.[].uuid')
|
||||||
done
|
devids[1]=$(create_device $bus_size $uuid | jq -r '.handle')
|
||||||
|
|
||||||
[[ $(vm_exec $vm_no "lsblk | grep -E \"^vd.\" | wc -l") -eq 33 ]]
|
[[ $(vm_exec $vm_no "lsblk | grep -E \"^vd.\" | wc -l") -eq 2 ]]
|
||||||
|
|
||||||
# Cleanup at the end
|
# Cleanup at the end
|
||||||
for ((i = 0; i < 33; i++)); do
|
for id in "${devids[@]}"; do
|
||||||
delete_device ${devids[$i]}
|
delete_device "$id"
|
||||||
done
|
done
|
||||||
|
|
||||||
# And back to none
|
# And back to none
|
||||||
@ -170,7 +167,7 @@ done
|
|||||||
|
|
||||||
key0=1234567890abcdef1234567890abcdef
|
key0=1234567890abcdef1234567890abcdef
|
||||||
rpc_cmd bdev_malloc_create -b malloc0 32 4096
|
rpc_cmd bdev_malloc_create -b malloc0 32 4096
|
||||||
uuidc=$(rpc_cmd bdev_get_bdevs -b malloc0 | jq -r '.[].uuid')
|
uuid=$(rpc_cmd bdev_get_bdevs -b malloc0 | jq -r '.[].uuid')
|
||||||
|
|
||||||
# Try to create controller with bdev crypto
|
# Try to create controller with bdev crypto
|
||||||
devid0=$(
|
devid0=$(
|
||||||
@ -183,7 +180,7 @@ devid0=$(
|
|||||||
"virtual_id": "0"
|
"virtual_id": "0"
|
||||||
},
|
},
|
||||||
"volume": {
|
"volume": {
|
||||||
"volume_id": "$(uuid2base64 $uuidc)",
|
"volume_id": "$(uuid2base64 $uuid)",
|
||||||
"crypto": {
|
"crypto": {
|
||||||
"cipher": "$(get_cipher AES_CBC)",
|
"cipher": "$(get_cipher AES_CBC)",
|
||||||
"key": "$(format_key $key0)"
|
"key": "$(format_key $key0)"
|
||||||
@ -210,6 +207,7 @@ delete_device $devid0
|
|||||||
|
|
||||||
# Test qos
|
# Test qos
|
||||||
device_vhost=2
|
device_vhost=2
|
||||||
|
uuid=$(rpc_cmd bdev_get_bdevs -b null0 | jq -r '.[].uuid')
|
||||||
device=$(create_device 0 $uuid | jq -r '.handle')
|
device=$(create_device 0 $uuid | jq -r '.handle')
|
||||||
|
|
||||||
# First check the capabilities
|
# First check the capabilities
|
||||||
@ -251,7 +249,7 @@ diff <(get_qos_caps $device_vhost | jq --sort-keys) <(
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Make sure that limits were changed
|
# Make sure that limits were changed
|
||||||
diff <(rpc_cmd bdev_get_bdevs -b null32 | jq --sort-keys '.[].assigned_rate_limits') <(
|
diff <(rpc_cmd bdev_get_bdevs -b "$uuid" | jq --sort-keys '.[].assigned_rate_limits') <(
|
||||||
jq --sort-keys <<- EOF
|
jq --sort-keys <<- EOF
|
||||||
{
|
{
|
||||||
"rw_ios_per_sec": 3000,
|
"rw_ios_per_sec": 3000,
|
||||||
@ -282,7 +280,7 @@ diff <(rpc_cmd bdev_get_bdevs -b null32 | jq --sort-keys '.[].assigned_rate_limi
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Make sure that limits were changed even if volume id is not set
|
# Make sure that limits were changed even if volume id is not set
|
||||||
diff <(rpc_cmd bdev_get_bdevs -b null32 | jq --sort-keys '.[].assigned_rate_limits') <(
|
diff <(rpc_cmd bdev_get_bdevs -b "$uuid" | jq --sort-keys '.[].assigned_rate_limits') <(
|
||||||
jq --sort-keys <<- EOF
|
jq --sort-keys <<- EOF
|
||||||
{
|
{
|
||||||
"rw_ios_per_sec": 4000,
|
"rw_ios_per_sec": 4000,
|
||||||
@ -332,7 +330,7 @@ NOT "$rootdir/scripts/sma-client.py" <<- EOF
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Values remain unchanged
|
# Values remain unchanged
|
||||||
diff <(rpc_cmd bdev_get_bdevs -b null32 | jq --sort-keys '.[].assigned_rate_limits') <(
|
diff <(rpc_cmd bdev_get_bdevs -b "$uuid" | jq --sort-keys '.[].assigned_rate_limits') <(
|
||||||
jq --sort-keys <<- EOF
|
jq --sort-keys <<- EOF
|
||||||
{
|
{
|
||||||
"rw_ios_per_sec": 4000,
|
"rw_ios_per_sec": 4000,
|
||||||
|
Loading…
Reference in New Issue
Block a user