diff options
| author | Chuck Lever <chuck.lever@oracle.com> | 2026-01-27 19:53:57 -0500 |
|---|---|---|
| committer | Leon Romanovsky <leon@kernel.org> | 2026-01-28 05:54:53 -0500 |
| commit | 853e892076ba5666c81afbc86552e008280f9768 (patch) | |
| tree | d9f4891b12e523f87b93f1c29866a512cad5112c /include | |
| parent | 5e541553588d493bd9317bc8a8c1ab85cbddc2c5 (diff) | |
RDMA/core: use IOVA-based DMA mapping for bvec RDMA operations
The bvec RDMA API maps each bvec individually via dma_map_phys(),
requiring an IOTLB sync for each mapping. For large I/O operations
with many bvecs, this overhead becomes significant.
The two-step IOVA API (dma_iova_try_alloc / dma_iova_link /
dma_iova_sync) allocates a contiguous IOVA range upfront, links
all physical pages without IOTLB syncs, then performs a single
sync at the end. This reduces IOTLB flushes from O(n) to O(1).
It also requires only a single output dma_addr_t compared to extra
per-input element storage in struct scatterlist.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Link: https://patch.msgid.link/20260128005400.25147-3-cel@kernel.org
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/rdma/rw.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/rdma/rw.h b/include/rdma/rw.h index b2fc3e2373d7..205e16ed6cd8 100644 --- a/include/rdma/rw.h +++ b/include/rdma/rw.h @@ -32,6 +32,14 @@ struct rdma_rw_ctx { struct ib_rdma_wr *wrs; } map; + /* for IOVA-based mapping of bvecs into contiguous DMA range: */ + struct { + struct dma_iova_state state; + struct ib_sge sge; + struct ib_rdma_wr wr; + size_t mapped_len; + } iova; + /* for registering multiple WRs: */ struct rdma_rw_reg_ctx { struct ib_sge sge; |
