From: Sagi Grimberg <sagi@grimberg.me>
To: "Surabhi Gogte (she/her)" <sgogte@purestorage.com>
Cc: Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@kernel.dk>,
Christoph Hellwig <hch@lst.de>,
linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org,
mkhalfella@purestorage.com, randyj@purestorage.com,
adailey@purestorage.com
Subject: Re: [PATCH v2 2/2] nvme-tcp: parallelize I/O queue allocation and startup
Date: Sun, 6 Sep 2026 01:30:03 +0300 [thread overview]
Message-ID: <39448561-8877-4e20-98e6-fd85acc3d569@grimberg.me> (raw)
In-Reply-To: <CAMof9cWdXR_040SDs2N=3ETvdmxvjx+OokfkSDr7DzVbLbuenQ@mail.gmail.com>
>>> qid, queue->io_cpu);
>>> @@ -1846,7 +1856,7 @@ static int nvme_tcp_alloc_queue(struct nvme_ctrl *nctrl, int qid,
>>> queue->cmnd_capsule_len = sizeof(struct nvme_command) +
>>> NVME_TCP_ADMIN_CCSZ;
>>>
>>> - ret = sock_create_kern(current->nsproxy->net_ns,
>>> + ret = sock_create_kern(&init_net,
>> I don't think we can just change this...
> Passing init_net explicitly does change behavior on the synchronous connect
> path. However, with queue allocation now moved into an async worker,
> current->nsproxy->net_ns resolves to init_net in that context anyway, so
> the initial connect path already loses the caller's netns regardless of
> which argument is passed.
>
> If the goal is to actually preserve the caller's netns through the full
> ctrl lifecycle - initial connect, reconnect, and error recovery; it can
> be pinned at ctrl creation like:
>
> nvme_tcp_alloc_ctrl():
> to_tcp_ctrl(ctrl)->net = get_net(current->nsproxy->net_ns);
>
> nvme_tcp_free_ctrl():
> put_net(to_tcp_ctrl(ctrl)->net);
>
> nvme_tcp_alloc_queue():
> sock_create_kern(to_tcp_ctrl(ctrl)->net, ...);
>
> This captures the caller's netns while still in userspace context, then
> carries it through all async paths — so reconnect and error recovery
> also honor the original netns rather than falling back to the kworker's
> init_net.
>
> Is this approach preferred?
Yes I think so
next prev parent reply other threads:[~2026-09-05 22:30 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-24 22:56 [PATCH v2 0/2] nvme-tcp: parallelize I/O queue connect Surabhi Gogte
2026-08-24 22:56 ` [PATCH v2 1/2] nvme-tcp: refactor I/O queue setup path Surabhi Gogte
2026-08-24 23:36 ` Randy Jennings
2026-08-30 21:56 ` Sagi Grimberg
2026-09-02 21:25 ` Surabhi Gogte (she/her)
2026-08-24 22:56 ` [PATCH v2 2/2] nvme-tcp: parallelize I/O queue allocation and startup Surabhi Gogte
2026-08-24 23:58 ` Randy Jennings
2026-08-30 22:00 ` Sagi Grimberg
2026-08-30 22:25 ` Mohamed Khalfella
2026-08-30 22:44 ` Sagi Grimberg
2026-08-30 22:59 ` Mohamed Khalfella
2026-09-04 16:04 ` Surabhi Gogte (she/her)
2026-09-05 22:29 ` Sagi Grimberg
2026-09-04 16:05 ` Surabhi Gogte (she/her)
2026-09-05 22:30 ` Sagi Grimberg [this message]
2026-09-10 20:32 ` Surabhi Gogte (she/her)
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=39448561-8877-4e20-98e6-fd85acc3d569@grimberg.me \
--to=sagi@grimberg.me \
--cc=adailey@purestorage.com \
--cc=axboe@kernel.dk \
--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=sgogte@purestorage.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®