]> www.infradead.org Git - users/hch/nvme-cli.git/commitdiff
fabrics: add option to override drivers queue depth
authorJohannes Thumshirn <jthumshirn@suse.de>
Wed, 10 May 2017 09:04:12 +0000 (11:04 +0200)
committerKeith Busch <keith.busch@intel.com>
Wed, 10 May 2017 18:37:42 +0000 (14:37 -0400)
Currently it is not possible to override the fabrics drivers default queue
depth with the nvme userspace utility, but only when manually writing the
parameters to the /dev/nvme-fabrics character device.

Add an option to override the drivers default queue depth for NVMe over
fabrics.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Keith Busch <keith.busch@intel.com>
Documentation/nvme-connect.txt
fabrics.c

index 38fae399a21c6df0d3c2811d690575e18f12f973..a746a3a721ed4e4ed94c858ddf097ed60c6dde0e 100644 (file)
@@ -16,6 +16,7 @@ SYNOPSIS
                [--host-traddr=<traddr>   | -w <traddr>]
                [--hostnqn=<hostnqn>      | -q <hostnqn>]
                [--nr-io-queues=<#>       | -i <#>]
+               [--queue-size=<#>         | -Q <#>]
                [--keep-alive-tmo=<#>     | -k <#>]
                [--reconnect-delay=<#>    | -c <#>]
 
@@ -73,6 +74,11 @@ OPTIONS
 --nr-io-queues=<#>::
        Overrides the default number of I/O queues create by the driver.
 
+-Q <#>::
+--queue-size=<#>::
+       Overrides the default number of elements in the I/O queues created
+       by the driver.
+
 -k <#>::
 --keep-alive-tmo=<#>::
        Overrides the default keep alive timeout (in seconds).
index 6648bae42cf7f8d5807d6a68fab5b2ed665d63fe..a826ecc6ade406183a08e1f168ba8611d20e5045 100644 (file)
--- a/fabrics.c
+++ b/fabrics.c
@@ -52,6 +52,7 @@ static struct config {
        char *host_traddr;
        char *hostnqn;
        char *nr_io_queues;
+       char *queue_size;
        char *keep_alive_tmo;
        char *reconnect_delay;
        char *raw;
@@ -524,6 +525,15 @@ static int build_options(char *argstr, int max_len)
                max_len -= len;
        }
 
+       if (cfg.queue_size) {
+               len = snprintf(argstr, max_len, ",queue_size=%s",
+                               cfg.queue_size);
+               if (len < 0)
+                       return -EINVAL;
+               argstr += len;
+               max_len -= len;
+       }
+
        if (cfg.keep_alive_tmo) {
                len = snprintf(argstr, max_len, ",keep_alive_tmo=%s", cfg.keep_alive_tmo);
                if (len < 0)
@@ -805,6 +815,7 @@ int connect(const char *desc, int argc, char **argv)
                {"host-traddr",     'w', "LIST", CFG_STRING, &cfg.host_traddr,     required_argument, "host traddr (e.g. FC WWN's)" },
                {"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)" },
+               {"queue-size",      'Q', "LIST", CFG_STRING, &cfg.queue_size,      required_argument, "number of io queue elements to use (default 128)" },
                {"keep-alive-tmo",  'k', "LIST", CFG_STRING, &cfg.keep_alive_tmo,  required_argument, "keep alive timeout period in seconds" },
                {"reconnect-delay", 'c', "LIST", CFG_STRING, &cfg.reconnect_delay, required_argument, "reconnect timeout period in seconds" },
                {NULL},