All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Preclude IOCCSZ/IORCSZ validation for admin controller connect
@ 2025-09-05 23:25 Kamaljit Singh
  2025-09-05 23:25 ` [PATCH v2 1/2] nvme-core: add method to check for an I/O controller Kamaljit Singh
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Kamaljit Singh @ 2025-09-05 23:25 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 (2):
  nvme-core: add method to check for an I/O controller
  nvme-core: do ioccsz/iorcsz validation only for I/O controllers

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

-- 
2.43.0



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

* [PATCH v2 1/2] nvme-core: add method to check for an I/O controller
  2025-09-05 23:25 [PATCH v2 0/2] Preclude IOCCSZ/IORCSZ validation for admin controller connect Kamaljit Singh
@ 2025-09-05 23:25 ` Kamaljit Singh
  2025-09-08 12:56   ` Hannes Reinecke
  2025-09-05 23:25 ` [PATCH v2 2/2] nvme-core: do ioccsz/iorcsz validation only for I/O controllers Kamaljit Singh
  2025-09-17 22:41 ` [PATCH v2 0/2] Preclude IOCCSZ/IORCSZ validation for admin controller connect Keith Busch
  2 siblings, 1 reply; 8+ messages in thread
From: Kamaljit Singh @ 2025-09-05 23:25 UTC (permalink / raw)
  To: kbusch, axboe, hch, sagi, linux-nvme, linux-kernel
  Cc: cassel, dlemoal, kamaljit.singh1, Kamaljit Singh

Add nvme_is_io_ctrl() to check if the controller is of type I/O
controller. Uses negative logic by excluding an administrative
controller and a discovery controller.

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

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index d67545bd7abb..fab672e50510 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -3167,6 +3167,11 @@ static inline bool nvme_admin_ctrl(struct nvme_ctrl *ctrl)
 	return ctrl->cntrltype == NVME_CTRL_ADMIN;
 }
 
+static inline bool nvme_is_io_ctrl(struct nvme_ctrl *ctrl)
+{
+	return !nvme_discovery_ctrl(ctrl) && !nvme_admin_ctrl(ctrl);
+}
+
 static bool nvme_validate_cntlid(struct nvme_subsystem *subsys,
 		struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id)
 {
-- 
2.43.0



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

* [PATCH v2 2/2] nvme-core: do ioccsz/iorcsz validation only for I/O controllers
  2025-09-05 23:25 [PATCH v2 0/2] Preclude IOCCSZ/IORCSZ validation for admin controller connect Kamaljit Singh
  2025-09-05 23:25 ` [PATCH v2 1/2] nvme-core: add method to check for an I/O controller Kamaljit Singh
@ 2025-09-05 23:25 ` Kamaljit Singh
  2025-09-08 12:57   ` Hannes Reinecke
  2025-09-17 22:41 ` [PATCH v2 0/2] Preclude IOCCSZ/IORCSZ validation for admin controller connect Keith Busch
  2 siblings, 1 reply; 8+ messages in thread
From: Kamaljit Singh @ 2025-09-05 23:25 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 ignore existing checks for IOCCSZ/IORCSZ. Currently, these checks
only exclude a discovery controller but need to also exclude an
administrative controller.

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 fab672e50510..ef6f84d677d8 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -3496,14 +3496,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 (nvme_is_io_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 (nvme_is_io_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] 8+ messages in thread

* Re: [PATCH v2 1/2] nvme-core: add method to check for an I/O controller
  2025-09-05 23:25 ` [PATCH v2 1/2] nvme-core: add method to check for an I/O controller Kamaljit Singh
@ 2025-09-08 12:56   ` Hannes Reinecke
  2025-09-17 21:42     ` Kamaljit Singh
  0 siblings, 1 reply; 8+ messages in thread
From: Hannes Reinecke @ 2025-09-08 12:56 UTC (permalink / raw)
  To: Kamaljit Singh, kbusch, axboe, hch, sagi, linux-nvme,
	linux-kernel
  Cc: cassel, dlemoal, kamaljit.singh1

On 9/6/25 01:25, Kamaljit Singh wrote:
> Add nvme_is_io_ctrl() to check if the controller is of type I/O
> controller. Uses negative logic by excluding an administrative
> controller and a discovery controller.
> 
> Signed-off-by: Kamaljit Singh <kamaljit.singh@opensource.wdc.com>
> ---
>   drivers/nvme/host/core.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                  Kernel Storage Architect
hare@suse.de                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich


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

