From: Surabhi Gogte <sgogte@purestorage.com>
To: Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@kernel.dk>,
Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>
Cc: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org,
mkhalfella@purestorage.com, randyj@purestorage.com,
adailey@purestorage.com, Surabhi Gogte <sgogte@purestorage.com>,
Hannes Reinecke <hare@kernel.org>
Subject: [PATCH v4 2/3] nvme-tcp: refactor I/O queue setup path
Date: Tue, 22 Sep 2026 14:07:17 -0600 [thread overview]
Message-ID: <20260922200718.3941465-3-sgogte@purestorage.com> (raw)
In-Reply-To: <20260922200718.3941465-1-sgogte@purestorage.com>
Split the I/O queue setup helpers apart so that the individual steps can
be called directly from nvme_tcp_configure_io_queues():
- Queue count negotiation moves out of nvme_tcp_alloc_io_queues() into a
new nvme_tcp_set_io_queue_count(), leaving the allocator with just the
per-queue allocation loop.
- TLS PSK validation moves out of __nvme_tcp_alloc_io_queues() into a
new nvme_tcp_tls_check_psk().
- nvme_tcp_configure_io_queues() now calls the three steps directly in
the same order as before.
Signed-off-by: Surabhi Gogte <sgogte@purestorage.com>
Reviewed-by: Hannes Reinecke <hare@kernel.org>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
---
drivers/nvme/host/tcp.c | 25 +++++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
index f916bcca304f..9308feba8a74 100644
--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -2184,10 +2184,8 @@ static int nvme_tcp_alloc_admin_queue(struct nvme_ctrl *ctrl)
return ret;
}
-static int __nvme_tcp_alloc_io_queues(struct nvme_ctrl *ctrl)
+static int nvme_tcp_tls_check_psk(struct nvme_ctrl *ctrl)
{
- int i, ret;
-
if (nvme_tcp_tls_configured(ctrl)) {
if (ctrl->opts->concat) {
/*
@@ -2209,6 +2207,13 @@ static int __nvme_tcp_alloc_io_queues(struct nvme_ctrl *ctrl)
}
}
+ return 0;
+}
+
+static int __nvme_tcp_alloc_io_queues(struct nvme_ctrl *ctrl)
+{
+ int i, ret;
+
for (i = 1; i < ctrl->queue_count; i++) {
ret = nvme_tcp_alloc_queue(ctrl, i,
ctrl->tls_pskid);
@@ -2225,7 +2230,7 @@ static int __nvme_tcp_alloc_io_queues(struct nvme_ctrl *ctrl)
return ret;
}
-static int nvme_tcp_alloc_io_queues(struct nvme_ctrl *ctrl)
+static int nvme_tcp_set_io_queue_count(struct nvme_ctrl *ctrl)
{
unsigned int nr_io_queues;
int ret;
@@ -2247,14 +2252,22 @@ static int nvme_tcp_alloc_io_queues(struct nvme_ctrl *ctrl)
nvmf_set_io_queues(ctrl->opts, nr_io_queues,
to_tcp_ctrl(ctrl)->io_queues);
- return __nvme_tcp_alloc_io_queues(ctrl);
+ return 0;
}
static int nvme_tcp_configure_io_queues(struct nvme_ctrl *ctrl, bool new)
{
int ret, nr_queues;
- ret = nvme_tcp_alloc_io_queues(ctrl);
+ ret = nvme_tcp_set_io_queue_count(ctrl);
+ if (ret)
+ return ret;
+
+ ret = nvme_tcp_tls_check_psk(ctrl);
+ if (ret)
+ return ret;
+
+ ret = __nvme_tcp_alloc_io_queues(ctrl);
if (ret)
return ret;
--
2.55.0
next prev parent reply other threads:[~2026-09-22 20:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-22 20:07 [PATCH v4 0/3] nvme-tcp: parallelize I/O setup queue in connect Surabhi Gogte
2026-09-22 20:07 ` [PATCH v4 1/3] nvme-tcp: store and use the caller's network namespace Surabhi Gogte
2026-09-22 20:07 ` Surabhi Gogte [this message]
2026-09-22 20:07 ` [PATCH v4 3/3] nvme-tcp: parallelize I/O queue allocation and startup Surabhi Gogte
2026-10-18 12:25 ` Shin'ichiro Kawasaki
2026-10-13 15:33 ` [PATCH v4 0/3] nvme-tcp: parallelize I/O setup queue in connect Keith Busch
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=20260922200718.3941465-3-sgogte@purestorage.com \
--to=sgogte@purestorage.com \
--cc=adailey@purestorage.com \
--cc=axboe@kernel.dk \
--cc=hare@kernel.org \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=mkhalfella@purestorage.com \
--cc=randyj@purestorage.com \
--cc=sagi@grimberg.me \
/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: link
Be 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.