Skip to content

Commit 53b550d

Browse files
ipylypivmartinkpetersen
authored andcommitted
scsi: pm8001: Increase request sg length to support 4MiB requests
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). Increase 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> Link: https://lore.kernel.org/r/20241025185009.3278297-1-ipylypiv@google.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 4501ea5 commit 53b550d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

drivers/scsi/pm8001/pm8001_defs.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,11 @@ enum port_type {
9292
#define PM8001_MAX_MSIX_VEC 64 /* max msi-x int for spcv/ve */
9393
#define PM8001_RESERVE_SLOT 8
9494

95-
#define CONFIG_SCSI_PM8001_MAX_DMA_SG 528
96-
#define PM8001_MAX_DMA_SG CONFIG_SCSI_PM8001_MAX_DMA_SG
95+
#define PM8001_SECTOR_SIZE 512
96+
#define PM8001_PAGE_SIZE_4K 4096
97+
#define PM8001_MAX_IO_SIZE (4 * 1024 * 1024)
98+
#define PM8001_MAX_DMA_SG (PM8001_MAX_IO_SIZE / PM8001_PAGE_SIZE_4K)
99+
#define PM8001_MAX_SECTORS (PM8001_MAX_IO_SIZE / PM8001_SECTOR_SIZE)
97100

98101
enum memory_region_num {
99102
AAP1 = 0x0, /* application acceleration processor */

drivers/scsi/pm8001/pm8001_init.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ static const struct scsi_host_template pm8001_sht = {
121121
.scan_start = pm8001_scan_start,
122122
.can_queue = 1,
123123
.sg_tablesize = PM8001_MAX_DMA_SG,
124+
.max_sectors = PM8001_MAX_SECTORS,
124125
.shost_groups = pm8001_host_groups,
125126
.sdev_groups = pm8001_sdev_groups,
126127
.track_queue_depth = 1,

0 commit comments

Comments
 (0)