[PATCH 01/24] scsi: core: add SCSI_MAX_QUEUE_DEPTH

John Garry posted 24 patches 1 month, 1 week ago
[PATCH 01/24] scsi: core: add SCSI_MAX_QUEUE_DEPTH
Posted by John Garry 1 month, 1 week ago
Add a macro for the max queue depth which is supported.

Signed-off-by: John Garry <john.g.garry@oracle.com>
---
 drivers/scsi/scsi.c      | 2 +-
 drivers/scsi/scsi_priv.h | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 76cdad063f7bc..28c9bbf439db6 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -204,7 +204,7 @@ void scsi_finish_command(struct scsi_cmnd *cmd)
  */
 int scsi_device_max_queue_depth(struct scsi_device *sdev)
 {
-	return min_t(int, sdev->host->can_queue, 4096);
+	return min_t(int, sdev->host->can_queue, SCSI_MAX_QUEUE_DEPTH);
 }
 
 /**
diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h
index d07ec15d6c002..679752c5f8bba 100644
--- a/drivers/scsi/scsi_priv.h
+++ b/drivers/scsi/scsi_priv.h
@@ -18,6 +18,8 @@ struct scsi_nl_hdr;
 
 #define SCSI_CMD_RETRIES_NO_LIMIT -1
 
+#define SCSI_MAX_QUEUE_DEPTH 4096
+
 /*
  * Error codes used by scsi-ml internally. These must not be used by drivers.
  */
-- 
2.43.5
Re: [PATCH 01/24] scsi: core: add SCSI_MAX_QUEUE_DEPTH
Posted by Hannes Reinecke 1 month ago
On 2/25/26 16:36, John Garry wrote:
> Add a macro for the max queue depth which is supported.
> 
> Signed-off-by: John Garry <john.g.garry@oracle.com>
> ---
>   drivers/scsi/scsi.c      | 2 +-
>   drivers/scsi/scsi_priv.h | 2 ++
>   2 files changed, 3 insertions(+), 1 deletion(-)
> 
Maybe: 'Add a macro for the supported queue depth'?

Anyway:
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                  Kernel Storage Architect
hare@suse.com                               +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
Re: [PATCH 01/24] scsi: core: add SCSI_MAX_QUEUE_DEPTH
Posted by John Garry 1 month ago
On 03/03/2026 06:52, Hannes Reinecke wrote:
> On 2/25/26 16:36, John Garry wrote:
>> Add a macro for the max queue depth which is supported.
>>
>> Signed-off-by: John Garry <john.g.garry@oracle.com>
>> ---
>>   drivers/scsi/scsi.c      | 2 +-
>>   drivers/scsi/scsi_priv.h | 2 ++
>>   2 files changed, 3 insertions(+), 1 deletion(-)
>>
> Maybe: 'Add a macro for the supported queue depth'?
> 

ok, if you prefer

Note that I may drop this patch since it may not be used elsewhere. 
However, some might say that the value currently used is a magic number.


> Anyway:
> Reviewed-by: Hannes Reinecke <hare@suse.de>

thanks