From: Steve Wise Date: Mon, 29 Aug 2016 15:53:02 +0000 (-0700) Subject: nvme-cli/fabrics: Add nr_io_queues parameter to connect command X-Git-Tag: v0.9~1 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=3a26b7936234bf7270f752ac86be00bb4550fb80;p=users%2Fsagi%2Fnvme-cli.git 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 Reviewed-by: Jay Freyensee --- diff --git a/fabrics.c b/fabrics.c index 942e987b..18e961ce 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}, };