nvme-fabrics: allow user to pass in nr_poll_queues
authorSagi Grimberg <sagi@grimberg.me>
Fri, 14 Dec 2018 19:06:09 +0000 (11:06 -0800)
committerChristoph Hellwig <hch@lst.de>
Tue, 18 Dec 2018 16:50:49 +0000 (17:50 +0100)
This argument will specify how many polling I/O queues to connect when
creating the controller. These I/O queues will host I/O that is set with
REQ_HIPRI.

Reviewed-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/fabrics.c
drivers/nvme/host/fabrics.h

index 5ff14f46a8d931bb71e45dc594e9bc639b87fb15..b2ab213f43dead83370a883ad64e8875de964c41 100644 (file)
@@ -617,6 +617,7 @@ static const match_table_t opt_tokens = {
        { NVMF_OPT_HDR_DIGEST,          "hdr_digest"            },
        { NVMF_OPT_DATA_DIGEST,         "data_digest"           },
        { NVMF_OPT_NR_WRITE_QUEUES,     "nr_write_queues=%d"    },
+       { NVMF_OPT_NR_POLL_QUEUES,      "nr_poll_queues=%d"     },
        { NVMF_OPT_ERR,                 NULL                    }
 };
 
@@ -850,6 +851,18 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
                        }
                        opts->nr_write_queues = token;
                        break;
+               case NVMF_OPT_NR_POLL_QUEUES:
+                       if (match_int(args, &token)) {
+                               ret = -EINVAL;
+                               goto out;
+                       }
+                       if (token <= 0) {
+                               pr_err("Invalid nr_poll_queues %d\n", token);
+                               ret = -EINVAL;
+                               goto out;
+                       }
+                       opts->nr_poll_queues = token;
+                       break;
                default:
                        pr_warn("unknown parameter or missing value '%s' in ctrl creation request\n",
                                p);
index cad70a9f976aab1254a62a4d7f41fb98265fb5bf..478343b73e385c512e9967a17a4beb0d8604d68a 100644 (file)
@@ -62,6 +62,7 @@ enum {
        NVMF_OPT_HDR_DIGEST     = 1 << 15,
        NVMF_OPT_DATA_DIGEST    = 1 << 16,
        NVMF_OPT_NR_WRITE_QUEUES = 1 << 17,
+       NVMF_OPT_NR_POLL_QUEUES = 1 << 18,
 };
 
 /**
@@ -93,6 +94,7 @@ enum {
  * @hdr_digest: generate/verify header digest (TCP)
  * @data_digest: generate/verify data digest (TCP)
  * @nr_write_queues: number of queues for write I/O
+ * @nr_poll_queues: number of queues for polling I/O
  */
 struct nvmf_ctrl_options {
        unsigned                mask;
@@ -113,6 +115,7 @@ struct nvmf_ctrl_options {
        bool                    hdr_digest;
        bool                    data_digest;
        unsigned int            nr_write_queues;
+       unsigned int            nr_poll_queues;
 };
 
 /*