All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] scsi: pm8001: Increase request sg length to support 4MiB requests
@ 2024-10-25 18:50 Igor Pylypiv
  2024-11-03  0:22 ` Martin K. Petersen
  2024-11-14  2:49 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Igor Pylypiv @ 2024-10-25 18:50 UTC (permalink / raw)
  To: Jack Wang, James E.J. Bottomley, Martin K. Petersen
  Cc: linux-scsi, linux-kernel, Igor Pylypiv

Increasing the per-request size maximum to 4MiB (8192 sectors x 512 bytes)
runs into the per-device DMA scatter gather list limit (max_segments) for
users of the io vector system calls (e.g. readv and writev).

This change increases the max scatter gather list length to 1024 to enable
kernel to send 4MiB (1024 * 4KiB page size) requests.

Signed-off-by: Igor Pylypiv <ipylypiv@google.com>
---

Changes since v1:
- Added .max_sectors = 8192 to pm8001 scsi host template.
- Defined page size, sector size, and max I/O size to calculate max_sectors
  and sg_tablesize values.

 drivers/scsi/pm8001/pm8001_defs.h | 7 +++++--
 drivers/scsi/pm8001/pm8001_init.c | 1 +
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/pm8001/pm8001_defs.h b/drivers/scsi/pm8001/pm8001_defs.h
index 501b574239e8..7871e29a820a 100644
--- a/drivers/scsi/pm8001/pm8001_defs.h
+++ b/drivers/scsi/pm8001/pm8001_defs.h
@@ -92,8 +92,11 @@ enum port_type {
 #define	PM8001_MAX_MSIX_VEC	 64	/* max msi-x int for spcv/ve */
 #define	PM8001_RESERVE_SLOT	 8
 
-#define	CONFIG_SCSI_PM8001_MAX_DMA_SG	528
-#define PM8001_MAX_DMA_SG	CONFIG_SCSI_PM8001_MAX_DMA_SG
+#define PM8001_SECTOR_SIZE	512
+#define PM8001_PAGE_SIZE_4K	4096
+#define PM8001_MAX_IO_SIZE	(4 * 1024 * 1024)
+#define PM8001_MAX_DMA_SG	(PM8001_MAX_IO_SIZE / PM8001_PAGE_SIZE_4K)
+#define PM8001_MAX_SECTORS	(PM8001_MAX_IO_SIZE / PM8001_SECTOR_SIZE)
 
 enum memory_region_num {
 	AAP1 = 0x0, /* application acceleration processor */
diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
index 33e1eba62ca1..c87443b14ff7 100644
--- a/drivers/scsi/pm8001/pm8001_init.c
+++ b/drivers/scsi/pm8001/pm8001_init.c
@@ -117,6 +117,7 @@ static const struct scsi_host_template pm8001_sht = {
 	.scan_start		= pm8001_scan_start,
 	.can_queue		= 1,
 	.sg_tablesize		= PM8001_MAX_DMA_SG,
+	.max_sectors		= PM8001_MAX_SECTORS,
 	.shost_groups		= pm8001_host_groups,
 	.sdev_groups		= pm8001_sdev_groups,
 	.track_queue_depth	= 1,
-- 
2.47.0.163.g1226f6d8fa-goog


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

* Re: [PATCH v2] scsi: pm8001: Increase request sg length to support 4MiB requests
  2024-10-25 18:50 [PATCH v2] scsi: pm8001: Increase request sg length to support 4MiB requests Igor Pylypiv
@ 2024-11-03  0:22 ` Martin K. Petersen
  2024-11-14  2:49 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2024-11-03  0:22 UTC (permalink / raw)
  To: Igor Pylypiv
  Cc: Jack Wang, James E.J. Bottomley, Martin K. Petersen, linux-scsi,
	linux-kernel


Igor,

> Increasing the per-request size maximum to 4MiB (8192 sectors x 512
> bytes) runs into the per-device DMA scatter gather list limit
> (max_segments) for users of the io vector system calls (e.g. readv and
> writev).
>
> This change increases the max scatter gather list length to 1024 to
> enable kernel to send 4MiB (1024 * 4KiB page size) requests.

Applied to 6.13/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH v2] scsi: pm8001: Increase request sg length to support 4MiB requests
  2024-10-25 18:50 [PATCH v2] scsi: pm8001: Increase request sg length to support 4MiB requests Igor Pylypiv
  2024-11-03  0:22 ` Martin K. Petersen
@ 2024-11-14  2:49 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2024-11-14  2:49 UTC (permalink / raw)
  To: Jack Wang, James E.J. Bottomley, Igor Pylypiv
  Cc: Martin K . Petersen, linux-scsi, linux-kernel

On Fri, 25 Oct 2024 18:50:09 +0000, Igor Pylypiv wrote:

> Increasing the per-request size maximum to 4MiB (8192 sectors x 512 bytes)
> runs into the per-device DMA scatter gather list limit (max_segments) for
> users of the io vector system calls (e.g. readv and writev).
> 
> This change increases the max scatter gather list length to 1024 to enable
> kernel to send 4MiB (1024 * 4KiB page size) requests.
> 
> [...]

Applied to 6.13/scsi-queue, thanks!

[1/1] scsi: pm8001: Increase request sg length to support 4MiB requests
      https://git.kernel.org/mkp/scsi/c/53b550de4635

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2024-11-14  2:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-25 18:50 [PATCH v2] scsi: pm8001: Increase request sg length to support 4MiB requests Igor Pylypiv
2024-11-03  0:22 ` Martin K. Petersen
2024-11-14  2:49 ` Martin K. Petersen

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.