public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] scsi: ufs: Increase the maximum data buffer size
@ 2022-07-26 22:52 Bart Van Assche
  2022-07-27  5:06 ` Avri Altman
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Bart Van Assche @ 2022-07-26 22:52 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: Jaegeuk Kim, linux-scsi, Adrian Hunter, Bart Van Assche,
	Avri Altman, Bean Huo, Stanley Chu, James E.J. Bottomley,
	Matthias Brugger

Measurements for one particular UFS controller + UFS device show a 25%
higher read bandwidth if the maximum data buffer size is increased from
512 KiB to 1 MiB. Hence increase the maximum size of the data buffer
associated with a single request from SCSI_DEFAULT_MAX_SECTORS (1024)
* 512 bytes = 512 KiB to 1 MiB.

Notes:
- The maximum data buffer size supported by the UFSHCI specification
  is 65535 * 256 KiB or about 16 GiB.
- The maximum data buffer size for READ(10) commands is 65535 logical
  blocks. To transfer more than 65535 * 4096 bytes = 255 MiB with a
  single SCSI command, the READ(16) command is required. Support for
  READ(16) is optional in the UFS 3.1 and UFS 4.0 standards.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Avri Altman <avri.altman@wdc.com>
Cc: Bean Huo <beanhuo@micron.com>
Cc: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
Changes compared to v2: changed maximum transfer size 255 MiB to 1 MiB.
Changes compared to v1: changed maximum transfer size from 1 GiB to 255 MiB.

 drivers/ufs/core/ufshcd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 36b7212e9cb5..678bc8d6d6aa 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -8365,6 +8365,7 @@ static struct scsi_host_template ufshcd_driver_template = {
 	.cmd_per_lun		= UFSHCD_CMD_PER_LUN,
 	.can_queue		= UFSHCD_CAN_QUEUE,
 	.max_segment_size	= PRDT_DATA_BYTE_COUNT_MAX,
+	.max_sectors		= (1 << 20) / SECTOR_SIZE, /* 1 MiB */
 	.max_host_blocked	= 1,
 	.track_queue_depth	= 1,
 	.sdev_groups		= ufshcd_driver_groups,

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

end of thread, other threads:[~2022-09-15 10:57 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-26 22:52 [PATCH v3] scsi: ufs: Increase the maximum data buffer size Bart Van Assche
2022-07-27  5:06 ` Avri Altman
2022-08-01 23:28 ` Martin K. Petersen
2022-08-02 23:40 ` 정요한(JOUNG YOHAN) Mobile SE
2022-08-03 16:23   ` Bart Van Assche
2022-08-04  1:50     ` 정요한(JOUNG YOHAN) Mobile SE
2022-08-04 17:48       ` Bart Van Assche
2022-08-05  1:54         ` 정요한(JOUNG YOHAN) Mobile SE
2022-09-02 14:52     ` Bean Huo
2022-09-06 18:04       ` Bart Van Assche
2022-09-15 10:56         ` Bean Huo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox