From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 74A837A13A; Wed, 28 Jan 2026 00:54:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769561644; cv=none; b=M4XM+eBrQA0H25z/0joK8XY2mcz9DEPnGPVHfdm+8lmmapeVKyw7prSVY0FeVHvjslKxye/sG30DdEiJqSjacRznlNBr7+i1Nsy779ES9TaJ24yc30d0gEU/ReGRmW4NE+nu0Bh4MMcoipLycRZRQLrimN9111VQJEifG3VNuz4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769561644; c=relaxed/simple; bh=+krboppBsLTFk3zRHe9ldWyamLfY9PsIu3CD1UkdQkg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=JH03t6IxRUjrBx6FQL5/7LtTmuxdx1LbqaoNyVZlPQyYOQg1UyZNWVcw28EEQd5+Bi22McmXXLncNaUQjYBm3OEvpJ7dpeHZmFBjuAN2oVJp5dO7DQwHjGI1S5/tXpwb76UDIPVcy2+Cj+QAt0CdMRy/wB7fzQWAccEPcFur0Hk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=P/oby3Wa; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="P/oby3Wa" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D5BEC116C6; Wed, 28 Jan 2026 00:54:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769561644; bh=+krboppBsLTFk3zRHe9ldWyamLfY9PsIu3CD1UkdQkg=; h=From:To:Cc:Subject:Date:From; b=P/oby3WaX0S8+13T61xhnh3gMB6WJ8pGJrVW2D3xF7PDXddTvWc6OrkZ9nw7fc/7R RE1OEixGsZf9vi9oWREsHa3FZwktO4pCLJKeWXGLr0BmQQyqe/7f5Z9gc6fVHWzK65 6FBvlMDlQv7oplG8rLoEosjq+aqJZhM5I+FaCkj1SSMrgqJgjfJfiOl3ng8V/bNa+l oE1jGR7hoS8JWZQIAchQjo30tiAEMTuzeELp+h/qWkriDzzXxnJDazce9RwCouLIMS Vy47HsewTJd6hR6QzRg2jqGn6MynpBTXTC6bOCe0l/zeLktUg6ACRy9ApayIv1vmw2 tGaOiHeLM5DPA== From: Chuck Lever To: Leon Romanovsky , Christoph Hellwig , Jason Gunthorpe Cc: , , Chuck Lever Subject: [PATCH v5 0/5] Add a bio_vec based API to core/rw.c Date: Tue, 27 Jan 2026 19:53:55 -0500 Message-ID: <20260128005400.25147-1-cel@kernel.org> X-Mailer: git-send-email 2.49.0 Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Chuck Lever 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(-) -- 2.49.0