]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/nvme/host/fabrics.c
nvme-fabrics: allow user to pass in nr_poll_queues
[linux.git] / drivers / nvme / host / fabrics.c
index d93a169f640310fc746e6c981609f1411da0d4c6..b2ab213f43dead83370a883ad64e8875de964c41 100644 (file)
@@ -441,7 +441,7 @@ EXPORT_SYMBOL_GPL(nvmf_connect_admin_queue);
  *     > 0: NVMe error status code
  *     < 0: Linux errno error code
  */
-int nvmf_connect_io_queue(struct nvme_ctrl *ctrl, u16 qid)
+int nvmf_connect_io_queue(struct nvme_ctrl *ctrl, u16 qid, bool poll)
 {
        struct nvme_command cmd;
        struct nvmf_connect_data *data;
@@ -468,7 +468,7 @@ int nvmf_connect_io_queue(struct nvme_ctrl *ctrl, u16 qid)
 
        ret = __nvme_submit_sync_cmd(ctrl->connect_q, &cmd, &res,
                        data, sizeof(*data), 0, qid, 1,
-                       BLK_MQ_REQ_RESERVED | BLK_MQ_REQ_NOWAIT, false);
+                       BLK_MQ_REQ_RESERVED | BLK_MQ_REQ_NOWAIT, poll);
        if (ret) {
                nvmf_log_connect_error(ctrl, ret, le32_to_cpu(res.u32),
                                       &cmd, data);
@@ -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);