Skip to contentSkip to conversation

nvme-cli/fabrics: Add nr_io_queues parameter to connect command

PATCH New Steve Wise 4 participants 11 messages Aug 26, 2016 – Aug 29, 2016 NVMe

lore
Share & tools
lore

Steve Wise

author
#0 lore raw

PATCH 1/1 nvme-cli/fabrics: Add nr_io_queues parameter to connect command

Added 'nr_io_queues' to 'connect' command so users can specify the number of io queues to allocate.

usage example:

nvme connect -t rdma -Q 8 -s 4420 -a 10.0.1.14 -n test-nvme

Signed-off-by Steve Wise <swise at opengridcomputing.com>
---
 fabrics.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
fabrics.c +11 -0
index 942e987..4fc5a40 100644
@@ -50,6 +50,7 @@ struct config {
 	char *traddr;
 	char *trsvcid;
 	char *hostnqn;
+	char *nr_io_queues;
 	char *raw;
 	char *device;
 } cfg = { 0 };
@@ -481,6 +482,14 @@ static int build_options(char *argstr, int max_len)
 		max_len -= len;
 	}
 
+	if (cfg.nr_io_queues) {
+		len = snprintf(argstr, max_len, ",nr_io_queues=%s", cfg.nr_io_queues);
+		if (len < 0)
+			return -EINVAL;
+		argstr += len;
+		max_len -= len;
+	}
+
 	return 0;
 }
 
@@ -713,6 +722,8 @@ int connect(const char *desc, int argc, char **argv)
 			"transport service id (e.g. IP port)" },
 		{"hostnqn", 'q', "LIST", CFG_STRING, &cfg.hostnqn, required_argument,
 			"user-defined hostnqn" },
+		{"nr_io_queues", 'Q', "LIST", CFG_STRING, &cfg.nr_io_queues, required_argument,
+			"number of io queues to use (default is core count)" },
 		{0},
 	};
 
Signature · 1 line
2.7.0
#1 lore raw

PATCH 1/1 nvme-cli/fabrics: Add nr_io_queues parameter to connect command

Quoted 2 lines · Steve Wise

Added 'nr_io_queues' to 'connect' command so users can specify the number of io queues to allocate.

Purely as a matter of consistency here, every other long-format option in this program uses dash '-' instead of underscore '_' as a multi-word separator. Let's stick with that. It works for 'git'. :)

author
#2 lore raw

PATCH 1/1 nvme-cli/fabrics: Add nr_io_queues parameter to connect command

Quoted 6 lines
Quoted 2 lines

Added 'nr_io_queues' to 'connect' command so users can specify the number of io queues to allocate.

Purely as a matter of consistency here, every other long-format option in this program uses dash '-' instead of underscore '_' as a multi-word separator. Let's stick with that. It works for 'git'. :)

Will do.

#3 lore raw

PATCH 1/1 nvme-cli/fabrics: Add nr_io_queues parameter to connect command

In reply to Steve Wise
Quoted 7 lines · Steve Wise

Added 'nr_io_queues' to 'connect' command so users can specify the number
of io queues to allocate.

usage example:

nvme connect -t rdma -Q 8 -s 4420 -a 10.0.1.14 -n test-nvme

I was just wondering if there could be another lower-case letter flag option we could use other than capital Q. ?Just looking at the example above, it looks a tad out-of-place.

#4 lore raw

PATCH 1/1 nvme-cli/fabrics: Add nr_io_queues parameter to connect command

Quoted 5 lines · J Freyensee
Quoted 4 lines · Steve Wise

Added 'nr_io_queues' to 'connect' command so users can specify the number
of io queues to allocate.

Quoted 7 lines
Quoted 3 lines

usage example:

nvme connect -t rdma -Q 8 -s 4420 -a 10.0.1.14 -n test-nvme

I was just wondering if there could be another lower-case letter flag option we could use other than capital Q. ??Just looking at the example above, it looks a tad out-of-place.

-q would be nice. For that'd we need to rename the hostnqn one, but as stated before I think -q is really misnamed for that anyway..

author
#5 lore raw

PATCH 1/1 nvme-cli/fabrics: Add nr_io_queues parameter to connect command

Quoted 8 lines · J Freyensee
Quoted 7 lines · Steve Wise
Quoted 6 lines

Added 'nr_io_queues' to 'connect' command so users can specify the number
of io queues to allocate.

