diff mbox series

[blktests,v2,2/3] nvme/rc: Add nr queue parser arguments

Message ID 20230322101648.31514-3-dwagner@suse.de (mailing list archive)
State New, archived
Headers show
Series Test different queue counts | expand

Commit Message

Daniel Wagner March 22, 2023, 10:16 a.m. UTC
Signed-off-by: Daniel Wagner <dwagner@suse.de>
---
 tests/nvme/rc | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

Comments

Shinichiro Kawasaki March 23, 2023, 10:46 a.m. UTC | #1
I suggest to add "to _nvme_connect_subsys()" to the commit title. Other than
that, this patch looks good to me.
diff mbox series

Patch

diff --git a/tests/nvme/rc b/tests/nvme/rc
index 1145fed2d14c..ca3d995f7b0b 100644
--- a/tests/nvme/rc
+++ b/tests/nvme/rc
@@ -326,6 +326,9 @@  _nvme_connect_subsys() {
 	local hostid="$def_hostid"
 	local hostkey=""
 	local ctrlkey=""
+	local nr_io_queues=""
+	local nr_write_queues=""
+	local nr_poll_queues=""
 
 	while [[ $# -gt 0 ]]; do
 		case $1 in
@@ -364,6 +367,21 @@  _nvme_connect_subsys() {
 				shift
 				shift
 				;;
+			-i|--nr-io-queues)
+				nr_io_queues="$2"
+				shift
+				shift
+				;;
+			-W|--nr-write-queues)
+				nr_write_queues="$2"
+				shift
+				shift
+				;;
+			-P|--nr-poll-queues)
+				nr_poll_queues="$2"
+				shift
+				shift
+				;;
 			*)
 				positional_args+=("$1")
 				shift
@@ -394,6 +412,16 @@  _nvme_connect_subsys() {
 	if [[ -n "${ctrlkey}" ]]; then
 		ARGS+=(--dhchap-ctrl-secret="${ctrlkey}")
 	fi
+	if [[ -n "${nr_io_queues}" ]]; then
+		ARGS+=(--nr-io-queues="${nr_io_queues}")
+	fi
+	if [[ -n "${nr_write_queues}" ]]; then
+		ARGS+=(--nr-write-queues="${nr_write_queues}")
+	fi
+	if [[ -n "${nr_poll_queues}" ]]; then
+		ARGS+=(--nr-poll-queues="${nr_poll_queues}")
+	fi
+
 	nvme connect "${ARGS[@]}" 2> /dev/null
 }