* Re: [PATCH v2 2/2] nvme-core: do ioccsz/iorcsz validation only for I/O controllers
  2025-09-05 23:25 ` [PATCH v2 2/2] nvme-core: do ioccsz/iorcsz validation only for I/O controllers Kamaljit Singh
@ 2025-09-08 12:57   ` Hannes Reinecke
  2025-09-17 21:43     ` Kamaljit Singh
  0 siblings, 1 reply; 8+ messages in thread
From: Hannes Reinecke @ 2025-09-08 12:57 UTC (permalink / raw)
  To: Kamaljit Singh, kbusch, axboe, hch, sagi, linux-nvme,
	linux-kernel
  Cc: cassel, dlemoal, kamaljit.singh1

On 9/6/25 01:25, Kamaljit Singh wrote:
> An administrative controller does not support I/O queues, hence it
> should ignore existing checks for IOCCSZ/IORCSZ. Currently, these checks
> only exclude a discovery controller but need to also exclude an
> administrative controller.
> 
> Signed-off-by: Kamaljit Singh <kamaljit.singh@opensource.wdc.com>
> ---
>   drivers/nvme/host/core.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                  Kernel Storage Architect
hare@suse.de                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich


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

* Re: [PATCH v2 1/2] nvme-core: add method to check for an I/O controller
  2025-09-08 12:56   ` Hannes Reinecke
@ 2025-09-17 21:42     ` Kamaljit Singh
  0 siblings, 0 replies; 8+ messages in thread
From: Kamaljit Singh @ 2025-09-17 21:42 UTC (permalink / raw)
  To: Hannes Reinecke
  Cc: kbusch, axboe, hch, sagi, linux-nvme, linux-kernel, cassel,
	dlemoal, kamaljit.singh1

On Mon, Sep 08, 2025 at 02:56:35PM +0200, Hannes Reinecke wrote:
> On 9/6/25 01:25, Kamaljit Singh wrote:
> > Add nvme_is_io_ctrl() to check if the controller is of type I/O
> > controller. Uses negative logic by excluding an administrative
> > controller and a discovery controller.
> > 
> > Signed-off-by: Kamaljit Singh <kamaljit.singh@opensource.wdc.com>
> > ---
> >   drivers/nvme/host/core.c | 5 +++++
> >   1 file changed, 5 insertions(+)
> > 
> Reviewed-by: Hannes Reinecke <hare@suse.de>
> 
Please review and provide any feedback on these 2 patches.

Thanks,
Kamaljit Singh


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

* Re: [PATCH v2 2/2] nvme-core: do ioccsz/iorcsz validation only for I/O controllers
  2025-09-08 12:57   ` Hannes Reinecke
@ 2025-09-17 21:43     ` Kamaljit Singh
  0 siblings, 0 replies; 8+ messages in thread
From: Kamaljit Singh @ 2025-09-17 21:43 UTC (permalink / raw)
  To: Hannes Reinecke
  Cc: kbusch, axboe, hch, sagi, linux-nvme, linux-kernel, cassel,
	dlemoal, kamaljit.singh1

On Mon, Sep 08, 2025 at 02:57:00PM +0200, Hannes Reinecke wrote:
> On 9/6/25 01:25, Kamaljit Singh wrote:
> > An administrative controller does not support I/O queues, hence it
> > should ignore existing checks for IOCCSZ/IORCSZ. Currently, these checks
> > only exclude a discovery controller but need to also exclude an
> > administrative controller.
> > 
> > Signed-off-by: Kamaljit Singh <kamaljit.singh@opensource.wdc.com>
> > ---
> >   drivers/nvme/host/core.c | 4 ++--
> >   1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> Reviewed-by: Hannes Reinecke <hare@suse.de>
> 
Please review and provide any feedback for both of these patches.

Thanks,
Kamaljit


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

* Re: [PATCH v2 0/2] Preclude IOCCSZ/IORCSZ validation for admin controller connect
  2025-09-05 23:25 [PATCH v2 0/2] Preclude IOCCSZ/IORCSZ validation for admin controller connect Kamaljit Singh
  2025-09-05 23:25 ` [PATCH v2 1/2] nvme-core: add method to check for an I/O controller Kamaljit Singh
  2025-09-05 23:25 ` [PATCH v2 2/2] nvme-core: do ioccsz/iorcsz validation only for I/O controllers Kamaljit Singh
@ 2025-09-17 22:41 ` Keith Busch
  2 siblings, 0 replies; 8+ messages in thread
From: Keith Busch @ 2025-09-17 22:41 UTC (permalink / raw)
  To: Kamaljit Singh
  Cc: axboe, hch, sagi, linux-nvme, linux-kernel, cassel, dlemoal,
	kamaljit.singh1

On Fri, Sep 05, 2025 at 04:25:48PM -0700, Kamaljit Singh wrote:
> 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.

Thanks, applied to nvme-6.18.


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

end of thread, other threads:[~2025-09-17 22:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-05 23:25 [PATCH v2 0/2] Preclude IOCCSZ/IORCSZ validation for admin controller connect Kamaljit Singh
2025-09-05 23:25 ` [PATCH v2 1/2] nvme-core: add method to check for an I/O controller Kamaljit Singh
2025-09-08 12:56   ` Hannes Reinecke
2025-09-17 21:42     ` Kamaljit Singh
2025-09-05 23:25 ` [PATCH v2 2/2] nvme-core: do ioccsz/iorcsz validation only for I/O controllers Kamaljit Singh
2025-09-08 12:57   ` Hannes Reinecke
2025-09-17 21:43     ` Kamaljit Singh
2025-09-17 22:41 ` [PATCH v2 0/2] Preclude IOCCSZ/IORCSZ validation for admin controller connect Keith Busch

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.