From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (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 8BF0F36656F; Wed, 21 Jan 2026 08:42:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.95.11.211 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768984944; cv=none; b=FI9CZbeizXZa6w4K9Z0ANct0MJkiumZA45aP4zZoY45tY7qF7GbgcEDirLJbvVFmLSYwKYZbL/c/n2ce9PLE2xOjtsvuoB3b4EGOxk2smSChqXDkEcYvsKY+2X+Gp5xG006kq/kYefRDwUs2nmWrn87JiGmciKrRk4YOXWJKOFo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768984944; c=relaxed/simple; bh=xcItrdUgyJnWL9h2AfWiJfoEtRsVD720bMV8yaVFjjU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=K16GXUsG98CHnnG56igNlGxJ4la9NzmaLa31osGJIlu8t+iNsgKTf/iWg6P8HD7nakzFa6pz0N6ZzDDIAOqdpXF8Y1V227UzOs5nd+LITrpwpPJ/Dg32Dm6FKBf2wE+BuesSwGm2/OPL4qzmKx959b4rwcsJFXXcP5QtX5QD/Oc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lst.de; spf=pass smtp.mailfrom=lst.de; arc=none smtp.client-ip=213.95.11.211 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id 99C3A227AAA; Wed, 21 Jan 2026 09:42:17 +0100 (CET) Date: Wed, 21 Jan 2026 09:42:17 +0100 From: Christoph Hellwig To: Chuck Lever Cc: Jason Gunthorpe , Leon Romanovsky , Christoph Hellwig , NeilBrown , Jeff Layton , Olga Kornievskaia , Dai Ngo , Tom Talpey , linux-rdma@vger.kernel.org, linux-nfs@vger.kernel.org, Chuck Lever Subject: Re: [PATCH v2 1/4] RDMA/core: add bio_vec based RDMA read/write API Message-ID: <20260121084217.GA16458@lst.de> References: <20260120143124.1822121-1-cel@kernel.org> <20260120143124.1822121-2-cel@kernel.org> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260120143124.1822121-2-cel@kernel.org> User-Agent: Mutt/1.5.17 (2007-11-01) On Tue, Jan 20, 2026 at 09:31:21AM -0500, Chuck Lever wrote: > From: Chuck Lever > > The existing rdma_rw_ctx_init() API requires callers to construct a > scatterlist, which is then DMA-mapped page by page. Callers that > already have data in bio_vec form (such as the NVMe-oF target) must > first convert to scatterlist, adding overhead and complexity. > > Introduce rdma_rw_ctx_init_bvec() and rdma_rw_ctx_destroy_bvec() to > accept bio_vec arrays directly. The new helpers use dma_map_phys() > for hardware RDMA devices and virtual addressing for software RDMA > devices (rxe, siw), avoiding intermediate scatterlist construction. > > Memory registration (MR) path support is deferred to a follow-up > series; callers requiring MR-based transfers (iWARP devices or > force_mr=1) receive -EOPNOTSUPP and should use the scatterlist API. > > Signed-off-by: Chuck Lever > --- > drivers/infiniband/core/rw.c | 210 +++++++++++++++++++++++++++++++++++ > include/rdma/ib_verbs.h | 42 +++++++ > include/rdma/rw.h | 10 ++ > 3 files changed, 262 insertions(+) > > diff --git a/drivers/infiniband/core/rw.c b/drivers/infiniband/core/rw.c > index 6354ddf2a274..59f32fecf3df 100644 > --- a/drivers/infiniband/core/rw.c > +++ b/drivers/infiniband/core/rw.c > @@ -4,6 +4,7 @@ > */ > #include > #include > +#include > #include > #include > #include > @@ -274,6 +275,111 @@ static int rdma_rw_init_single_wr(struct rdma_rw_ctx *ctx, struct ib_qp *qp, > return 1; > } > > +static int rdma_rw_init_single_wr_bvec(struct rdma_rw_ctx *ctx, > + struct ib_qp *qp, const struct bio_vec *bvec, Nit: maybe rename bvec to bvecs or bvec_table to make it clear this is the base array that the iter operates on? > + struct bvec_iter *iter, > + u64 remote_addr, u32 rkey, enum dma_data_direction dir) Nit 2: this can be condensed a little: > + struct bvec_iter *iter, u64 remote_addr, u32 rkey, > + enum dma_data_direction dir) > +static int rdma_rw_init_map_wrs_bvec(struct rdma_rw_ctx *ctx, struct ib_qp *qp, > + const struct bio_vec *bvec, u32 nr_bvec, > + struct bvec_iter *iter, > + u64 remote_addr, u32 rkey, enum dma_data_direction dir) Same here. Otherwise looks good: Reviewed-by: Christoph Hellwig