scsi: scsi_transport_sas: cap shost opt_sectors according to DMA optimal limit
authorJohn Garry <john.garry@huawei.com>
Thu, 14 Jul 2022 11:15:28 +0000 (19:15 +0800)
committerChristoph Hellwig <hch@lst.de>
Tue, 19 Jul 2022 09:11:49 +0000 (11:11 +0200)
commit4cbfca5f7750520ff993a0d6eb79cc4a6f6cee97
treec7215db758628d553bbbede2148d449d5d54d072
parent608128d391fa5c95d515d2c198f40239016e1fcd
scsi: scsi_transport_sas: cap shost opt_sectors according to DMA optimal limit

Streaming DMA mappings may be considerably slower when mappings go through
an IOMMU and the total mapping length is somewhat long. This is because the
IOMMU IOVA code allocates and free an IOVA for each mapping, which may
affect performance.

For performance reasons set the request queue max_sectors from
dma_opt_mapping_size(), which knows this mapping limit.

Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/scsi/scsi_transport_sas.c