nvme testsuite runtime optimization
Subsystems (2)
v2 cover nvme testsuite runtime optimization
Refactored v1 into more smaller bits and fixed a bunch of bugs alongside. For example the fio jobs size for rand rw used --jobs=$(nproc) which needs to fit with the test device size.
The loop transport runs a few more test but the largest contributer why it runs so much longer are the iteratons in 002. So I made them also configurable.
nvme_num_iter=100 nvme_img_size=350M (new defaults)
loop
real 4m3.524s user 0m7.931s sys 1m35.871s
rdma
real 4m20.559s user 0m8.895s sys 1m5.714s
tcp
real 3m55.292s user 0m8.654s sys 1m15.314s
fc
real 3m18.977s user 0m8.868s sys 0m58.655s
nvme_num_iter=1000 nvme_img_size=1G (previous/ defaults)
loop
real 8m22.109s user 0m27.582s sys 3m0.484s
rdma
real 9m1.784s user 0m14.274s sys 2m5.479s
tcp
real 8m28.443s user 0m13.952s sys 2m55.544s
fc
real 6m24.426s user 0m13.944s sys 2m2.489s
The fc tests are bit faster because some of them are failing.
changes:
v2:
- made image size configurable via nvme_img_size env
- make number of iteration configurable via nvme_num_iter
- do not hard code test values
- calculate job size
- use runtime for fio background jobs
v1:
- initial version
- https://lore.kernel.org/linux-nvme/[email protected]/
Daniel Wagner (9):
nvme-rc: Auto convert test device size info
nvme: Do not hard code device size for dd test
common-xfs: Make size argument optional for _xfs_run_fio_verify_io
nvme: Use runtime fio background jobs
nvme: Make test image size configurable
nvme-rc: Add minimal test image size requirement
nvme-rc: Calculate IO size for fio jobs
nvme-rc: Move discovery generation counter code to rc
nvme: Make the number iterations configurable
common/rc | 30 +- common/xfs | 6 + tests/nvme/002 | 6 +- tests/nvme/002.out | 3004 -------------------------------------------- tests/nvme/004 | 2 +- tests/nvme/005 | 2 +- tests/nvme/006 | 2 +- tests/nvme/007 | 2 +- tests/nvme/008 | 2 +- tests/nvme/009 | 2 +- tests/nvme/010 | 6 +- tests/nvme/011 | 6 +- tests/nvme/012 | 5 +- tests/nvme/013 | 5 +- tests/nvme/014 | 12 +- tests/nvme/015 | 12 +- tests/nvme/016 | 2 +- tests/nvme/017 | 4 +- tests/nvme/018 | 2 +- tests/nvme/019 | 2 +- tests/nvme/020 | 2 +- tests/nvme/021 | 2 +- tests/nvme/022 | 2 +- tests/nvme/023 | 2 +- tests/nvme/024 | 2 +- tests/nvme/025 | 2 +- tests/nvme/026 | 2 +- tests/nvme/027 | 2 +- tests/nvme/028 | 2 +- tests/nvme/029 | 2 +- tests/nvme/030 | 22 +- tests/nvme/031 | 2 +- tests/nvme/032 | 6 +- tests/nvme/034 | 4 +- tests/nvme/035 | 4 +- tests/nvme/040 | 9 +- tests/nvme/041 | 2 +- tests/nvme/042 | 2 +- tests/nvme/043 | 2 +- tests/nvme/044 | 2 +- tests/nvme/045 | 6 +- tests/nvme/047 | 8 +- tests/nvme/048 | 2 +- tests/nvme/rc | 50 + 44 files changed, 176 insertions(+), 3079 deletions(-)
Signature · 1 line
2.40.0
PATCH v2 1/9 nvme-rc: Auto convert test device size info
Introduce a convert_to_mb() helper which converts the size argument to MBytes and use in test device require function. This makes it possible to use user input strings in future.
--- common/rc | 30 +++++++++++++++++++++++++++--- tests/nvme/035 | 2 +- 2 files changed, 28 insertions(+), 4 deletions(-)
common/rc +27 -3
@@ -324,9 +324,12 @@ _get_pci_parent_from_blkdev() { tail -2 | head -1 } -_require_test_dev_size_mb() { - local require_sz_mb=$1 - local test_dev_sz_mb=$(($(blockdev --getsize64 "$TEST_DEV")/1024/1024)) +_require_test_dev_size() { + local require_sz_mb + local test_dev_sz_mb + + require_sz_mb="$(convert_to_mb "$1")" + test_dev_sz_mb="$(($(blockdev --getsize64 "$TEST_DEV")/1024/1024))" if (( "$test_dev_sz_mb" < "$require_sz_mb" )); then SKIP_REASONS+=("${TEST_DEV} required at least ${require_sz_mb}m")
@@ -422,3 +425,24 @@ _have_writeable_kmsg() { _run_user() { su "$NORMAL_USER" -c "$1" } + +convert_to_mb() +{ + local str=$1 + local res + + res=$(echo "${str}" | sed -n 's/^\([0-9]\+\)$/\1/p') + if [[ -n "${res}" ]]; then + echo "$((res / 1024 / 1024))" + fi + + res=$(echo "${str}" | sed -n 's/^\([0-9]\+\)[mM]$/\1/p') + if [[ -n "${res}" ]]; then + echo "$((res))" + fi + + res=$(echo "${str}" | sed -n 's/^\([0-9]\+\)[gG]$/\1/p') + if [[ -n "${res}" ]]; then + echo "$((res * 1024))" + fi +}
tests/nvme/035 +1 -1
@@ -17,7 +17,7 @@ requires() { } device_requires() { - _require_test_dev_size_mb 1024 + _require_test_dev_size 1024m } test_device() {
Signature · 1 line
2.40.0
PATCH v2 2/9 nvme: Do not hard code device size for dd test
In reply to Daniel WagnerRead the block device sizes instead hard coding them.
--- tests/nvme/014 | 10 +++++++++- tests/nvme/015 | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-)
tests/nvme/014 +9 -1
@@ -23,6 +23,9 @@ test() { local port local nvmedev local loop_dev + local size + local bs + local count local file_path="$TMPDIR/img" local subsys_name="blktests-subsystem-1"
@@ -41,7 +44,12 @@ test() { cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" - dd if=/dev/urandom of="/dev/${nvmedev}n1" count=128000 bs=4k status=none + size="$(blockdev --getsize64 "/dev/${nvmedev}n1")" + bs="$(blockdev --getbsz "/dev/${nvmedev}n1")" + count=$((size / bs - 1)) + + dd if=/dev/urandom of="/dev/${nvmedev}n1" \ + count="${count}" bs="${bs}" status=none nvme flush "/dev/${nvmedev}" -n 1
tests/nvme/015 +9 -1
@@ -22,6 +22,9 @@ test() { local port local nvmedev + local size + local bs + local count local file_path="$TMPDIR/img" local subsys_name="blktests-subsystem-1"
@@ -38,7 +41,12 @@ test() { cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" - dd if=/dev/urandom of="/dev/${nvmedev}n1" count=128000 bs=4k status=none + size="$(blockdev --getsize64 "/dev/${nvmedev}n1")" + bs="$(blockdev --getbsz "/dev/${nvmedev}n1")" + count=$((size / bs - 1)) + + dd if=/dev/urandom of="/dev/${nvmedev}n1" \ + count="${count}" bs="${bs}" status=none nvme flush "/dev/${nvmedev}n1" -n 1
Signature · 1 line
2.40.0
PATCH v2 2/4 nvme: Make test image size configurable
In reply to Daniel WagnerThe reduce the overall runtime of the testsuite by making the default size of the test image small. For verification jobs, the default can be overwriten via the newly introduced nvme_img_size environment variable.
--- tests/nvme/004 | 2 +- tests/nvme/005 | 2 +- tests/nvme/006 | 2 +- tests/nvme/007 | 2 +- tests/nvme/008 | 2 +- tests/nvme/009 | 2 +- tests/nvme/010 | 4 ++-- tests/nvme/011 | 4 ++-- tests/nvme/012 | 4 ++-- tests/nvme/013 | 4 ++-- tests/nvme/014 | 10 ++++++++-- tests/nvme/015 | 10 ++++++++-- tests/nvme/017 | 2 +- tests/nvme/018 | 2 +- tests/nvme/019 | 2 +- tests/nvme/020 | 2 +- tests/nvme/021 | 2 +- tests/nvme/022 | 2 +- tests/nvme/023 | 2 +- tests/nvme/024 | 2 +- tests/nvme/025 | 2 +- tests/nvme/026 | 2 +- tests/nvme/027 | 2 +- tests/nvme/028 | 2 +- tests/nvme/029 | 3 ++- tests/nvme/031 | 2 +- tests/nvme/032 | 4 ++-- tests/nvme/034 | 2 +- tests/nvme/035 | 4 ++-- tests/nvme/040 | 4 ++-- tests/nvme/041 | 2 +- tests/nvme/042 | 2 +- tests/nvme/043 | 2 +- tests/nvme/044 | 2 +- tests/nvme/045 | 2 +- tests/nvme/047 | 2 +- tests/nvme/048 | 2 +- tests/nvme/rc | 1 + 38 files changed, 60 insertions(+), 46 deletions(-)
tests/nvme/004 +1 -1
@@ -25,7 +25,7 @@ test() { local port port="$(_create_nvmet_port "${nvme_trtype}")" - truncate -s 1G "$TMPDIR/img" + truncate -s "${nvme_img_size}" "$TMPDIR/img" local loop_dev loop_dev="$(losetup -f --show "$TMPDIR/img")"
tests/nvme/005 +1 -1
@@ -24,7 +24,7 @@ test() { local port port="$(_create_nvmet_port "${nvme_trtype}")" - truncate -s 1G "$TMPDIR/img" + truncate -s "${nvme_img_size}" "$TMPDIR/img" local loop_dev loop_dev="$(losetup -f --show "$TMPDIR/img")"
tests/nvme/006 +1 -1
@@ -24,7 +24,7 @@ test() { _setup_nvmet - truncate -s 1G "$TMPDIR/img" + truncate -s "${nvme_img_size}" "$TMPDIR/img" loop_dev="$(losetup -f --show "$TMPDIR/img")"
tests/nvme/007 +1 -1
@@ -25,7 +25,7 @@ test() { file_path="${TMPDIR}/img" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" \ "91fdba0d-f87b-4c25-b80f-db7be1418b9e"
tests/nvme/008 +1 -1
@@ -26,7 +26,7 @@ test() { local file_path="$TMPDIR/img" local subsys_name="blktests-subsystem-1" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" loop_dev="$(losetup -f --show "${file_path}")"
tests/nvme/009 +1 -1
@@ -24,7 +24,7 @@ test() { local file_path="$TMPDIR/img" local subsys_name="blktests-subsystem-1" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" \ "91fdba0d-f87b-4c25-b80f-db7be1418b9e"
tests/nvme/010 +2 -2
@@ -26,7 +26,7 @@ test() { local file_path="${TMPDIR}/img" local subsys_name="blktests-subsystem-1" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" loop_dev="$(losetup -f --show "${file_path}")"
@@ -41,7 +41,7 @@ test() { cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" - _run_fio_verify_io --size=950m --filename="/dev/${nvmedev}n1" + _run_fio_verify_io --filename="/dev/${nvmedev}n1" _nvme_disconnect_subsys "${subsys_name}"
tests/nvme/011 +2 -2
@@ -26,7 +26,7 @@ test() { local file_path="${TMPDIR}/img" local subsys_name="blktests-subsystem-1" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" \ "91fdba0d-f87b-4c25-b80f-db7be1418b9e"
@@ -39,7 +39,7 @@ test() { cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" - _run_fio_verify_io --size=950m --filename="/dev/${nvmedev}n1" + _run_fio_verify_io --filename="/dev/${nvmedev}n1" _nvme_disconnect_subsys "${subsys_name}"
tests/nvme/012 +2 -2
@@ -29,7 +29,7 @@ test() { local file_path="${TMPDIR}/img" local subsys_name="blktests-subsystem-1" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" loop_dev="$(losetup -f --show "${file_path}")"
@@ -44,7 +44,7 @@ test() { cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" - _xfs_run_fio_verify_io "/dev/${nvmedev}n1" "900m" + _xfs_run_fio_verify_io "/dev/${nvmedev}n1" "${nvme_img_size}" _nvme_disconnect_subsys "${subsys_name}"
tests/nvme/013 +2 -2
@@ -28,7 +28,7 @@ test() { local subsys_name="blktests-subsystem-1" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" \ "91fdba0d-f87b-4c25-b80f-db7be1418b9e"
@@ -41,7 +41,7 @@ test() { cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" - _xfs_run_fio_verify_io "/dev/${nvmedev}n1" "900m" + _xfs_run_fio_verify_io "/dev/${nvmedev}n1" "${nvme_img_size}" _nvme_disconnect_subsys "${subsys_name}"
tests/nvme/014 +8 -2
@@ -26,7 +26,7 @@ test() { local file_path="$TMPDIR/img" local subsys_name="blktests-subsystem-1" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" loop_dev="$(losetup -f --show "${file_path}")"
@@ -41,7 +41,13 @@ test() { cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" - dd if=/dev/urandom of="/dev/${nvmedev}n1" count=128000 bs=4k status=none + local sectors + local bs + sectors="$(blockdev --getss "/dev/${nvmedev}n1")" + bs="$(blockdev --getbsz "/dev/${nvmedev}n1")" + + dd if=/dev/urandom of="/dev/${nvmedev}n1" \ + count="${sectors}" bs="${bs}" status=none nvme flush "/dev/${nvmedev}" -n 1
tests/nvme/015 +8 -2
@@ -25,7 +25,7 @@ test() { local file_path="$TMPDIR/img" local subsys_name="blktests-subsystem-1" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" \ "91fdba0d-f87b-4c25-b80f-db7be1418b9e"
@@ -38,7 +38,13 @@ test() { cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" - dd if=/dev/urandom of="/dev/${nvmedev}n1" count=128000 bs=4k status=none + local sectors + local bs + sectors="$(blockdev --getss "/dev/${nvmedev}n1")" + bs="$(blockdev --getbsz "/dev/${nvmedev}n1")" + + dd if=/dev/urandom of="/dev/${nvmedev}n1" \ + count="${sectors}" bs="${bs}" status=none nvme flush "/dev/${nvmedev}n1" -n 1
tests/nvme/017 +1 -1
@@ -25,7 +25,7 @@ test() { file_path="${TMPDIR}/img" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" \ "91fdba0d-f87b-4c25-b80f-db7be1418b9e"
tests/nvme/018 +1 -1
@@ -26,7 +26,7 @@ test() { local file_path="$TMPDIR/img" local subsys_name="blktests-subsystem-1" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" \ "91fdba0d-f87b-4c25-b80f-db7be1418b9e"
tests/nvme/019 +1 -1
@@ -28,7 +28,7 @@ test() { local nblk_range="10,10,10,10,10,10,10,10,10,10" local sblk_range="100,200,300,400,500,600,700,800,900,1000" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" loop_dev="$(losetup -f --show "${file_path}")"
tests/nvme/020 +1 -1
@@ -26,7 +26,7 @@ test() { local nblk_range="10,10,10,10,10,10,10,10,10,10" local sblk_range="100,200,300,400,500,600,700,800,900,1000" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" \ "91fdba0d-f87b-4c25-b80f-db7be1418b9e"
tests/nvme/021 +1 -1
@@ -25,7 +25,7 @@ test() { local file_path="$TMPDIR/img" local subsys_name="blktests-subsystem-1" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" \ "91fdba0d-f87b-4c25-b80f-db7be1418b9e"
tests/nvme/022 +1 -1
@@ -25,7 +25,7 @@ test() { local file_path="$TMPDIR/img" local subsys_name="blktests-subsystem-1" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" \ "91fdba0d-f87b-4c25-b80f-db7be1418b9e"
tests/nvme/023 +1 -1
@@ -26,7 +26,7 @@ test() { local file_path="$TMPDIR/img" local subsys_name="blktests-subsystem-1" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" loop_dev="$(losetup -f --show "${file_path}")"
tests/nvme/024 +1 -1
@@ -25,7 +25,7 @@ test() { local file_path="$TMPDIR/img" local subsys_name="blktests-subsystem-1" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" \ "91fdba0d-f87b-4c25-b80f-db7be1418b9e"
tests/nvme/025 +1 -1
@@ -25,7 +25,7 @@ test() { local file_path="$TMPDIR/img" local subsys_name="blktests-subsystem-1" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" \ "91fdba0d-f87b-4c25-b80f-db7be1418b9e"
tests/nvme/026 +1 -1
@@ -25,7 +25,7 @@ test() { local file_path="$TMPDIR/img" local subsys_name="blktests-subsystem-1" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" \ "91fdba0d-f87b-4c25-b80f-db7be1418b9e"
tests/nvme/027 +1 -1
@@ -25,7 +25,7 @@ test() { local file_path="$TMPDIR/img" local subsys_name="blktests-subsystem-1" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" \ "91fdba0d-f87b-4c25-b80f-db7be1418b9e"
tests/nvme/028 +1 -1
@@ -25,7 +25,7 @@ test() { local file_path="$TMPDIR/img" local subsys_name="blktests-subsystem-1" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" \ "91fdba0d-f87b-4c25-b80f-db7be1418b9e"
tests/nvme/029 +2 -1
@@ -14,6 +14,7 @@ requires() { _nvme_requires _have_loop _require_nvme_trtype_is_fabrics + _require_test_dev_size 1M } test_user_io()
@@ -59,7 +60,7 @@ test() { local file_path="$TMPDIR/img" local subsys_name="blktests-subsystem-1" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" loop_dev="$(losetup -f --show "${file_path}")"
tests/nvme/031 +1 -1
@@ -33,7 +33,7 @@ test() { _setup_nvmet - truncate -s 1G "$TMPDIR/img" + truncate -s "${nvme_img_size}" "$TMPDIR/img" loop_dev="$(losetup -f --show "$TMPDIR/img")"
tests/nvme/032 +2 -2
@@ -38,8 +38,8 @@ test_device() { sysfs="/sys/bus/pci/devices/${pdev}" # start fio job - _run_fio_rand_io --filename="$TEST_DEV" --size=1g \ - --group_reporting &> /dev/null & + _run_fio_rand_io --filename="$TEST_DEV" --size=256M \ + --group_reporting --time_based --runtime=1m > /dev/null & sleep 5
tests/nvme/034 +1 -1
@@ -26,7 +26,7 @@ test_device() { port=$(_nvmet_passthru_target_setup "${subsys}") nsdev=$(_nvmet_passthru_target_connect "${nvme_trtype}" "${subsys}") - _run_fio_verify_io --size=950m --filename="${nsdev}" + _run_fio_verify_io --size="${nvme_img_size}" --filename="${nsdev}" _nvme_disconnect_subsys "${subsys}" _nvmet_passthru_target_cleanup "${port}" "${subsys}"
tests/nvme/035 +2 -2
@@ -17,7 +17,7 @@ requires() { } device_requires() { - _require_test_dev_size 1024m + _require_test_dev_size "${nvme_img_size}" } test_device() {
@@ -32,7 +32,7 @@ test_device() { port=$(_nvmet_passthru_target_setup "${subsys}") nsdev=$(_nvmet_passthru_target_connect "${nvme_trtype}" "${subsys}") - _xfs_run_fio_verify_io "${nsdev}" "900m" + _xfs_run_fio_verify_io "${nsdev}" "${nvme_img_size}" _nvme_disconnect_subsys "${subsys}" _nvmet_passthru_target_cleanup "${port}" "${subsys}"
tests/nvme/040 +2 -2
@@ -25,7 +25,7 @@ test() { echo "Running ${TEST_NAME}" _setup_nvmet - truncate -s 1G "$TMPDIR/img" + truncate -s ${nvme_img_size} "$TMPDIR/img" loop_dev="$(losetup -f --show "$TMPDIR/img")" port="$(_create_nvmet_port "${nvme_trtype}")"
@@ -37,7 +37,7 @@ test() { # start fio job echo "starting background fio" - _run_fio_rand_io --filename="/dev/${nvmedev}n1" --size=1g \ + _run_fio_rand_io --filename="/dev/${nvmedev}n1" --size="${nvme_img_size}" \ --group_reporting --ramp_time=5 &> /dev/null & sleep 5
tests/nvme/041 +1 -1
@@ -44,7 +44,7 @@ test() { _setup_nvmet - truncate -s 512M "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" \ "b92842df-a394-44b1-84a4-92ae7d112861"
tests/nvme/042 +1 -1
@@ -41,7 +41,7 @@ test() { _setup_nvmet - truncate -s 512M "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" port="$(_create_nvmet_port "${nvme_trtype}")"
tests/nvme/043 +1 -1
@@ -42,7 +42,7 @@ test() { _setup_nvmet - truncate -s 512M "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" port="$(_create_nvmet_port "${nvme_trtype}")"
tests/nvme/044 +1 -1
@@ -53,7 +53,7 @@ test() { _setup_nvmet - truncate -s 512M "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" port="$(_create_nvmet_port "${nvme_trtype}")"
tests/nvme/045 +1 -1
@@ -55,7 +55,7 @@ test() { _setup_nvmet - truncate -s 512M "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" port="$(_create_nvmet_port "${nvme_trtype}")"
tests/nvme/047 +1 -1
@@ -28,7 +28,7 @@ test() { local file_path="$TMPDIR/img" local subsys_name="blktests-subsystem-1" - truncate -s 512M "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" loop_dev="$(losetup -f --show "${file_path}")"
tests/nvme/048 +1 -1
@@ -84,7 +84,7 @@ test() { fi hostnqn="nqn.2014-08.org.nvmexpress:uuid:${hostid}" - truncate -s 512M "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" \ "b92842df-a394-44b1-84a4-92ae7d112861"
tests/nvme/rc +1 -0
@@ -17,6 +17,7 @@ def_local_wwpn="0x20001100aa000002" def_hostnqn="$(cat /etc/nvme/hostnqn 2> /dev/null)" def_hostid="$(cat /etc/nvme/hostid 2> /dev/null)" nvme_trtype=${nvme_trtype:-"loop"} +nvme_img_size=${nvme_img_size:-"64M"} _nvme_requires() { _have_program nvme
Signature · 1 line
2.40.0
PATCH v2 3/9 common-xfs: Make size argument optional for _xfs_run_fio_verify_io
In reply to Daniel WagnerMake the size argument optional by reading the filesystem info. The caller doesn't have to guess (or calculate) how big the max IO size. The log data structure of XFS is reducing the capacity.
--- common/xfs | 6 ++++++ tests/nvme/012 | 2 +- tests/nvme/013 | 2 +- tests/nvme/035 | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-)
common/xfs +6 -0
@@ -27,6 +27,12 @@ _xfs_run_fio_verify_io() { _xfs_mkfs_and_mount "${bdev}" "${mount_dir}" >> "${FULL}" 2>&1 + if [[ -z "${sz}" ]]; then + local avail + avail="$(df --output=avail "${mount_dir}" | awk 'NR==2 {print $1}')" + sz="$(printf "%d" $((avail / 1024 - 1 )))m" + fi + _run_fio_verify_io --size="$sz" --directory="${mount_dir}/" umount "${mount_dir}" >> "${FULL}" 2>&1
tests/nvme/012 +1 -1
@@ -44,7 +44,7 @@ test() { cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" - _xfs_run_fio_verify_io "/dev/${nvmedev}n1" "900m" + _xfs_run_fio_verify_io "/dev/${nvmedev}n1" _nvme_disconnect_subsys "${subsys_name}"
tests/nvme/013 +1 -1
@@ -41,7 +41,7 @@ test() { cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" - _xfs_run_fio_verify_io "/dev/${nvmedev}n1" "900m" + _xfs_run_fio_verify_io "/dev/${nvmedev}n1" _nvme_disconnect_subsys "${subsys_name}"
tests/nvme/035 +1 -1
@@ -32,7 +32,7 @@ test_device() { port=$(_nvmet_passthru_target_setup "${subsys}") nsdev=$(_nvmet_passthru_target_connect "${nvme_trtype}" "${subsys}") - _xfs_run_fio_verify_io "${nsdev}" "900m" + _xfs_run_fio_verify_io "${nsdev}" _nvme_disconnect_subsys "${subsys}" _nvmet_passthru_target_cleanup "${port}" "${subsys}"
Signature · 1 line
2.40.0
PATCH v2 3/4 nvme-rc: Move discovery generation counter code to rc
In reply to Daniel WagnerMove the discovery generation counter code to rc so that we can reuse it in 002.
--- tests/nvme/002 | 4 +- tests/nvme/002.out | 3004 -------------------------------------------- tests/nvme/030 | 22 +- tests/nvme/rc | 13 + 4 files changed, 20 insertions(+), 3023 deletions(-)
tests/nvme/002 +3 -1
@@ -27,12 +27,14 @@ test() { local loop_dev loop_dev="$(losetup -f)" + local genctr=1 + for ((i = 0; i < iterations; i++)); do _create_nvmet_subsystem "blktests-subsystem-$i" "${loop_dev}" _add_nvmet_subsys_to_port "${port}" "blktests-subsystem-$i" done - _nvme_discover "${nvme_trtype}" | _filter_discovery + genctr=$(_check_genctr "${genctr}" "adding a subsystem to a port") for ((i = iterations - 1; i >= 0; i--)); do _remove_nvmet_subsystem_from_port "${port}" "blktests-subsystem-$i"
tests/nvme/002.out +0 -3004
2,985 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.40.0
Part of the diff is not shown here. View the raw message.
PATCH v2 4/9 nvme: Use runtime fio background jobs
In reply to Daniel WagnerThe fio jobs are supposed to run long in background during the test. Instead relying on a job size use explicit runtime for this.
--- tests/nvme/032 | 2 +- tests/nvme/040 | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
tests/nvme/032 +1 -1
@@ -39,7 +39,7 @@ test_device() { # start fio job _run_fio_rand_io --filename="$TEST_DEV" --size=1g \ - --group_reporting &> /dev/null & + --group_reporting --time_based --runtime=1m &> /dev/null & sleep 5
tests/nvme/040 +2 -1
@@ -38,7 +38,8 @@ test() { # start fio job echo "starting background fio" _run_fio_rand_io --filename="/dev/${nvmedev}n1" --size=1g \ - --group_reporting --ramp_time=5 &> /dev/null & + --group_reporting --ramp_time=5 \ + --time_based --runtime=1m &> /dev/null & sleep 5 # do reset/remove operation
Signature · 1 line
2.40.0
PATCH v2 5/9 nvme: Make test image size configurable
In reply to Daniel WagnerThe reduce the overall runtime of the testsuite by making the default size of the test image small. For verification jobs, the default can be overwriten via the newly introduced nvme_img_size environment variable.
The default size of 350M is the minimum requirement of nvme/012 and nvme/013. These tests rely on an xfs filesystem which requires this minimum size.
--- tests/nvme/004 | 2 +- tests/nvme/005 | 2 +- tests/nvme/006 | 2 +- tests/nvme/007 | 2 +- tests/nvme/008 | 2 +- tests/nvme/009 | 2 +- tests/nvme/010 | 5 +++-- tests/nvme/011 | 5 +++-- tests/nvme/012 | 2 +- tests/nvme/013 | 2 +- tests/nvme/014 | 2 +- tests/nvme/015 | 2 +- tests/nvme/017 | 2 +- tests/nvme/018 | 2 +- tests/nvme/019 | 2 +- tests/nvme/020 | 2 +- tests/nvme/021 | 2 +- tests/nvme/022 | 2 +- tests/nvme/023 | 2 +- tests/nvme/024 | 2 +- tests/nvme/025 | 2 +- tests/nvme/026 | 2 +- tests/nvme/027 | 2 +- tests/nvme/028 | 2 +- tests/nvme/029 | 3 ++- tests/nvme/031 | 2 +- tests/nvme/032 | 2 +- tests/nvme/034 | 2 +- tests/nvme/035 | 2 +- tests/nvme/040 | 4 ++-- tests/nvme/041 | 2 +- tests/nvme/042 | 2 +- tests/nvme/043 | 2 +- tests/nvme/044 | 2 +- tests/nvme/045 | 2 +- tests/nvme/047 | 2 +- tests/nvme/048 | 2 +- tests/nvme/rc | 1 + 38 files changed, 44 insertions(+), 40 deletions(-)
tests/nvme/004 +1 -1
@@ -25,7 +25,7 @@ test() { local port port="$(_create_nvmet_port "${nvme_trtype}")" - truncate -s 1G "$TMPDIR/img" + truncate -s "${nvme_img_size}" "$TMPDIR/img" local loop_dev loop_dev="$(losetup -f --show "$TMPDIR/img")"
tests/nvme/005 +1 -1
@@ -24,7 +24,7 @@ test() { local port port="$(_create_nvmet_port "${nvme_trtype}")" - truncate -s 1G "$TMPDIR/img" + truncate -s "${nvme_img_size}" "$TMPDIR/img" local loop_dev loop_dev="$(losetup -f --show "$TMPDIR/img")"
tests/nvme/006 +1 -1
@@ -24,7 +24,7 @@ test() { _setup_nvmet - truncate -s 1G "$TMPDIR/img" + truncate -s "${nvme_img_size}" "$TMPDIR/img" loop_dev="$(losetup -f --show "$TMPDIR/img")"
tests/nvme/007 +1 -1
@@ -25,7 +25,7 @@ test() { file_path="${TMPDIR}/img" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" \ "91fdba0d-f87b-4c25-b80f-db7be1418b9e"
tests/nvme/008 +1 -1
@@ -26,7 +26,7 @@ test() { local file_path="$TMPDIR/img" local subsys_name="blktests-subsystem-1" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" loop_dev="$(losetup -f --show "${file_path}")"
tests/nvme/009 +1 -1
@@ -24,7 +24,7 @@ test() { local file_path="$TMPDIR/img" local subsys_name="blktests-subsystem-1" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" \ "91fdba0d-f87b-4c25-b80f-db7be1418b9e"
tests/nvme/010 +3 -2
@@ -26,7 +26,7 @@ test() { local file_path="${TMPDIR}/img" local subsys_name="blktests-subsystem-1" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" loop_dev="$(losetup -f --show "${file_path}")"
@@ -41,7 +41,8 @@ test() { cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" - _run_fio_verify_io --size=950m --filename="/dev/${nvmedev}n1" + _run_fio_verify_io --size=${nvme_img_size} \ + --filename="/dev/${nvmedev}n1" _nvme_disconnect_subsys "${subsys_name}"
tests/nvme/011 +3 -2
@@ -26,7 +26,7 @@ test() { local file_path="${TMPDIR}/img" local subsys_name="blktests-subsystem-1" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" \ "91fdba0d-f87b-4c25-b80f-db7be1418b9e"
@@ -39,7 +39,8 @@ test() { cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" - _run_fio_verify_io --size=950m --filename="/dev/${nvmedev}n1" + _run_fio_verify_io --size="${nvme_img_size}" \ + --filename="/dev/${nvmedev}n1" _nvme_disconnect_subsys "${subsys_name}"
tests/nvme/012 +1 -1
@@ -29,7 +29,7 @@ test() { local file_path="${TMPDIR}/img" local subsys_name="blktests-subsystem-1" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" loop_dev="$(losetup -f --show "${file_path}")"
tests/nvme/013 +1 -1
@@ -28,7 +28,7 @@ test() { local subsys_name="blktests-subsystem-1" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" \ "91fdba0d-f87b-4c25-b80f-db7be1418b9e"
tests/nvme/014 +1 -1
@@ -29,7 +29,7 @@ test() { local file_path="$TMPDIR/img" local subsys_name="blktests-subsystem-1" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" loop_dev="$(losetup -f --show "${file_path}")"
tests/nvme/015 +1 -1
@@ -28,7 +28,7 @@ test() { local file_path="$TMPDIR/img" local subsys_name="blktests-subsystem-1" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" \ "91fdba0d-f87b-4c25-b80f-db7be1418b9e"
tests/nvme/017 +1 -1
@@ -25,7 +25,7 @@ test() { file_path="${TMPDIR}/img" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" \ "91fdba0d-f87b-4c25-b80f-db7be1418b9e"
tests/nvme/018 +1 -1
@@ -26,7 +26,7 @@ test() { local file_path="$TMPDIR/img" local subsys_name="blktests-subsystem-1" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" \ "91fdba0d-f87b-4c25-b80f-db7be1418b9e"
tests/nvme/019 +1 -1
@@ -28,7 +28,7 @@ test() { local nblk_range="10,10,10,10,10,10,10,10,10,10" local sblk_range="100,200,300,400,500,600,700,800,900,1000" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" loop_dev="$(losetup -f --show "${file_path}")"
tests/nvme/020 +1 -1
@@ -26,7 +26,7 @@ test() { local nblk_range="10,10,10,10,10,10,10,10,10,10" local sblk_range="100,200,300,400,500,600,700,800,900,1000" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" \ "91fdba0d-f87b-4c25-b80f-db7be1418b9e"
tests/nvme/021 +1 -1
@@ -25,7 +25,7 @@ test() { local file_path="$TMPDIR/img" local subsys_name="blktests-subsystem-1" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" \ "91fdba0d-f87b-4c25-b80f-db7be1418b9e"
tests/nvme/022 +1 -1
@@ -25,7 +25,7 @@ test() { local file_path="$TMPDIR/img" local subsys_name="blktests-subsystem-1" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" \ "91fdba0d-f87b-4c25-b80f-db7be1418b9e"
tests/nvme/023 +1 -1
@@ -26,7 +26,7 @@ test() { local file_path="$TMPDIR/img" local subsys_name="blktests-subsystem-1" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" loop_dev="$(losetup -f --show "${file_path}")"
tests/nvme/024 +1 -1
@@ -25,7 +25,7 @@ test() { local file_path="$TMPDIR/img" local subsys_name="blktests-subsystem-1" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" \ "91fdba0d-f87b-4c25-b80f-db7be1418b9e"
tests/nvme/025 +1 -1
@@ -25,7 +25,7 @@ test() { local file_path="$TMPDIR/img" local subsys_name="blktests-subsystem-1" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" \ "91fdba0d-f87b-4c25-b80f-db7be1418b9e"
tests/nvme/026 +1 -1
@@ -25,7 +25,7 @@ test() { local file_path="$TMPDIR/img" local subsys_name="blktests-subsystem-1" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" \ "91fdba0d-f87b-4c25-b80f-db7be1418b9e"
tests/nvme/027 +1 -1
@@ -25,7 +25,7 @@ test() { local file_path="$TMPDIR/img" local subsys_name="blktests-subsystem-1" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" \ "91fdba0d-f87b-4c25-b80f-db7be1418b9e"
tests/nvme/028 +1 -1
@@ -25,7 +25,7 @@ test() { local file_path="$TMPDIR/img" local subsys_name="blktests-subsystem-1" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" \ "91fdba0d-f87b-4c25-b80f-db7be1418b9e"
tests/nvme/029 +2 -1
@@ -14,6 +14,7 @@ requires() { _nvme_requires _have_loop _require_nvme_trtype_is_fabrics + _require_test_dev_size 1M } test_user_io()
@@ -59,7 +60,7 @@ test() { local file_path="$TMPDIR/img" local subsys_name="blktests-subsystem-1" - truncate -s 1G "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" loop_dev="$(losetup -f --show "${file_path}")"
tests/nvme/031 +1 -1
@@ -33,7 +33,7 @@ test() { _setup_nvmet - truncate -s 1G "$TMPDIR/img" + truncate -s "${nvme_img_size}" "$TMPDIR/img" loop_dev="$(losetup -f --show "$TMPDIR/img")"
tests/nvme/032 +1 -1
@@ -38,7 +38,7 @@ test_device() { sysfs="/sys/bus/pci/devices/${pdev}" # start fio job - _run_fio_rand_io --filename="$TEST_DEV" --size=1g \ + _run_fio_rand_io --filename="$TEST_DEV" --size="${nvme_img_size}" \ --group_reporting --time_based --runtime=1m &> /dev/null & sleep 5
tests/nvme/034 +1 -1
@@ -26,7 +26,7 @@ test_device() { port=$(_nvmet_passthru_target_setup "${subsys}") nsdev=$(_nvmet_passthru_target_connect "${nvme_trtype}" "${subsys}") - _run_fio_verify_io --size=950m --filename="${nsdev}" + _run_fio_verify_io --size="${nvme_img_size}" --filename="${nsdev}" _nvme_disconnect_subsys "${subsys}" _nvmet_passthru_target_cleanup "${port}" "${subsys}"
tests/nvme/035 +1 -1
@@ -17,7 +17,7 @@ requires() { } device_requires() { - _require_test_dev_size 1024m + _require_test_dev_size "${nvme_img_size}" } test_device() {
tests/nvme/040 +2 -2
@@ -25,7 +25,7 @@ test() { echo "Running ${TEST_NAME}" _setup_nvmet - truncate -s 1G "$TMPDIR/img" + truncate -s "${nvme_img_size}" "$TMPDIR/img" loop_dev="$(losetup -f --show "$TMPDIR/img")" port="$(_create_nvmet_port "${nvme_trtype}")"
@@ -37,7 +37,7 @@ test() { # start fio job echo "starting background fio" - _run_fio_rand_io --filename="/dev/${nvmedev}n1" --size=1g \ + _run_fio_rand_io --filename="/dev/${nvmedev}n1" --size="${nvme_img_size}" \ --group_reporting --ramp_time=5 \ --time_based --runtime=1m &> /dev/null & sleep 5
tests/nvme/041 +1 -1
@@ -44,7 +44,7 @@ test() { _setup_nvmet - truncate -s 512M "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" \ "b92842df-a394-44b1-84a4-92ae7d112861"
tests/nvme/042 +1 -1
@@ -41,7 +41,7 @@ test() { _setup_nvmet - truncate -s 512M "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" port="$(_create_nvmet_port "${nvme_trtype}")"
tests/nvme/043 +1 -1
@@ -42,7 +42,7 @@ test() { _setup_nvmet - truncate -s 512M "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" port="$(_create_nvmet_port "${nvme_trtype}")"
tests/nvme/044 +1 -1
@@ -53,7 +53,7 @@ test() { _setup_nvmet - truncate -s 512M "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" port="$(_create_nvmet_port "${nvme_trtype}")"
tests/nvme/045 +1 -1
@@ -55,7 +55,7 @@ test() { _setup_nvmet - truncate -s 512M "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" port="$(_create_nvmet_port "${nvme_trtype}")"
tests/nvme/047 +1 -1
@@ -28,7 +28,7 @@ test() { local file_path="$TMPDIR/img" local subsys_name="blktests-subsystem-1" - truncate -s 512M "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" loop_dev="$(losetup -f --show "${file_path}")"
tests/nvme/048 +1 -1
@@ -84,7 +84,7 @@ test() { fi hostnqn="nqn.2014-08.org.nvmexpress:uuid:${hostid}" - truncate -s 512M "${file_path}" + truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" \ "b92842df-a394-44b1-84a4-92ae7d112861"
tests/nvme/rc +1 -0
@@ -17,6 +17,7 @@ def_local_wwpn="0x20001100aa000002" def_hostnqn="$(cat /etc/nvme/hostnqn 2> /dev/null)" def_hostid="$(cat /etc/nvme/hostid 2> /dev/null)" nvme_trtype=${nvme_trtype:-"loop"} +nvme_img_size=${nvme_img_size:-"350M"} _nvme_requires() { _have_program nvme
Signature · 1 line
2.40.0
PATCH v2 6/9 nvme-rc: Add minimal test image size requirement
In reply to Daniel WagnerSome tests need a minimal test image size to work correctly. Thus add a helper to check the size and update these tests accordingly.
The image minimum is 4M because some of the test have hard coded values. All tests which use the xfs fio verification job have a minimum requirement of 350M impossed by the xfs filesystem.
--- tests/nvme/012 | 1 + tests/nvme/013 | 1 + tests/nvme/029 | 1 - tests/nvme/045 | 2 +- tests/nvme/rc | 15 +++++++++++++++ 5 files changed, 18 insertions(+), 2 deletions(-)
tests/nvme/012 +1 -0
@@ -16,6 +16,7 @@ requires() { _have_fio _have_loop _require_nvme_trtype_is_fabrics + _require_nvme_test_img_size 350m } test() {
tests/nvme/013 +1 -0
@@ -15,6 +15,7 @@ requires() { _have_xfs _have_fio _require_nvme_trtype_is_fabrics + _require_nvme_test_img_size 350m } test() {
tests/nvme/029 +0 -1
@@ -14,7 +14,6 @@ requires() { _nvme_requires _have_loop _require_nvme_trtype_is_fabrics - _require_test_dev_size 1M } test_user_io()
tests/nvme/045 +1 -1
@@ -120,7 +120,7 @@ test() { nvmedev=$(_find_nvme_dev "${subsys_name}") - _run_fio_rand_io --size=8m --filename="/dev/${nvmedev}n1" + _run_fio_rand_io --size=4m --filename="/dev/${nvmedev}n1" _nvme_disconnect_subsys "${subsys_name}"
tests/nvme/rc +15 -0
@@ -21,6 +21,7 @@ nvme_img_size=${nvme_img_size:-"350M"} _nvme_requires() { _have_program nvme + _require_nvme_test_img_size 4m case ${nvme_trtype} in loop) _have_driver nvme-loop
@@ -94,6 +95,20 @@ _require_test_dev_is_nvme() { return 0 } +_require_nvme_test_img_size() { + local require_sz_mb + local nvme_img_size_mb + + require_sz_mb="$(convert_to_mb "$1")" + nvme_img_size_mb="$(convert_to_mb "${nvme_img_size}")" + + if (( "${nvme_img_size_mb}" < "$require_sz_mb" )); then + SKIP_REASONS+=("nvme_img_size must be at least ${require_sz_mb}m") + return 1 + fi + return 0 +} + _require_nvme_trtype() { local trtype for trtype in "$@"; do
Signature · 1 line
2.40.0
PATCH v2 7/9 nvme-rc: Calculate IO size for fio jobs
In reply to Daniel WagnerIntroduce two new function to calculate the IO size for fio jobs.
_nvme_calc_io_size() returns the jobs size for _run_fio_verify_io() function. Reduce the max size of the job by one megabyte to make the test more robust not to run out of space by accident. Note these fio calls run with just one jobs.
_nvme_calc_run_io_size() returns the jobs size for _run_fio_rand_io() function. Again, the jobs size is not maxing out the space and most important it takes the number of jobs into account which are created (number of CPUs).
--- tests/nvme/010 | 5 +++-- tests/nvme/011 | 5 +++-- tests/nvme/032 | 6 ++++-- tests/nvme/034 | 4 +++- tests/nvme/040 | 4 +++- tests/nvme/045 | 4 +++- tests/nvme/047 | 6 ++++-- tests/nvme/rc | 20 ++++++++++++++++++++ 8 files changed, 43 insertions(+), 11 deletions(-)
tests/nvme/010 +3 -2
@@ -25,6 +25,7 @@ test() { local loop_dev local file_path="${TMPDIR}/img" local subsys_name="blktests-subsystem-1" + local io_size truncate -s "${nvme_img_size}" "${file_path}"
@@ -41,8 +42,8 @@ test() { cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" - _run_fio_verify_io --size=${nvme_img_size} \ - --filename="/dev/${nvmedev}n1" + io_size="$(_nvme_calc_io_size "${nvme_img_size}")" + _run_fio_verify_io --size="${io_size}" --filename="/dev/${nvmedev}n1" _nvme_disconnect_subsys "${subsys_name}"
tests/nvme/011 +3 -2
@@ -25,6 +25,7 @@ test() { local file_path local file_path="${TMPDIR}/img" local subsys_name="blktests-subsystem-1" + local io_size truncate -s "${nvme_img_size}" "${file_path}"
@@ -39,8 +40,8 @@ test() { cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" - _run_fio_verify_io --size="${nvme_img_size}" \ - --filename="/dev/${nvmedev}n1" + io_size="$(_nvme_calc_io_size "${nvme_img_size}")" + _run_fio_verify_io --size="${io_size}" --filename="/dev/${nvmedev}n1" _nvme_disconnect_subsys "${subsys_name}"
tests/nvme/032 +4 -2
@@ -33,13 +33,15 @@ test_device() { local sysfs local attr local m + local rand_io_size pdev="$(_get_pci_dev_from_blkdev)" sysfs="/sys/bus/pci/devices/${pdev}" # start fio job - _run_fio_rand_io --filename="$TEST_DEV" --size="${nvme_img_size}" \ - --group_reporting --time_based --runtime=1m &> /dev/null & + rand_io_size="$(_nvme_calc_rand_io_size "${nvme_img_size}")" + _run_fio_rand_io --filename="$TEST_DEV" --size="${rand_io_size}" \ + --group_reporting --time_based --runtime=1m > /dev/null & sleep 5
tests/nvme/034 +3 -1
@@ -19,6 +19,7 @@ test_device() { local ctrldev local nsdev local port + local io_size echo "Running ${TEST_NAME}"
@@ -26,7 +27,8 @@ test_device() { port=$(_nvmet_passthru_target_setup "${subsys}") nsdev=$(_nvmet_passthru_target_connect "${nvme_trtype}" "${subsys}") - _run_fio_verify_io --size="${nvme_img_size}" --filename="${nsdev}" + io_size="$(_nvme_calc_io_size "${nvme_img_size}")" + _run_fio_verify_io --size="${io_size}" --filename="${nsdev}" _nvme_disconnect_subsys "${subsys}" _nvmet_passthru_target_cleanup "${port}" "${subsys}"
tests/nvme/040 +3 -1
@@ -21,6 +21,7 @@ test() { local port local loop_dev local nvmedev + local rand_io_size echo "Running ${TEST_NAME}"
@@ -37,7 +38,8 @@ test() { # start fio job echo "starting background fio" - _run_fio_rand_io --filename="/dev/${nvmedev}n1" --size="${nvme_img_size}" \ + rand_io_size="$(_nvme_calc_rand_io_size "${nvme_img_size}")" + _run_fio_rand_io --filename="/dev/${nvmedev}n1" --size="${rand_io_size}" \ --group_reporting --ramp_time=5 \ --time_based --runtime=1m &> /dev/null & sleep 5
tests/nvme/045 +3 -1
@@ -31,6 +31,7 @@ test() { local ctrlkey local new_ctrlkey local ctrldev + local rand_io_size echo "Running ${TEST_NAME}"
@@ -120,7 +121,8 @@ test() { nvmedev=$(_find_nvme_dev "${subsys_name}") - _run_fio_rand_io --size=4m --filename="/dev/${nvmedev}n1" + rand_io_size="$(_nvme_calc_rand_io_size 4m)" + _run_fio_rand_io --size="${rand_io_size}" --filename="/dev/${nvmedev}n1" _nvme_disconnect_subsys "${subsys_name}"
tests/nvme/047 +4 -2
@@ -25,6 +25,7 @@ test() { local port local nvmedev local loop_dev + local rand_io_size local file_path="$TMPDIR/img" local subsys_name="blktests-subsystem-1"
@@ -42,7 +43,8 @@ test() { nvmedev=$(_find_nvme_dev "${subsys_name}") - _xfs_run_fio_verify_io /dev/"${nvmedev}n1" "1m" || echo FAIL + rand_io_size="$(_nvme_calc_rand_io_size 4M)" + _run_fio_rand_io --filename="/dev/${nvmedev}n1" --size="${rand_io_size}" _nvme_disconnect_subsys "${subsys_name}" >> "$FULL" 2>&1
@@ -50,7 +52,7 @@ test() { --nr-write-queues 1 \ --nr-poll-queues 1 || echo FAIL - _xfs_run_fio_verify_io /dev/"${nvmedev}n1" "1m" || echo FAIL + _run_fio_rand_io --filename="/dev/${nvmedev}n1" --size="${rand_io_size}" _nvme_disconnect_subsys "${subsys_name}" >> "$FULL" 2>&1
tests/nvme/rc +20 -0
@@ -150,6 +150,26 @@ _test_dev_nvme_nsid() { cat "${TEST_DEV_SYSFS}/nsid" } +_nvme_calc_io_size() { + local img_size_mb + local io_size_mb + + img_size_mb="$(convert_to_mb "$1")" + io_size_mb="$((img_size_mb - 1))" + + echo "${io_size_mb}m" +} + +_nvme_calc_rand_io_size() { + local img_size_mb + local io_size_mb + + img_size_mb="$(convert_to_mb "$1")" + io_size_mb="$(printf "%d" $((((img_size_mb * 1024 * 1024) / $(nproc) - 1) / 1024)))" + + echo "${io_size_mb}k" +} + _nvme_fcloop_add_rport() { local local_wwnn="$1" local local_wwpn="$2"
Signature · 1 line
2.40.0
PATCH v2 8/9 nvme-rc: Move discovery generation counter code to rc
In reply to Daniel WagnerMove the discovery generation counter code to rc so that we can reuse it in 002.
--- tests/nvme/002 | 4 +- tests/nvme/002.out | 3004 -------------------------------------------- tests/nvme/030 | 22 +- tests/nvme/rc | 13 + 4 files changed, 20 insertions(+), 3023 deletions(-)
tests/nvme/002 +3 -1
@@ -27,12 +27,14 @@ test() { local loop_dev loop_dev="$(losetup -f)" + local genctr=1 + for ((i = 0; i < iterations; i++)); do _create_nvmet_subsystem "blktests-subsystem-$i" "${loop_dev}" _add_nvmet_subsys_to_port "${port}" "blktests-subsystem-$i" done - _nvme_discover "${nvme_trtype}" | _filter_discovery + genctr=$(_check_genctr "${genctr}" "adding a subsystem to a port") for ((i = iterations - 1; i >= 0; i--)); do _remove_nvmet_subsystem_from_port "${port}" "blktests-subsystem-$i"
tests/nvme/002.out +0 -3004
2,985 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.40.0
Part of the diff is not shown here. View the raw message.
PATCH v2 4/4 nvme: Make the number iterations configurable
In reply to Daniel WagnerThe test hard code the number of iterations certain test should run. Make this variable via the newly introduced nvme_num_iter environment variable.
--- tests/nvme/002 | 2 +- tests/nvme/016 | 2 +- tests/nvme/017 | 2 +- tests/nvme/031 | 2 +- tests/nvme/037 | 2 +- tests/nvme/rc | 1 + 6 files changed, 6 insertions(+), 5 deletions(-)
tests/nvme/002 +1 -1
@@ -20,7 +20,7 @@ test() { _setup_nvmet - local iterations=1000 + local iterations="${nvme_num_iter}" local port port="$(_create_nvmet_port "${nvme_trtype}")"
tests/nvme/016 +1 -1
@@ -17,7 +17,7 @@ test() { echo "Running ${TEST_NAME}" local port - local iterations=1000 + local iterations="${nvme_num_iter}" local loop_dev local subsys_nqn="blktests-subsystem-1"
tests/nvme/017 +1 -1
@@ -18,7 +18,7 @@ test() { local port local file_path - local iterations=1000 + local iterations="${nvme_num_iter}" local subsys_name="blktests-subsystem-1" _setup_nvmet
tests/nvme/031 +1 -1
@@ -25,7 +25,7 @@ requires() { test() { local subsys="blktests-subsystem-" - local iterations=10 + local iterations="${nvme_num_iter}" local loop_dev local port
tests/nvme/037 +1 -1
@@ -14,7 +14,7 @@ requires() { test_device() { local subsys="blktests-subsystem-" - local iterations=10 + local iterations="${nvme_num_iter}" local ctrldev local port
tests/nvme/rc +1 -0
@@ -18,6 +18,7 @@ def_hostnqn="$(cat /etc/nvme/hostnqn 2> /dev/null)" def_hostid="$(cat /etc/nvme/hostid 2> /dev/null)" nvme_trtype=${nvme_trtype:-"loop"} nvme_img_size=${nvme_img_size:-"64M"} +nvme_num_iter=${nvme_num_iter:-"100"} _nvme_requires() { _have_program nvme
Signature · 1 line
2.40.0
PATCH v2 9/9 nvme: Make the number iterations configurable
In reply to Daniel WagnerSome tests hard code high values of iterations. This makes them run relatively long compared to the other tests. Introduce a new environment variable nvme_num_iter to allow tune the runtime.
--- tests/nvme/002 | 2 +- tests/nvme/016 | 2 +- tests/nvme/017 | 2 +- tests/nvme/rc | 1 + 4 files changed, 4 insertions(+), 3 deletions(-)
tests/nvme/002 +1 -1
@@ -20,7 +20,7 @@ test() { _setup_nvmet - local iterations=1000 + local iterations="${nvme_num_iter}" local port port="$(_create_nvmet_port "${nvme_trtype}")"
tests/nvme/016 +1 -1
@@ -17,7 +17,7 @@ test() { echo "Running ${TEST_NAME}" local port - local iterations=1000 + local iterations="${nvme_num_iter}" local loop_dev local subsys_nqn="blktests-subsystem-1"
tests/nvme/017 +1 -1
@@ -18,7 +18,7 @@ test() { local port local file_path - local iterations=1000 + local iterations="${nvme_num_iter}" local subsys_name="blktests-subsystem-1" _setup_nvmet
tests/nvme/rc +1 -0
@@ -18,6 +18,7 @@ def_hostnqn="$(cat /etc/nvme/hostnqn 2> /dev/null)" def_hostid="$(cat /etc/nvme/hostid 2> /dev/null)" nvme_trtype=${nvme_trtype:-"loop"} nvme_img_size=${nvme_img_size:-"350M"} +nvme_num_iter=${nvme_num_iter:-"100"} _nvme_requires() { _have_program nvme
Signature · 1 line
2.40.0
Screwed up with the mailing process. This series contains an early version of v2. Let me repost the correct version.