]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
fabrics: pass in number of write queues
authorSagi Grimberg <sagi@grimberg.me>
Thu, 13 Dec 2018 06:07:49 +0000 (22:07 -0800)
committerKeith Busch <keith.busch@intel.com>
Wed, 2 Jan 2019 15:45:02 +0000 (08:45 -0700)
nr_write_queues specifies the number of additional queues that
will be connected. These queues will host write I/O (host to target
payload) while nr_io_queues will host read I/O (target to host payload).

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Documentation/nvme-connect.txt
fabrics.c

index af78b2a8238fe24d8aa721c62a14701564f7cc11..d4a0e6678475b5d88595b0d567360ec9aee207fe 100644 (file)
@@ -16,6 +16,7 @@ SYNOPSIS
                [--host-traddr=<traddr>   | -w <traddr>]
                [--hostnqn=<hostnqn>      | -q <hostnqn>]
                [--nr-io-queues=<#>       | -i <#>]
+               [--nr-write-queues=<#>    | -W <#>]
                [--queue-size=<#>         | -Q <#>]
                [--keep-alive-tmo=<#>     | -k <#>]
                [--reconnect-delay=<#>    | -c <#>]
@@ -75,6 +76,10 @@ OPTIONS
 --nr-io-queues=<#>::
        Overrides the default number of I/O queues create by the driver.
 
+-W <#>::
+--nr-write-queues=<#>::
+       Adds additional queues that will be used for write I/O.
+
 -Q <#>::
 --queue-size=<#>::
        Overrides the default number of elements in the I/O queues created
index 394cba406a8852a96e1d6b749e532ce13faa438f..c1f0198ed07b8334ce1a6db6c207b148531e3dfd 100644 (file)
--- a/fabrics.c
+++ b/fabrics.c
@@ -53,6 +53,7 @@ static struct config {
        char *hostnqn;
        char *hostid;
        int  nr_io_queues;
+       int  nr_write_queues;
        int  queue_size;
        int  keep_alive_tmo;
        int  reconnect_delay;
@@ -607,6 +608,8 @@ static int build_options(char *argstr, int max_len)
                    add_argument(&argstr, &max_len, "hostid", cfg.hostid)) ||
            add_int_argument(&argstr, &max_len, "nr_io_queues",
                                cfg.nr_io_queues) ||
+           add_int_argument(&argstr, &max_len, "nr_write_queues",
+                               cfg.nr_write_queues) ||
            add_int_argument(&argstr, &max_len, "queue_size", cfg.queue_size) ||
            add_int_argument(&argstr, &max_len, "keep_alive_tmo",
                                cfg.keep_alive_tmo) ||
@@ -680,6 +683,13 @@ retry:
                p += len;
        }
 
+       if (cfg.nr_write_queues) {
+               len = sprintf(p, ",nr_write_queues=%d", cfg.nr_write_queues);
+               if (len < 0)
+                       return -EINVAL;
+               p += len;
+       }
+
        if (cfg.host_traddr) {
                len = sprintf(p, ",host_traddr=%s", cfg.host_traddr);
                if (len < 0)
@@ -984,6 +994,8 @@ int connect(const char *desc, int argc, char **argv)
                {"hostnqn",         'q', "LIST", CFG_STRING, &cfg.hostnqn,         required_argument, "user-defined hostnqn" },
                {"hostid",          'I', "LIST", CFG_STRING, &cfg.hostid,      required_argument, "user-defined hostid (if default not used)"},
                {"nr-io-queues",    'i', "LIST", CFG_INT, &cfg.nr_io_queues,    required_argument, "number of io queues to use (default is core count)" },
+               {"nr-write-queues", 'W', "LIST", CFG_INT, &cfg.nr_write_queues,    required_argument, "number of write queues to use (default 0)" },
+               {"nr-poll-queues",  'P', "LIST", CFG_INT, &cfg.nr_poll_queues,    required_argument, "number of poll queues to use (default 0)" },
                {"queue-size",      'Q', "LIST", CFG_INT, &cfg.queue_size,      required_argument, "number of io queue elements to use (default 128)" },
                {"keep-alive-tmo",  'k', "LIST", CFG_INT, &cfg.keep_alive_tmo,  required_argument, "keep alive timeout period in seconds" },
                {"reconnect-delay", 'c', "LIST", CFG_INT, &cfg.reconnect_delay, required_argument, "reconnect timeout period in seconds" },