linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] nvme-cli/fabrics: Add nr_io_queues parameter to connect command
@ 2016-08-29 15:53 Steve Wise
  2016-08-29 18:52 ` J Freyensee
  0 siblings, 1 reply; 5+ messages in thread
From: Steve Wise @ 2016-08-29 15:53 UTC (permalink / raw)


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(+)

diff --git a/fabrics.c b/fabrics.c
index 942e987..18e961c 100644
--- a/fabrics.c
+++ b/fabrics.c
@@ -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},
 	};
 
-- 
2.7.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2] nvme-cli/fabrics: Add nr_io_queues parameter to connect command
  2016-08-29 15:53 [PATCH v2] nvme-cli/fabrics: Add nr_io_queues parameter to connect command Steve Wise
@ 2016-08-29 18:52 ` J Freyensee
  2016-08-29 19:18   ` Steve Wise
  0 siblings, 1 reply; 5+ messages in thread
From: J Freyensee @ 2016-08-29 18:52 UTC (permalink / raw)


On Mon, 2016-08-29@08:53 -0700, Steve Wise wrote:
> 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(+)
> 
> diff --git a/fabrics.c b/fabrics.c
> index 942e987..18e961c 100644
> --- a/fabrics.c
> +++ b/fabrics.c
> @@ -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.

> ?	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},
> ?	};
> ?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] nvme-cli/fabrics: Add nr_io_queues parameter to connect command
  2016-08-29 18:52 ` J Freyensee
@ 2016-08-29 19:18   ` Steve Wise
  2016-08-29 19:39     ` J Freyensee
  0 siblings, 1 reply; 5+ messages in thread
From: Steve Wise @ 2016-08-29 19:18 UTC (permalink / raw)


> On Mon, 2016-08-29@08:53 -0700, Steve Wise wrote:
> > 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(+)
> >
> > diff --git a/fabrics.c b/fabrics.c
> > index 942e987..18e961c 100644
> > --- a/fabrics.c
> > +++ b/fabrics.c
> > @@ -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
> 
> ??
>

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] nvme-cli/fabrics: Add nr_io_queues parameter to connect command
  2016-08-29 19:18   ` Steve Wise
@ 2016-08-29 19:39     ` J Freyensee
  2016-08-31 14:54       ` Keith Busch
  0 siblings, 1 reply; 5+ messages in thread
From: J Freyensee @ 2016-08-29 19:39 UTC (permalink / raw)


On Mon, 2016-08-29@14:18 -0500, Steve Wise wrote:
> > 
> > On Mon, 2016-08-29@08:53 -0700, Steve Wise wrote:
> > > 
> > > 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(+)
> > > 
> > > diff --git a/fabrics.c b/fabrics.c
> > > index 942e987..18e961c 100644
> > > --- a/fabrics.c
> > > +++ b/fabrics.c
> > > @@ -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
> > 
> > ??
> > 
> 
> 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>

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] nvme-cli/fabrics: Add nr_io_queues parameter to connect command
  2016-08-29 19:39     ` J Freyensee
@ 2016-08-31 14:54       ` Keith Busch
  0 siblings, 0 replies; 5+ messages in thread
From: Keith Busch @ 2016-08-31 14:54 UTC (permalink / raw)


On Mon, Aug 29, 2016@12:39:13PM -0700, J Freyensee wrote:
> On Mon, 2016-08-29@14:18 -0500, Steve Wise wrote:
> > 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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-08-31 14:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-29 15:53 [PATCH v2] nvme-cli/fabrics: Add nr_io_queues parameter to connect command Steve Wise
2016-08-29 18:52 ` J Freyensee
2016-08-29 19:18   ` Steve Wise
2016-08-29 19:39     ` J Freyensee
2016-08-31 14:54       ` Keith Busch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).