Skip to contentSkip to conversation

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

PATCH Superseded Steve Wise 3 participants 5 messages Aug 29, 2016 – Aug 31, 2016 NVMe

lore
Share & tools
lore

Steve Wise

author
#0 lore raw

PATCH v2 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 examples:

nvme connect --transport=rdma --nr-io-queues=8 --trsvcid=4420 --traddr=10.0.1.14 --nqn=test-nvme nvme connect -t rdma -i 8 -s 4420 -a 10.0.1.14 -n test-nvme

Signed-off-by Steve Wise <swise at opengridcomputing.com>

---

Changes since v1:

-Q -> -i
nr_io_queues -> nr-io-queues

---
 fabrics.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
fabrics.c +11 -0
index 942e987..18e961c 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", 'i', "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 v2 1/1 nvme-cli/fabrics: Add nr_io_queues parameter to connect command

Quoted 27 lines · Steve Wise

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

usage examples:

nvme connect --transport=rdma --nr-io-queues=8 --trsvcid=4420 -- traddr=10.0.1.14 --nqn=test-nvme
nvme connect -t rdma -i 8 -s 4420 -a 10.0.1.14 -n test-nvme

Signed-off-by Steve Wise <swise at opengridcomputing.com>

---

Changes since v1:

-Q -> -i
nr_io_queues -> nr-io-queues

---
?fabrics.c | 11 +++++++++++
?1 file changed, 11 insertions(+)

fabrics.c +0 -0
index 942e987..18e961c 100644

fabrics.c struct config { · line 53

Quoted 4 lines
fabrics.c +1 -0
@@ -50,6 +50,7 @@ struct config {
 ?	char *traddr;
 ?	char *trsvcid;
 ?	char *hostnqn;
+	char *nr_io_queues;

I just noticed that the 'nr_io_queues' parameter type used in the host driver code fabrics.c is unsigned int. ?Would there be a truncation problem here, like say someone wants to do:

nvme connect?--nr-io-queues=256

??

maybe nr_io_queues here also needs to be of type unsigned int.

Other than that, I'm fine with the changes.

Quoted 33 lines
fabrics.c +0 -0
 ?	char *raw;
 ?	char *device;
 ?} cfg = { 0 };
@@ -481,6 +482,14 @@ static int build_options(char *argstr, int
 max_len)
 ?		max_len -= len;
 ?	}

?

fabrics.c +2 -0
+	if (cfg.nr_io_queues) {
+		len = snprintf(argstr, max_len, ",nr_io_queues=%s",

cfg.nr_io_queues);

fabrics.c +6 -0
+		if (len < 0)
+			return -EINVAL;
+		argstr += len;
+		max_len -= len;
+	}
+

? return 0;
?}
?

fabrics.c +2 -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", 'i', "LIST", CFG_STRING,
 &cfg.nr_io_queues, required_argument,
+			"number of io queues to use (default is core

count)" },
? {0},
? };
?

author
#2 lore raw

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

Quoted 37 lines · Steve Wise
Quoted 27 lines

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

usage examples:

nvme connect --transport=rdma --nr-io-queues=8 --trsvcid=4420 -- traddr=10.0.1.14 --nqn=test-nvme
nvme connect -t rdma -i 8 -s 4420 -a 10.0.1.14 -n test-nvme

Signed-off-by Steve Wise <swise at opengridcomputing.com>

---

Changes since v1:

-Q -> -i
nr_io_queues -> nr-io-queues

---
 fabrics.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
fabrics.c +0 -0
index 942e987..18e961c 100644

fabrics.c struct config { · line 53

Quoted 4 lines
fabrics.c +1 -0
@@ -50,6 +50,7 @@ struct config {
 	char *traddr;
 	char *trsvcid;
 	char *hostnqn;
+	char *nr_io_queues;

I just noticed that the 'nr_io_queues' parameter type used in the host driver code fabrics.c is unsigned int. Would there be a truncation problem here, like say someone wants to do:

Quoted 4 lines

nvme connect --nr-io-queues=256

??

Truncation problem? How so?

This patch follows the other existing parameters. For instance: trsvcid. It is basically an unstructured string that is passed to the driver and the driver does the enforcement/validation.

Steve.

#3 lore raw

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

Quoted 43 lines · Steve Wise
Quoted 43 lines · Steve Wise
Quoted 29 lines

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

usage examples:

nvme connect --transport=rdma --nr-io-queues=8 --trsvcid=4420 -- traddr=10.0.1.14 --nqn=test-nvme
nvme connect -t rdma -i 8 -s 4420 -a 10.0.1.14 -n test-nvme

Signed-off-by Steve Wise <swise at opengridcomputing.com>

---

Changes since v1:

-Q -> -i
nr_io_queues -> nr-io-queues

---
?fabrics.c | 11 +++++++++++
?1 file changed, 11 insertions(+)

fabrics.c +0 -0
index 942e987..18e961c 100644

fabrics.c struct config { · line 53

Quoted 4 lines
fabrics.c +1 -0
@@ -50,6 +50,7 @@ struct config {
 ?	char *traddr;
 ?	char *trsvcid;
 ?	char *hostnqn;
+	char *nr_io_queues;

I just noticed that the 'nr_io_queues' parameter type used in the host
driver code fabrics.c is unsigned int.??Would there be a truncation problem here, like say someone wants to do:

nvme connect --nr-io-queues=256

Quoted 8 lines
Quoted 2 lines

??

Truncation problem???How so???

This patch follows the other existing parameters.??For instance:
trsvcid.??It is basically an unstructured string that is passed to the driver and the driver does the enforcement/validation.

Oh yah, you are right, everything can be a string of variable length and gets converted accordingly...more coffee...

Reviewed-by Jay Freyensee <james_p_freyensee at linux.intel.com>
Quoted 8 lines

?
Steve.

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

Applied
#4 lore raw

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

Quoted 9 lines · J Freyensee
Quoted 3 lines · Steve Wise

This patch follows the other existing parameters.??For instance:
trsvcid.??It is basically an unstructured string that is passed to the driver and the driver does the enforcement/validation.

Oh yah, you are right, everything can be a string of variable length and gets converted accordingly...more coffee...

Reviewed-by Jay Freyensee <james_p_freyensee at linux.intel.com>

Thanks, applied.