linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/1] Preclude IOCCSZ/IORCSZ validation for admin controller connect
@ 2025-09-05 21:10 Kamaljit Singh
  2025-09-05 21:10 ` [PATCH v1 1/1] nvme-core: exclude ioccsz/iorcsz checks for admin ctrlr Kamaljit Singh
  0 siblings, 1 reply; 4+ messages in thread
From: Kamaljit Singh @ 2025-09-05 21:10 UTC (permalink / raw)
  To: kbusch, axboe, hch, sagi, linux-nvme, linux-kernel
  Cc: cassel, dlemoal, kamaljit.singh1, Kamaljit Singh

During negative testing it was observed that when ioccsz and/or iorcsz 
were cleared to zero on a Target, a new connection to an administrative 
controller failed to establish, due to driver validation of those fields. 
Since an administrative controller does not support I/O queues, these 
checks should be excluded for such a controller.

Kamaljit Singh (1):
  nvme-core: ignore ioccsz/iorcsz checks for admin ctrlr

 drivers/nvme/host/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.43.0



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v1 1/1] nvme-core: exclude ioccsz/iorcsz checks for admin ctrlr
  2025-09-05 21:10 [PATCH v1 0/1] Preclude IOCCSZ/IORCSZ validation for admin controller connect Kamaljit Singh
@ 2025-09-05 21:10 ` Kamaljit Singh
  2025-09-05 21:49   ` Keith Busch
  0 siblings, 1 reply; 4+ messages in thread
From: Kamaljit Singh @ 2025-09-05 21:10 UTC (permalink / raw)
  To: kbusch, axboe, hch, sagi, linux-nvme, linux-kernel
  Cc: cassel, dlemoal, kamaljit.singh1, Kamaljit Singh

An administrative controller does not support I/O queues, hence it
should exclude existing checks for IOCCSZ/IORCSZ.

Signed-off-by: Kamaljit Singh <kamaljit.singh@opensource.wdc.com>
---
 drivers/nvme/host/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index d67545bd7abb..ac72bae800a9 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -3491,14 +3491,14 @@ static int nvme_check_ctrl_fabric_info(struct nvme_ctrl *ctrl, struct nvme_id_ct
 		return -EINVAL;
 	}
 
-	if (!nvme_discovery_ctrl(ctrl) && ctrl->ioccsz < 4) {
+	if (!nvmf_discovery_ctrl(ctrl) && !nvme_admin_ctrl(ctrl) && ctrl->ioccsz < 4) {
 		dev_err(ctrl->device,
 			"I/O queue command capsule supported size %d < 4\n",
 			ctrl->ioccsz);
 		return -EINVAL;
 	}
 
-	if (!nvme_discovery_ctrl(ctrl) && ctrl->iorcsz < 1) {
+	if (!nvmf_discovery_ctrl(ctrl) && !nvme_admin_ctrl(ctrl) && ctrl->iorcsz < 1) {
 		dev_err(ctrl->device,
 			"I/O queue response capsule supported size %d < 1\n",
 			ctrl->iorcsz);
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v1 1/1] nvme-core: exclude ioccsz/iorcsz checks for admin ctrlr
  2025-09-05 21:10 ` [PATCH v1 1/1] nvme-core: exclude ioccsz/iorcsz checks for admin ctrlr Kamaljit Singh
@ 2025-09-05 21:49   ` Keith Busch
  2025-09-05 22:14     ` Kamaljit Singh
  0 siblings, 1 reply; 4+ messages in thread
From: Keith Busch @ 2025-09-05 21:49 UTC (permalink / raw)
  To: Kamaljit Singh
  Cc: axboe, hch, sagi, linux-nvme, linux-kernel, cassel, dlemoal,
	kamaljit.singh1

On Fri, Sep 05, 2025 at 02:10:01PM -0700, Kamaljit Singh wrote:
> An administrative controller does not support I/O queues, hence it
> should exclude existing checks for IOCCSZ/IORCSZ.
> 
> Signed-off-by: Kamaljit Singh <kamaljit.singh@opensource.wdc.com>
> ---
>  drivers/nvme/host/core.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index d67545bd7abb..ac72bae800a9 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -3491,14 +3491,14 @@ static int nvme_check_ctrl_fabric_info(struct nvme_ctrl *ctrl, struct nvme_id_ct
>  		return -EINVAL;
>  	}
>  
> -	if (!nvme_discovery_ctrl(ctrl) && ctrl->ioccsz < 4) {
> +	if (!nvmf_discovery_ctrl(ctrl) && !nvme_admin_ctrl(ctrl) && ctrl->ioccsz < 4) {
>  		dev_err(ctrl->device,
>  			"I/O queue command capsule supported size %d < 4\n",
>  			ctrl->ioccsz);
>  		return -EINVAL;
>  	}
>  
> -	if (!nvme_discovery_ctrl(ctrl) && ctrl->iorcsz < 1) {
> +	if (!nvmf_discovery_ctrl(ctrl) && !nvme_admin_ctrl(ctrl) && ctrl->iorcsz < 1) {

Excessive line length over 80 chars.

Perhaps, though, we should have a helper to indicate IO controllers
rather than chaining conditions for everything that isn't one.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1 1/1] nvme-core: exclude ioccsz/iorcsz checks for admin ctrlr
  2025-09-05 21:49   ` Keith Busch
@ 2025-09-05 22:14     ` Kamaljit Singh
  0 siblings, 0 replies; 4+ messages in thread
From: Kamaljit Singh @ 2025-09-05 22:14 UTC (permalink / raw)
  To: Keith Busch
  Cc: axboe, hch, sagi, linux-nvme, linux-kernel, cassel, dlemoal,
	kamaljit.singh1

On Fri, Sep 05, 2025 at 03:49:23PM -0600, Keith Busch wrote:
> On Fri, Sep 05, 2025 at 02:10:01PM -0700, Kamaljit Singh wrote:
> > An administrative controller does not support I/O queues, hence it
> > should exclude existing checks for IOCCSZ/IORCSZ.
> > 
> > -	if (!nvme_discovery_ctrl(ctrl) && ctrl->iorcsz < 1) {
> > +	if (!nvmf_discovery_ctrl(ctrl) && !nvme_admin_ctrl(ctrl) && ctrl->iorcsz < 1) {
> 
> Excessive line length over 80 chars.
> 
> Perhaps, though, we should have a helper to indicate IO controllers
> rather than chaining conditions for everything that isn't one.
Sure, I'll add a new function nvme_is_io_controller() and make it dependent 
on nvmf_discovery_ctrl() and nvme_admin_ctrl(). How does that sound?

Thanks,
Kamaljit


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-09-06  0:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-05 21:10 [PATCH v1 0/1] Preclude IOCCSZ/IORCSZ validation for admin controller connect Kamaljit Singh
2025-09-05 21:10 ` [PATCH v1 1/1] nvme-core: exclude ioccsz/iorcsz checks for admin ctrlr Kamaljit Singh
2025-09-05 21:49   ` Keith Busch
2025-09-05 22:14     ` Kamaljit Singh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).