From: Niklas Cassel <cassel@kernel.org>
To: Keith Busch <kbusch@kernel.org>
Cc: Kamaljit Singh <kamaljit.singh1@wdc.com>,
axboe@kernel.dk, hch@lst.de, sagi@grimberg.me,
linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org,
niklas.cassel@wdc.com, damien.lemoal@wdc.com
Subject: Re: [PATCH v1 1/1] nvme: add admin controller support. prohibit ioq creation for admin & disco ctrlrs
Date: Tue, 1 Apr 2025 10:04:43 +0200 [thread overview]
Message-ID: <Z-ueG-wTibsSu5lK@ryzen> (raw)
In-Reply-To: <Z-qur5YnK2ZtiRR3@kbusch-mbp.dhcp.thefacebook.com>
On Mon, Mar 31, 2025 at 09:03:11AM -0600, Keith Busch wrote:
> On Fri, Mar 28, 2025 at 02:36:40PM -0700, Kamaljit Singh wrote:
> > -static inline bool nvme_discovery_ctrl(struct nvme_ctrl *ctrl)
> > -{
> > - return ctrl->opts && ctrl->opts->discovery_nqn;
> > -}
> > -
>
> I suppose it's fine to rename this function with an nvmf_ prefix, but
> it's not really related to the rest of the patch and makes the diff
> larger than necessary.
>
> > + /* An admin or discovery controller has one admin queue, but no I/O queues */
> > + if (nvme_admin_ctrl(&ctrl->ctrl) || nvmf_discovery_ctrl(&ctrl->ctrl)) {
> > + ctrl->ctrl.queue_count = 1;
> > + } else if (ctrl->ctrl.queue_count < 2) {
> > + /* I/O controller with no I/O queues is not allowed */
> > + ret = -EOPNOTSUPP;
> > + dev_err(ctrl->ctrl.device,
> > + "I/O controller doesn't allow zero I/O queues!\n");
> > + goto destroy_admin;
> > + }
>
> The queue_count comes from the user. If the user provides a bad value
> for an IO controller, you're erroring. If they provide a bad value for a
> discovery or admin controller, you override the value. Why the different
> behavior?
>
Good question.
My initial proposal was simply to override the user provided value
to 1 (admin queue only) in case of admin (or discovery) controller.
The check for queue_count < 2 should be in a separate patch, if we
want that check at all. But to be honest, the code did previously
allow an I/O controller with just the admin queue and no I/O queues.
Thus, without a commit message explaining clearly why we should start
to disallow an I/O controller with just the admin queue, I think that
additional check is wrong.
Kind regards,
Niklas
next prev parent reply other threads:[~2025-04-01 8:04 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-28 21:36 [PATCH v1 0/1] nvme: add admin controller support. prohibit ioq creation for admin & disco ctrlrs Kamaljit Singh
2025-03-28 21:36 ` [PATCH v1 1/1] " Kamaljit Singh
2025-03-28 22:09 ` Damien Le Moal
[not found] ` <BY5PR04MB6849189D63EBB6EF4B66AD42BCAD2@BY5PR04MB6849.namprd04.prod.outlook.com>
2025-04-01 22:47 ` Kamaljit Singh
2025-03-31 7:25 ` Niklas Cassel
[not found] ` <BY5PR04MB68491AD9C47CD7AB9B552098BCAC2@BY5PR04MB6849.namprd04.prod.outlook.com>
2025-04-01 22:52 ` Kamaljit Singh
2025-03-31 15:03 ` Keith Busch
2025-04-01 2:20 ` Chaitanya Kulkarni
2025-04-01 8:04 ` Niklas Cassel [this message]
[not found] ` <BY5PR04MB68496CB7512F91FEA30DFF86BCAC2@BY5PR04MB6849.namprd04.prod.outlook.com>
2025-04-01 22:57 ` Kamaljit Singh
2025-04-02 6:37 ` Niklas Cassel
2025-04-02 21:03 ` Kamaljit Singh
2025-04-03 4:49 ` Christoph Hellwig
2025-04-03 18:59 ` 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=Z-ueG-wTibsSu5lK@ryzen \
--to=cassel@kernel.org \
--cc=axboe@kernel.dk \
--cc=damien.lemoal@wdc.com \
--cc=hch@lst.de \
--cc=kamaljit.singh1@wdc.com \
--cc=kbusch@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=niklas.cassel@wdc.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.