From: Sagi Grimberg <sagi@grimberg.me> To: linux-nvme@lists.infradead.org Cc: Christoph Hellwig <hch@lst.de>, Keith Busch <keith.busch@intel.com>, linux-block@vger.kernel.org, Jens Axboe <axboe@kernel.dk> Subject: [PATCH 3/5] nvme-fabrics: allow user to set nr_write_queues for separate queue maps Date: Tue, 11 Dec 2018 02:49:33 -0800 [thread overview] Message-ID: <20181211104936.25333-4-sagi@grimberg.me> (raw) In-Reply-To: <20181211104936.25333-1-sagi@grimberg.me> This argument will specify how many I/O queues will be connected in create_ctrl in addition to nr_io_queues. With this configuration, I/O that carries payload from the host to the target, will use the default hctx queue map, and I/O that involves target to host transfers will use the read hctx queue map. Signed-off-by: Sagi Grimberg <sagi@grimberg.me> --- drivers/nvme/host/fabrics.c | 15 ++++++++++++++- drivers/nvme/host/fabrics.h | 3 +++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c index 9c62c6838b76..066c3a02e08b 100644 --- a/drivers/nvme/host/fabrics.c +++ b/drivers/nvme/host/fabrics.c @@ -616,6 +616,7 @@ static const match_table_t opt_tokens = { { NVMF_OPT_DISABLE_SQFLOW, "disable_sqflow" }, { NVMF_OPT_HDR_DIGEST, "hdr_digest" }, { NVMF_OPT_DATA_DIGEST, "data_digest" }, + { NVMF_OPT_NR_WRITE_QUEUES, "nr_write_queues=%d" }, { NVMF_OPT_ERR, NULL } }; @@ -837,6 +838,18 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts, case NVMF_OPT_DATA_DIGEST: opts->data_digest = true; break; + case NVMF_OPT_NR_WRITE_QUEUES: + if (match_int(args, &token)) { + ret = -EINVAL; + goto out; + } + if (token <= 0) { + pr_err("Invalid nr_write_queues %d\n", token); + ret = -EINVAL; + goto out; + } + opts->nr_write_queues = token; + break; default: pr_warn("unknown parameter or missing value '%s' in ctrl creation request\n", p); @@ -954,7 +967,7 @@ EXPORT_SYMBOL_GPL(nvmf_free_options); #define NVMF_ALLOWED_OPTS (NVMF_OPT_QUEUE_SIZE | NVMF_OPT_NR_IO_QUEUES | \ NVMF_OPT_KATO | NVMF_OPT_HOSTNQN | \ NVMF_OPT_HOST_ID | NVMF_OPT_DUP_CONNECT |\ - NVMF_OPT_DISABLE_SQFLOW) + NVMF_OPT_DISABLE_SQFLOW | NVMF_OPT_NR_WRITE_QUEUES) static struct nvme_ctrl * nvmf_create_ctrl(struct device *dev, const char *buf, size_t count) diff --git a/drivers/nvme/host/fabrics.h b/drivers/nvme/host/fabrics.h index 28dc916ef26b..81b8fd1c0c5d 100644 --- a/drivers/nvme/host/fabrics.h +++ b/drivers/nvme/host/fabrics.h @@ -61,6 +61,7 @@ enum { NVMF_OPT_DISABLE_SQFLOW = 1 << 14, NVMF_OPT_HDR_DIGEST = 1 << 15, NVMF_OPT_DATA_DIGEST = 1 << 16, + NVMF_OPT_NR_WRITE_QUEUES = 1 << 17, }; /** @@ -91,6 +92,7 @@ enum { * @disable_sqflow: disable controller sq flow control * @hdr_digest: generate/verify header digest (TCP) * @data_digest: generate/verify data digest (TCP) + * @nr_write_queues: number of queues for write I/O */ struct nvmf_ctrl_options { unsigned mask; @@ -110,6 +112,7 @@ struct nvmf_ctrl_options { bool disable_sqflow; bool hdr_digest; bool data_digest; + unsigned int nr_write_queues; }; /* -- 2.17.1
WARNING: multiple messages have this Message-ID (diff)
From: sagi@grimberg.me (Sagi Grimberg) Subject: [PATCH 3/5] nvme-fabrics: allow user to set nr_write_queues for separate queue maps Date: Tue, 11 Dec 2018 02:49:33 -0800 [thread overview] Message-ID: <20181211104936.25333-4-sagi@grimberg.me> (raw) In-Reply-To: <20181211104936.25333-1-sagi@grimberg.me> This argument will specify how many I/O queues will be connected in create_ctrl in addition to nr_io_queues. With this configuration, I/O that carries payload from the host to the target, will use the default hctx queue map, and I/O that involves target to host transfers will use the read hctx queue map. Signed-off-by: Sagi Grimberg <sagi at grimberg.me> --- drivers/nvme/host/fabrics.c | 15 ++++++++++++++- drivers/nvme/host/fabrics.h | 3 +++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c index 9c62c6838b76..066c3a02e08b 100644 --- a/drivers/nvme/host/fabrics.c +++ b/drivers/nvme/host/fabrics.c @@ -616,6 +616,7 @@ static const match_table_t opt_tokens = { { NVMF_OPT_DISABLE_SQFLOW, "disable_sqflow" }, { NVMF_OPT_HDR_DIGEST, "hdr_digest" }, { NVMF_OPT_DATA_DIGEST, "data_digest" }, + { NVMF_OPT_NR_WRITE_QUEUES, "nr_write_queues=%d" }, { NVMF_OPT_ERR, NULL } }; @@ -837,6 +838,18 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts, case NVMF_OPT_DATA_DIGEST: opts->data_digest = true; break; + case NVMF_OPT_NR_WRITE_QUEUES: + if (match_int(args, &token)) { + ret = -EINVAL; + goto out; + } + if (token <= 0) { + pr_err("Invalid nr_write_queues %d\n", token); + ret = -EINVAL; + goto out; + } + opts->nr_write_queues = token; + break; default: pr_warn("unknown parameter or missing value '%s' in ctrl creation request\n", p); @@ -954,7 +967,7 @@ EXPORT_SYMBOL_GPL(nvmf_free_options); #define NVMF_ALLOWED_OPTS (NVMF_OPT_QUEUE_SIZE | NVMF_OPT_NR_IO_QUEUES | \ NVMF_OPT_KATO | NVMF_OPT_HOSTNQN | \ NVMF_OPT_HOST_ID | NVMF_OPT_DUP_CONNECT |\ - NVMF_OPT_DISABLE_SQFLOW) + NVMF_OPT_DISABLE_SQFLOW | NVMF_OPT_NR_WRITE_QUEUES) static struct nvme_ctrl * nvmf_create_ctrl(struct device *dev, const char *buf, size_t count) diff --git a/drivers/nvme/host/fabrics.h b/drivers/nvme/host/fabrics.h index 28dc916ef26b..81b8fd1c0c5d 100644 --- a/drivers/nvme/host/fabrics.h +++ b/drivers/nvme/host/fabrics.h @@ -61,6 +61,7 @@ enum { NVMF_OPT_DISABLE_SQFLOW = 1 << 14, NVMF_OPT_HDR_DIGEST = 1 << 15, NVMF_OPT_DATA_DIGEST = 1 << 16, + NVMF_OPT_NR_WRITE_QUEUES = 1 << 17, }; /** @@ -91,6 +92,7 @@ enum { * @disable_sqflow: disable controller sq flow control * @hdr_digest: generate/verify header digest (TCP) * @data_digest: generate/verify data digest (TCP) + * @nr_write_queues: number of queues for write I/O */ struct nvmf_ctrl_options { unsigned mask; @@ -110,6 +112,7 @@ struct nvmf_ctrl_options { bool disable_sqflow; bool hdr_digest; bool data_digest; + unsigned int nr_write_queues; }; /* -- 2.17.1
next prev parent reply other threads:[~2018-12-11 10:50 UTC|newest] Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-12-11 10:49 [PATCH 0/5] implement nvmf read/write queue maps Sagi Grimberg 2018-12-11 10:49 ` Sagi Grimberg 2018-12-11 10:49 ` [PATCH 1/5] blk-mq-rdma: pass in queue map to blk_mq_rdma_map_queues Sagi Grimberg 2018-12-11 10:49 ` Sagi Grimberg 2018-12-11 13:34 ` Christoph Hellwig 2018-12-11 13:34 ` Christoph Hellwig 2018-12-11 10:49 ` [PATCH 2/5] nvme-fabrics: add missing nvmf_ctrl_options documentation Sagi Grimberg 2018-12-11 10:49 ` Sagi Grimberg 2018-12-11 13:35 ` Christoph Hellwig 2018-12-11 13:35 ` Christoph Hellwig 2018-12-11 10:49 ` Sagi Grimberg [this message] 2018-12-11 10:49 ` [PATCH 3/5] nvme-fabrics: allow user to set nr_write_queues for separate queue maps Sagi Grimberg 2018-12-11 13:35 ` Christoph Hellwig 2018-12-11 13:35 ` Christoph Hellwig 2018-12-11 10:49 ` [PATCH 4/5] nvme-tcp: support separate queue maps for read and write Sagi Grimberg 2018-12-11 10:49 ` Sagi Grimberg 2018-12-11 13:41 ` Christoph Hellwig 2018-12-11 13:41 ` Christoph Hellwig 2018-12-11 23:11 ` Sagi Grimberg 2018-12-11 23:11 ` Sagi Grimberg 2018-12-11 10:49 ` [PATCH 5/5] nvme-rdma: support read/write queue separation Sagi Grimberg 2018-12-11 10:49 ` Sagi Grimberg 2018-12-11 13:42 ` Christoph Hellwig 2018-12-11 13:42 ` Christoph Hellwig 2018-12-11 10:49 ` [PATCH nvme-cli 6/5] fabrics: pass in nr_write_queues Sagi Grimberg 2018-12-11 10:49 ` Sagi Grimberg 2018-12-11 19:30 ` Keith Busch 2018-12-11 19:30 ` Keith Busch 2018-12-11 23:34 ` Sagi Grimberg 2018-12-11 23:34 ` Sagi Grimberg 2018-12-11 13:28 ` [PATCH 0/5] implement nvmf read/write queue maps Christoph Hellwig 2018-12-11 13:28 ` Christoph Hellwig
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20181211104936.25333-4-sagi@grimberg.me \ --to=sagi@grimberg.me \ --cc=axboe@kernel.dk \ --cc=hch@lst.de \ --cc=keith.busch@intel.com \ --cc=linux-block@vger.kernel.org \ --cc=linux-nvme@lists.infradead.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.