]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
RDMA/core: add MR support for bvec-based RDMA operations
authorChuck Lever <chuck.lever@oracle.com>
Wed, 28 Jan 2026 00:53:58 +0000 (19:53 -0500)
committerLeon Romanovsky <leon@kernel.org>
Wed, 28 Jan 2026 10:54:53 +0000 (05:54 -0500)
commitbea28ac14cab25d79ea759138def79aa82e0b428
tree94dada404043114d0f9b9418694303fb423badcb
parent853e892076ba5666c81afbc86552e008280f9768
RDMA/core: add MR support for bvec-based RDMA operations

The bvec-based RDMA API currently returns -EOPNOTSUPP when Memory
Region registration is required. This prevents iWARP devices from
using the bvec path, since iWARP requires MR registration for RDMA
READ operations. The force_mr debug parameter is also unusable with
bvec input.

Add rdma_rw_init_mr_wrs_bvec() to handle MR registration for bvec
arrays. The approach creates a synthetic scatterlist populated with
DMA addresses from the bvecs, then reuses the existing ib_map_mr_sg()
infrastructure. This avoids driver changes while keeping the
implementation small.

The synthetic scatterlist is stored in the rdma_rw_ctx for cleanup.
On destroy, the MRs are returned to the pool and the bvec DMA
mappings are released using the stored addresses.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Link: https://patch.msgid.link/20260128005400.25147-4-cel@kernel.org
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/core/rw.c
include/rdma/rw.h