nvmeof-mp/srp/nvme-rdma misc fix and enhancement
Subsystems (2)
cover nvmeof-mp/srp/nvme-rdma misc fix and enhancement
Hi
This patch series addressed some failures when I run nvmeof-mp/srp test and also add suport to use siw for nvme-rdma/nvmeof-mp testing from cmdline, like this:
$ use_siw=1 nvme-trtype=rdma ./check nvme/ $ use_siw=1 ./check nvmeof-mp/
Thanks
Yi
Yi Zhang (5):
tests/srp/rc: update the ib_srpt module name tests/nvmeof-mp/rc: run nvmeof-mp tests if we set multipath=N tests/nvmeof-mp/012: fix the schedulers list common/rc: _have_iproute2 fix for "ip -V" change common/multipath-over-rdma: allow to set use_siw
common/multipath-over-rdma | 2 +- common/rc | 2 +- tests/nvmeof-mp/012 | 10 ++++++---- tests/nvmeof-mp/rc | 2 +- tests/srp/rc | 4 ++-- 5 files changed, 11 insertions(+), 9 deletions(-)
Signature · 7 lines
2.21.0 _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
PATCH 1/5 tests/srp/rc: update the ib_srpt module name
Fix the ib_srpt module insmod failure as the module in some distros are end with .xz, like bellow on fedora:
/lib/modules/$(uname -r)/kernel/drivers/infiniband/ulp/srpt/ib_srpt.ko.xz
--- tests/srp/rc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tests/srp/rc +2 -2
@@ -465,7 +465,7 @@ configure_target_ports() { # Load LIO and configure the SRP target driver and LUNs. start_lio_srpt() { - local b d gid i ini_ids=() opts p target_ids=() vdev + local b d gid i ini_ids=() opts p target_ids=() for gid in $(all_primary_gids); do if [ "${gid#fe8}" != "$gid" ]; then
@@ -500,7 +500,7 @@ start_lio_srpt() { if modinfo ib_srpt | grep -q '^parm:[[:blank:]]*rdma_cm_port:'; then opts+=("rdma_cm_port=${srp_rdma_cm_port}") fi - insmod "/lib/modules/$(uname -r)/kernel/drivers/infiniband/ulp/srpt/ib_srpt.ko" "${opts[@]}" || return $? + insmod "$(ls /lib/modules/"$(uname -r)"/kernel/drivers/infiniband/ulp/srpt/ib_srpt.*)" "${opts[@]}" || return $? i=0 for r in "${vdev_path[@]}"; do if [ -b "$(readlink -f "$r")" ]; then
Signature · 7 lines
2.21.0 _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
Re: [PATCH blktests 1/5] tests/srp/rc: update the ib_srpt module name
tests/srp/rc start_lio_srpt() { · line 503
Quoted 2 lines · Yi Zhang
tests/srp/rc +1
-1- insmod "/lib/modules/$(uname -r)/kernel/drivers/infiniband/ulp/srpt/ib_srpt.ko" "${opts[@]}" || return $? + insmod "$(ls /lib/modules/"$(uname -r)"/kernel/drivers/infiniband/ulp/srpt/ib_srpt.*)" "${opts[@]}" || return $?
Is 'ls' needed here or is 'echo' sufficient?
Thanks,
Bart.
Re: [PATCH blktests 1/5] tests/srp/rc: update the ib_srpt module name
Quoted 4 lines · Bart Van Assche
tests/srp/rc start_lio_srpt() { · line 503
Quoted 2 lines · Yi Zhang
tests/srp/rc +1
-1- insmod "/lib/modules/$(uname -r)/kernel/drivers/infiniband/ulp/srpt/ib_srpt.ko" "${opts[@]}" || return $? + insmod "$(ls /lib/modules/"$(uname -r)"/kernel/drivers/infiniband/ulp/srpt/ib_srpt.*)" "${opts[@]}" || return $?Is 'ls' needed here or is 'echo' sufficient?
Actually it doesn't work without ls
$ insmod "/lib/modules/"$(uname -r)"/kernel/drivers/infiniband/ulp/srpt/ib_srpt.*" insmod: ERROR: could not load module /lib/modules/5.10.0-rc5/kernel/drivers/infiniband/ulp/srpt/ib_srpt.*: No such file or directory
and it works with echo, I can change to echo if you prefer
$ insmod "$(echo /lib/modules/"$(uname -r)"/kernel/drivers/infiniband/ulp/srpt/ib_srpt.*)" "${opts[@]}" || return $?Quoted 9 lines
Thanks,
Bart.
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Re: [PATCH blktests 1/5] tests/srp/rc: update the ib_srpt module name
Quoted 16 lines · Yi Zhang
Quoted 8 lines · Bart Van Assche
Quoted 6 lines · Yi Zhang
- insmod "/lib/modules/$(uname -r)/kernel/drivers/infiniband/ulp/srpt/ib_srpt.ko" "${opts[@]}" || return $?
+ insmod "$(ls /lib/modules/"$(uname -r)"/kernel/drivers/infiniband/ulp/srpt/ib_srpt.*)" "${opts[@]}" || return $?Is 'ls' needed here or is 'echo' sufficient?
Actually it doesn't work without ls
$ insmod "/lib/modules/"$(uname -r)"/kernel/drivers/infiniband/ulp/srpt/ib_srpt.*" insmod: ERROR: could not load module /lib/modules/5.10.0-rc5/kernel/drivers/infiniband/ulp/srpt/ib_srpt.*: No such file or directory
Quoted 4 lines
and it works with echo, I can change to echo if you prefer
$ insmod "$(echo /lib/modules/"$(uname -r)"/kernel/drivers/infiniband/ulp/srpt/ib_srpt.*)" "${opts[@]}" || return $?
'echo' is a shell built-in while ls is not built-in into bash, so echo is faster.
How about insmod "/lib/modules/$(uname -r)/kernel/drivers/infiniband/ulp/srpt/ib_srpt."* (no echo, no ls, asterisk outside double quotes)?
Thanks,
Bart.
Re: [PATCH blktests 1/5] tests/srp/rc: update the ib_srpt module name
Quoted 17 lines · Bart Van Assche
Quoted 16 lines · Yi Zhang
Quoted 8 lines · Bart Van Assche
Quoted 6 lines · Yi Zhang
- insmod "/lib/modules/$(uname -r)/kernel/drivers/infiniband/ulp/srpt/ib_srpt.ko" "${opts[@]}" || return $?
+ insmod "$(ls /lib/modules/"$(uname -r)"/kernel/drivers/infiniband/ulp/srpt/ib_srpt.*)" "${opts[@]}" || return $?Is 'ls' needed here or is 'echo' sufficient?
Actually it doesn't work without ls
$ insmod "/lib/modules/"$(uname -r)"/kernel/drivers/infiniband/ulp/srpt/ib_srpt.*" insmod: ERROR: could not load module /lib/modules/5.10.0-rc5/kernel/drivers/infiniband/ulp/srpt/ib_srpt.*: No such file or directory
Quoted 6 lines
Quoted 4 lines
and it works with echo, I can change to echo if you prefer
$ insmod "$(echo /lib/modules/"$(uname -r)"/kernel/drivers/infiniband/ulp/srpt/ib_srpt.*)" "${opts[@]}" || return $?'echo' is a shell built-in while ls is not built-in into bash, so echo is faster.
yeah, thanks for the info.
Quoted 3 lines
How about insmod "/lib/modules/$(uname -r)/kernel/drivers/infiniband/ulp/srpt/ib_srpt."* (no echo, no ls, asterisk outside double quotes)?
This works, have updated to V2
Quoted 9 lines
Thanks,
Bart.
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
PATCH 2/5 tests/nvmeof-mp/rc: run nvmeof-mp tests if we set multipath=N
In reply to Yi ZhangTo enable it, just do bellow step before we run it:
$ echo "options nvme_core multipath=N" >/etc/modprobe.d/nvme.conf
--- tests/nvmeof-mp/rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/nvmeof-mp/rc +1 -1
@@ -17,7 +17,7 @@ group_requires() { # Since the nvmeof-mp tests are based on the dm-mpath driver, these # tests are incompatible with the NVME_MULTIPATH kernel configuration # option. - if _have_kernel_option NVME_MULTIPATH; then + if _have_kernel_option NVME_MULTIPATH && _have_module_param_value nvme_core multipath Y; then SKIP_REASON="CONFIG_NVME_MULTIPATH has been set in .config" return fi
Signature · 7 lines
2.21.0 _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
Re: [PATCH blktests 2/5] tests/nvmeof-mp/rc: run nvmeof-mp tests if we set multipath=N
Quoted 13 lines · Yi Zhang
To enable it, just do bellow step before we run it:
$ echo "options nvme_core multipath=N" >/etc/modprobe.d/nvme.confSigned-off-by Yi Zhang <[email protected]>--- tests/nvmeof-mp/rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/nvmeof-mp/rc +0
-0
tests/nvmeof-mp/rc group_requires() { · line 23
Quoted 8 lines
tests/nvmeof-mp/rc +1
-1@@ -17,7 +17,7 @@ group_requires() { # Since the nvmeof-mp tests are based on the dm-mpath driver, these # tests are incompatible with the NVME_MULTIPATH kernel configuration # option. - if _have_kernel_option NVME_MULTIPATH; then + if _have_kernel_option NVME_MULTIPATH && _have_module_param_value nvme_core multipath Y; then SKIP_REASON="CONFIG_NVME_MULTIPATH has been set in .config" return fi
Please set different SKIP_REASON string for each case such that it remains easy for a blktests user to figure out why these tests have been skipped.
Thanks,
Bart.
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Re: [PATCH blktests 2/5] tests/nvmeof-mp/rc: run nvmeof-mp tests if we set multipath=N
Quoted 9 lines · Bart Van Assche
Quoted 8 lines · Yi Zhang
To enable it, just do bellow step before we run it:
$ echo "options nvme_core multipath=N" >/etc/modprobe.d/nvme.confSigned-off-by Yi Zhang <[email protected]>--- tests/nvmeof-mp/rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines
tests/nvmeof-mp/rc group_requires() { · line 23
Quoted 13 lines
tests/nvmeof-mp/rc +1
-1@@ -17,7 +17,7 @@ group_requires() { # Since the nvmeof-mp tests are based on the dm-mpath driver, these # tests are incompatible with the NVME_MULTIPATH kernel configuration # option. - if _have_kernel_option NVME_MULTIPATH; then + if _have_kernel_option NVME_MULTIPATH && _have_module_param_value nvme_core multipath Y; then SKIP_REASON="CONFIG_NVME_MULTIPATH has been set in .config" return fiPlease set different
SKIP_REASONstring for each case such that it remains easy for a blktests user to figure out why these tests have been skipped.
Do you mean something like this, could you add more detail here, thanks.
tests/nvmeof-mp/rc +0 -0
@@ -16,9 +16,9 @@ group_requires() {
# Since the nvmeof-mp tests are based on the dm-mpath driver, these
# tests are incompatible with the NVME_MULTIPATH kernel configuration - # option. - if _have_kernel_option NVME_MULTIPATH; then - SKIP_REASON="CONFIG_NVME_MULTIPATH has been set in .config" + # option and nvme_core: multipath set with Y. + if _have_kernel_option NVME_MULTIPATH && _have_module_param_value nvme_core multipath Y; then + SKIP_REASON="CONFIG_NVME_MULTIPATH has been set in .config and nvme_core: multipath should be set with N" return fi
Quoted 9 lines
Thanks,
Bart.
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Re: [PATCH blktests 2/5] tests/nvmeof-mp/rc: run nvmeof-mp tests if we set multipath=N
Quoted 13 lines · Yi Zhang
Do you mean something like this, could you add more detail here, thanks.
tests/nvmeof-mp/rc +0
-0@@ -16,9 +16,9 @@ group_requires() { # Since the nvmeof-mp tests are based on the dm-mpath driver, these # tests are incompatible with the NVME_MULTIPATH kernelconfiguration
- # option.
- if_have_kernel_optionNVME_MULTIPATH; then
Quoted 8 lines
- SKIP_REASON="CONFIG_NVME_MULTIPATH has been set in .config" + # option and
nvme_core: multipath set with Y.
+ if_have_kernel_optionNVME_MULTIPATH&&_have_module_param_valuenvme_coremultipath Y; then
+ SKIP_REASON="CONFIG_NVME_MULTIPATH has been set in .config andnvme_core: multipath should be set with N"
return
fi
I may have sent you in the wrong direction. This is what I meant:
if _have_kernel_option NVME_MULTIPATH &&
_have_module_param_value nvme_core multipath Y; then SKIP_REASON="CONFIG_NVME_MULTIPATH has been set in .config and
multipathing has been enabled in the nvme_core kernel module"
return
fi
Thanks,
Bart.
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Re: [PATCH blktests 2/5] tests/nvmeof-mp/rc: run nvmeof-mp tests if we set multipath=N
Quoted 24 lines · Bart Van Assche
Quoted 13 lines · Yi Zhang
Do you mean something like this, could you add more detail here, thanks.
tests/nvmeof-mp/rc +0
-0@@ -16,9 +16,9 @@ group_requires() { # Since the nvmeof-mp tests are based on the dm-mpath driver, these # tests are incompatible with the NVME_MULTIPATH kernelconfiguration
- # option.
- if_have_kernel_optionNVME_MULTIPATH; thenQuoted 8 lines
- SKIP_REASON="CONFIG_NVME_MULTIPATH has been set in .config" + # option and
nvme_core: multipath set with Y.
+ if_have_kernel_optionNVME_MULTIPATH&&_have_module_param_valuenvme_coremultipath Y; then
+ SKIP_REASON="CONFIG_NVME_MULTIPATH has been set in .config andnvme_core: multipath should be set with N"
return
fiI may have sent you in the wrong direction. This is what I meant:
Quoted 6 lines
if
_have_kernel_optionNVME_MULTIPATH&&
_have_module_param_valuenvme_coremultipath Y; then SKIP_REASON="CONFIG_NVME_MULTIPATH has been set in .config and
multipathing has been enabled in thenvme_corekernel module"
return
fi
Updated on V2, thanks for the review.
Quoted 8 lines
Thanks,
Bart.
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
PATCH 3/5 tests/nvmeof-mp/012: fix the schedulers list
In reply to Yi ZhangThere is no cfg scheduler and new added kyber scheduler in lastest kernel, so get the scheduler from sysfs
To reproduce it:
$ ./check nvmeof-mp/012
nvmeof-mp/012 (dm-mpath on top of multiple I/O schedulers) [passed]
runtime 5.922s ... 8.804s$ cat results/nodev/nvmeof-mp/012.full | grep -n "Changing scheduler" 31:Changing scheduler of dm-3 from mq-deadline kyber [bfq] none into cfq failed 47:Changing scheduler of dm-3 from mq-deadline kyber [bfq] none into cfq failed
--- tests/nvmeof-mp/012 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
tests/nvmeof-mp/012 +6 -4
@@ -8,7 +8,7 @@ DESCRIPTION="dm-mpath on top of multiple I/O schedulers" QUICK=1 test_io_schedulers() { - local dev m + local dev m dm scheds # Load all I/O scheduler kernel modules for m in "/lib/modules/$(uname -r)/kernel/block/"*.ko; do
@@ -17,15 +17,17 @@ test_io_schedulers() { for mq in y n; do use_blk_mq ${mq} || return $? dev=$(get_bdev 0) || return $? - for sched in noop deadline bfq cfq; do - set_scheduler "$(basename "$(readlink -f "${dev}")")" $sched \ + dm=$(basename "$(readlink -f "${dev}")") || return $? + scheds=$(sed 's/[][]//g' /sys/block/"$dm"/queue/scheduler) || return $? + for sched in $scheds; do + set_scheduler "$dm" "$sched" \ >>"$FULL" 2>&1 || continue echo "I/O scheduler: $sched; use_blk_mq: $mq" >>"$FULL" run_fio --verify=md5 --rw=randwrite --bs=4K --size=64K \ --ioengine=libaio --iodepth=64 \ --iodepth_batch=32 --group_reporting --sync=1 \ --direct=1 --filename="$dev" \ - --name=${sched} --thread --numjobs=1 \ + --name="${sched}" --thread --numjobs=1 \ --output="${RESULTS_DIR}/nvmeof-mp/012-${sched}-${mq}.txt" \ >>"$FULL" || return $?
Signature · 1 line
2.21.0
Re: [PATCH blktests 3/5] tests/nvmeof-mp/012: fix the schedulers list
Quoted 1 line · Yi Zhang
There is no cfg scheduler and new added kyber scheduler in lastest kernel,
^^^
cfq?Quoted 1 line
so get the scheduler from sysfs
[ ... ]
tests/nvmeof-mp/012 test_io_schedulers() { · line 23
Quoted 12 lines
tests/nvmeof-mp/012 +4
-2# Load all I/O scheduler kernel modules for m in "/lib/modules/$(uname -r)/kernel/block/"*.ko; do@@ -17,15 +17,17 @@ test_io_schedulers() { for mq in y n; do use_blk_mq ${mq} || return $? dev=$(get_bdev 0) || return $? - for sched in noop deadline bfq cfq; do - set_scheduler "$(basename "$(readlink -f "${dev}")")" $sched \ + dm=$(basename "$(readlink -f "${dev}")") || return $? + scheds=$(sed 's/[][]//g' /sys/block/"$dm"/queue/scheduler) || return $? + for sched in $scheds; do + set_scheduler "$dm" "$sched" \
Similar code occurs in tests/srp/012. Please introduce a function for retrieving the scheduler list and also update tests/srp/012.
Thanks,
Bart.
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Re: [PATCH blktests 3/5] tests/nvmeof-mp/012: fix the schedulers list
Quoted 4 lines · Bart Van Assche
Quoted 1 line · Yi Zhang
There is no cfg scheduler and new added kyber scheduler in lastest kernel,
^^^ cfq?
Thanks.
Quoted 17 lines
Quoted 1 line
so get the scheduler from sysfs
[ ... ]
Review test_io_schedulers() { · line 23
Quoted 12 lines
# Load all I/O scheduler kernel modules for m in "/lib/modules/$(uname -r)/kernel/block/"*.ko; do(quoted diff) +4
-2@@ -17,15 +17,17 @@ test_io_schedulers() { for mq in y n; do use_blk_mq ${mq} || return $? dev=$(get_bdev 0) || return $? - for sched in noop deadline bfq cfq; do - set_scheduler "$(basename "$(readlink -f "${dev}")")" $sched \ + dm=$(basename "$(readlink -f "${dev}")") || return $? + scheds=$(sed 's/[][]//g' /sys/block/"$dm"/queue/scheduler) || return $? + for sched in $scheds; do + set_scheduler "$dm" "$sched" \Similar code occurs in tests/srp/012. Please introduce a function for retrieving the scheduler list and also update tests/srp/012.
OK, will add below function and update both nvmeof-mp/012 and srp/012
common/multipath-over-rdma +0 -0
@@ -326,6 +326,18 @@ set_scheduler() {
fi
}
+# Get block dev scheduler list
+get_scheduler_list() {
+ local b=$1 p
+ p=/sys/block/"$b"/queue/scheduler
+ if [ -e "$p" ]; then
+ scheds=$(sed 's/[][]//g' /sys/block/"$b"/queue/scheduler) + echo "$scheds"
+ else
+ return 1
+ fi
+}
+
Quoted 9 lines
Thanks,
Bart.
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
PATCH 4/5 common/rc: _have_iproute2 fix for "ip -V" change
In reply to Yi ZhangWith bellow commit, the version will be updated base on the tag fbef6555 replace SNAPSHOT with auto-generated version string
To reproduce it:
$ ./check srp/015 common/rc: line 98: [: ip utility, iproute2-5.9.0: integer expression expected
--- common/rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
common/rc +1 -1
@@ -95,7 +95,7 @@ _have_iproute2() { SKIP_REASON="ip utility not found" return 1 fi - if [ "$snapshot" -lt "$1" ]; then + if [[ "$snapshot" =~ ^[0-9]+$ && "$snapshot" -lt "$1" ]]; then SKIP_REASON="ip utility too old" return 1 fi
Signature · 1 line
2.21.0
Re: [PATCH blktests 4/5] common/rc: _have_iproute2 fix for "ip -V" change
Quoted 1 line · Yi Zhang
With bellow commit, the version will be updated base on the tag
^^^^^^
below?Quoted 1 line
fbef6555replace SNAPSHOT with auto-generated version string
Thanks,
Bart.
Re: [PATCH blktests 4/5] common/rc: _have_iproute2 fix for "ip -V" change
Quoted 4 lines · Bart Van Assche
Quoted 1 line · Yi Zhang
With bellow commit, the version will be updated base on the tag
^^^^^^ below?
Thanks, will update it in the v2
Quoted 10 lines
Quoted 1 line
fbef6555replace SNAPSHOT with auto-generated version stringThanks,
Bart.
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
PATCH 5/5 common/multipath-over-rdma: allow to set use_siw
In reply to Yi ZhangWith this change, we can change to use siw for nvme-rdma/nvmeof-mp testing from cmdline:
$ use_siw=1 nvme-trtype=rdma ./check nvme/ $ use_siw=1 ./check nvmeof-mp/
--- common/multipath-over-rdma | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
common/multipath-over-rdma +1 -1
@@ -12,7 +12,7 @@ filesystem_type=ext4 fio_aux_path=/tmp/fio-state-files memtotal=$(sed -n 's/^MemTotal:[[:blank:]]*\([0-9]*\)[[:blank:]]*kB$/\1/p' /proc/meminfo) max_ramdisk_size=$((1<<25)) -use_siw= +use_siw=${use_siw:-""} ramdisk_size=$((memtotal*(1024/16))) # in bytes if [ $ramdisk_size -gt $max_ramdisk_size ]; then ramdisk_size=$max_ramdisk_size
Signature · 1 line
2.21.0