usage example:

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

nvme connect -t rdma -Q 8 -s 4420 -a 10.0.1.14 -n test-nvme

I was just wondering if there could be another lower-case letter flag option we could use other than capital Q. ??Just looking at the example above, it looks a tad out-of-place.

-q would be nice. For that'd we need to rename the hostnqn one, but as stated before I think -q is really misnamed for that anyway..

-h for hostnqn?

author
#6 lore raw

PATCH 1/1 nvme-cli/fabrics: Add nr_io_queues parameter to connect command

Quoted 10 lines
Quoted 10 lines · J Freyensee
Quoted 9 lines · Steve Wise
Quoted 7 lines

Added 'nr_io_queues' to 'connect' command so users can specify the number
of io queues to allocate.

usage example:

nvme connect -t rdma -Q 8 -s 4420 -a 10.0.1.14 -n test-nvme

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

I was just wondering if there could be another lower-case letter flag option we could use other than capital Q. ??Just looking at the example above, it looks a tad out-of-place.

-q would be nice. For that'd we need to rename the hostnqn one, but as stated before I think -q is really misnamed for that anyway..

-h for hostnqn?

Oops... -h is 'help' :)

author
#7 lore raw

PATCH 1/1 nvme-cli/fabrics: Add nr_io_queues parameter to connect command

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 3 lines

usage example:

nvme connect -t rdma -Q 8 -s 4420 -a 10.0.1.14 -n test-nvme

I was just wondering if there could be another lower-case letter flag option we could use other than capital Q. ??Just looking at the example above, it looks a tad out-of-place.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

-q would be nice. For that'd we need to rename the hostnqn one, but as stated before I think -q is really misnamed for that anyway..

-h for hostnqn?

Oops... -h is 'help' :)

Could use -i for nr-io-queues...

#8 lore raw

PATCH 1/1 nvme-cli/fabrics: Add nr_io_queues parameter to connect command

In reply to Steve Wise
Quoted 21 lines · Steve Wise
Quoted 21 lines
Quoted 21 lines · J Freyensee
Quoted 17 lines · Steve Wise
Quoted 9 lines

Added 'nr_io_queues' to 'connect' command so users can specify the
number
of io queues to allocate.

usage example:

nvme connect -t rdma -Q 8 -s 4420 -a 10.0.1.14 -n test-nvme

I was just wondering if there could be another lower-case letter flag
option we could use other than capital Q. ??Just looking at the example
above, it looks a tad out-of-place.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

-q would be nice. For that'd we need to rename the hostnqn one, but as
stated before I think -q is really misnamed for that anyway..

-h for hostnqn?

Oops... -h is 'help' :)

Yep, all the good single letter flags are being taken ;-P.

-i seems fine to me. ?I kind of like -q for hostnqn since hostnqn does have a 'q' in it so there is somewhat of a mind-remembrance game there :-).

Quoted 3 lines
author
#9 lore raw

PATCH 1/1 nvme-cli/fabrics: Add nr_io_queues parameter to connect command

In reply to J Freyensee
Quoted 6 lines · Steve Wise
Quoted 4 lines

Added 'nr_io_queues' to 'connect' command so users can specify the number
of io queues to allocate.

Quoted 7 lines
Quoted 3 lines

usage example:

nvme connect -t rdma -Q 8 -s 4420 -a 10.0.1.14 -n test-nvme

I was just wondering if there could be another lower-case letter flag option we could use other than capital Q. Just looking at the example above, it looks a tad out-of-place.

'-i' ? Any other suggestions?

#10 lore raw

PATCH 1/1 nvme-cli/fabrics: Add nr_io_queues parameter to connect command

Quoted 13 lines · Steve Wise
Quoted 13 lines · Steve Wise
Quoted 9 lines

Added 'nr_io_queues' to 'connect' command so users can specify the
number
of io queues to allocate.

usage example:

nvme connect -t rdma -Q 8 -s 4420 -a 10.0.1.14 -n test-nvme

Quoted 7 lines
Quoted 5 lines

I was just wondering if there could be another lower-case letter flag
option we could use other than capital Q.??Just looking at the example
above, it looks a tad out-of-place.

'-i' ???Any other suggestions?

Sounds fine to me.

Quoted 6 lines

_______________________________________________
Linux-nvme mailing list
Linux-nvme at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme