Skip to content

Add a bio_vec based API to core/rw.c

Chuck Lever linux-nfs linux-rdma 5 versions – Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest5 patches 3 repliesApplied
  2. v45 patches 2 repliesSuperseded
  3. v35 patches 15 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v24 patches10 repliesSuperseded
v14 patches25 repliesSuperseded

Changes in v5 from the cover letter

- Move the synthetic SGL into struct rdma_rw_reg_ctx

Patches in v5 Applied

#Subject and filesSizeRepliesApplied
1/5RDMA/core: add bio_vec based RDMA read/write APIdrivers/infiniband/core/rw.c include/rdma/ib_verbs.h include/rdma/rw.h+250 -00 replies
2/5RDMA/core: use IOVA-based DMA mapping for bvec RDMA operationsdrivers/infiniband/core/rw.c include/rdma/rw.h+114 -00 replies
3/5RDMA/core: add MR support for bvec-based RDMA operationsdrivers/infiniband/core/rw.c include/rdma/rw.h+154 -361 reply
4/5RDMA/core: add rdma_rw_max_sge() helper for SQ sizingdrivers/infiniband/core/rw.c include/rdma/rw.h net/sunrpc/xprtrdma/svc_rdma_transport.c+46 -170 replies
5/5svcrdma: use bvec-based RDMA read/write APInet/sunrpc/xprtrdma/svc_rdma_rw.c+86 -691 reply

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchChristoph Hellwig
1/5R-b
2/5R-b
3/5R-b
4/5R-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 0/5] Add a bio_vec based API to core/rw.c

From: Chuck Lever <[email protected]>

This series introduces a bio_vec based API for RDMA read and write operations in the RDMA core, eliminating unnecessary scatterlist conversions for callers that already work with bvecs.

Current users of rdma_rw_ctx_init() must convert their native data structures into scatterlists. For subsystems like svcrdma that maintain data in bvec format, this conversion adds overhead both in CPU cycles and memory footprint. The new API accepts bvec arrays directly.

For hardware RDMA devices, the implementation uses the IOVA-based DMA mapping API to reduce IOTLB synchronization overhead from O(n) per-page syncs to a single O(1) sync after all mappings complete. Software RDMA devices (rxe, siw) continue using virtual addressing.

The series includes MR registration support for bvec arrays, enabling iWARP devices and the force_mr debug parameter. The MR path reuses existing ib_map_mr_sg() infrastructure by constructing a synthetic scatterlist from the bvec DMA addresses.

The final patch adds the first consumer for the new API: svcrdma.

Based on v6.19-rc7.

---

Changes since v4:
- Move the synthetic SGL into struct rdma_rw_reg_ctx

Changes since v3:
- Remove the local iter from rdma_rw_init_iova_wrs_bvec()
- Refactor common per-MR handling into a helper

Changes since v2:
- Add bvec iter arguments to the new API
- Add a synthetic SGL in the MR mapping function
- Try IOVA coalescing before max_sgl_rd triggers MR in bvec path
- Attempt once again to address SQ/CQ/max_rdma_ctxs sizing issues

Changes since v1:
- Simplify rw.c by using bvec iters internally
- IOVA mapping produces a contiguous DMA address range
- Clarify the comment that documents struct svc_rdma_rw_ctxt
- svcrdma now uses pre-allocated bio_vec arrays

Chuck Lever (5):
RDMA/core: add bio_vec based RDMA read/write API RDMA/core: use IOVA-based DMA mapping for bvec RDMA operations RDMA/core: add MR support for bvec-based RDMA operations RDMA/core: add rdma_rw_max_sge() helper for SQ sizing
svcrdma: use bvec-based RDMA read/write API

 drivers/infiniband/core/rw.c             | 521 +++++++++++++++++++++--
 include/rdma/ib_verbs.h                  |  42 ++
 include/rdma/rw.h                        |  22 +
 net/sunrpc/xprtrdma/svc_rdma_rw.c        | 155 ++++---
 net/sunrpc/xprtrdma/svc_rdma_transport.c |   8 +-
 5 files changed, 638 insertions(+), 110 deletions(-)
Signature · 1 line
2.49.0