diff options
author | Bart Van Assche <bvanassche@acm.org> | 2019-01-22 10:25:20 -0800 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2019-01-30 15:04:16 -0700 |
commit | 0b5cb3300ae59ed7e93b465dfa2384a6a4df8eb4 (patch) | |
tree | ba66ceac2b52f23fd3e9665d165dd31af9220a68 /include/rdma/ib_verbs.h | |
parent | db421a54996c602503204345171c662e65f20527 (diff) | |
download | linux-stable-0b5cb3300ae59ed7e93b465dfa2384a6a4df8eb4.tar.gz linux-stable-0b5cb3300ae59ed7e93b465dfa2384a6a4df8eb4.tar.bz2 linux-stable-0b5cb3300ae59ed7e93b465dfa2384a6a4df8eb4.zip |
RDMA/srp: Increase max_segment_size
The default behavior of the SCSI core is to set the block layer request
queue parameter max_segment_size to 64 KB. That means that elements of
scatterlists are limited to 64 KB. Since RDMA adapters support larger
sizes, increase max_segment_size for the SRP initiator.
Notes:
- The SCSI max_segment_size parameter was introduced in kernel v5.0. See
also commit 50c2e9107f17 ("scsi: introduce a max_segment_size
host_template parameters").
- Some other block drivers already set max_segment_size to UINT_MAX,
e.g. nbd and rbd.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'include/rdma/ib_verbs.h')
-rw-r--r-- | include/rdma/ib_verbs.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 94b6e1dd4dab..71ea144ec823 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -3716,6 +3716,19 @@ static inline unsigned int ib_sg_dma_len(struct ib_device *dev, } /** + * ib_dma_max_seg_size - Return the size limit of a single DMA transfer + * @dev: The device to query + * + * The returned value represents a size in bytes. + */ +static inline unsigned int ib_dma_max_seg_size(struct ib_device *dev) +{ + struct device_dma_parameters *p = dev->dma_device->dma_parms; + + return p ? p->max_segment_size : UINT_MAX; +} + +/** * ib_dma_sync_single_for_cpu - Prepare DMA region to be accessed by CPU * @dev: The device for which the DMA address was created * @addr: The DMA address |