From: Geliang Tang <tanggeliang@kylinos.cn>
Added NVMe iopolicy testing to mptcp_nvme.sh, with the default set to
"numa". It can be set to "round-robin" or "queue-depth".
# ./mptcp_nvme.sh mptcp round-robin
Cc: Nilay Shroff <nilay@linux.ibm.com>
Cc: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
tools/testing/selftests/net/mptcp/mptcp_nvme.sh | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/tools/testing/selftests/net/mptcp/mptcp_nvme.sh b/tools/testing/selftests/net/mptcp/mptcp_nvme.sh
index 14a620040df2..2e03f47d22da 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_nvme.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_nvme.sh
@@ -4,6 +4,7 @@
. "$(dirname "$0")/mptcp_lib.sh"
trtype="${1:-mptcp}"
+iopolicy=${2:-"numa"} # round-robin, queue-depth
nqn=nqn.2014-08.org.nvmexpress.${trtype}dev
ns=1
port=1234
@@ -140,6 +141,12 @@ run_host()
echo "nvme list"
nvme list
+ subname=$(nvme list-subsys /dev/${devname}n1 |
+ grep -o 'nvme-subsys[0-9]*' | head -1)
+
+ echo ${iopolicy} > /sys/class/nvme-subsystem/${subname}/iopolicy
+ cat /sys/class/nvme-subsystem/${subname}/iopolicy
+
echo "fio randread /dev/${devname}n1"
fio --name=global --direct=1 --norandommap --randrepeat=0 --ioengine=libaio \
--thread=1 --blocksize=4k --runtime=10 --time_based --rw=randread --numjobs=4 \
@@ -164,6 +171,7 @@ losetup /dev/loop100 /tmp/test.raw
run_test()
{
export trtype nqn ns port trsvcid
+ export iopolicy
ip netns exec "$ns1" bash <<- EOF
$(declare -f run_target)
--
2.53.0