All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Chuck Lever <cel@kernel.org>
Cc: Jason Gunthorpe <jgg@nvidia.com>,
	Leon Romanovsky <leon@kernel.org>, Christoph Hellwig <hch@lst.de>,
	NeilBrown <neilb@ownmail.net>, Jeff Layton <jlayton@kernel.org>,
	Olga Kornievskaia <okorniev@redhat.com>,
	Dai Ngo <dai.ngo@oracle.com>, Tom Talpey <tom@talpey.com>,
	linux-rdma@vger.kernel.org, linux-nfs@vger.kernel.org,
	Chuck Lever <chuck.lever@oracle.com>
Subject: Re: [PATCH v2 3/4] RDMA/core: add MR support for bvec-based RDMA operations
Date: Wed, 21 Jan 2026 10:05:08 +0100	[thread overview]
Message-ID: <20260121090508.GE16458@lst.de> (raw)
In-Reply-To: <20260120143124.1822121-4-cel@kernel.org>

> +static int rdma_rw_init_mr_wrs_bvec(struct rdma_rw_ctx *ctx, struct ib_qp *qp,
> +		u32 port_num, const struct bio_vec *bvec, u32 nr_bvec,
> +		u32 offset, u64 remote_addr, u32 rkey,
> +		enum dma_data_direction dir)

Any reason this is not using the bvec_iter like the other paths?

Yhe mapping to the scatterlist would then basically be a much
simplified version of __blk_rq_map_sg.

> +		dma_addr = ib_dma_map_bvec(dev, bv, dir);
> +		if (ib_dma_mapping_error(dev, dma_addr)) {
> +			ret = -ENOMEM;
> +			goto out_unmap;
> +		}
> +
> +		/* sg_set_page() initializes the entry; ib_map_mr_sg() uses
> +		 * only sg_dma_address/len, ignoring the page pointer.
> +		 */
> +		sg_set_page(&sgl[i], bv->bv_page, len, bv->bv_offset);
> +		sg_dma_address(&sgl[i]) = dma_addr;
> +		sg_dma_len(&sgl[i]) = len;

And once we have a scatterlist, this should probably just use
ib_dma_map_sg* ?  And maybe rdma_rw_init_one_mr?

> +	/*
> +	 * For bvec MR path: store synthetic scatterlist with DMA addresses
> +	 * for cleanup. Only valid when type == RDMA_RW_MR and initialized
> +	 * via rdma_rw_ctx_init_bvec().
> +	 */
> +	struct scatterlist	*mr_sgl;
> +	u32			mr_sg_cnt;
>  };

This probably should be in the reg union arm and thus the separate
allocatiom?

  reply	other threads:[~2026-01-21  9:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-20 14:31 [PATCH v2 0/4] Add a bio_vec based API to core/rw.c Chuck Lever
2026-01-20 14:31 ` [PATCH v2 1/4] RDMA/core: add bio_vec based RDMA read/write API Chuck Lever
2026-01-21  8:42   ` Christoph Hellwig
2026-01-21  8:48     ` Leon Romanovsky
2026-01-21  8:57       ` Christoph Hellwig
2026-01-21 10:16         ` Leon Romanovsky
2026-01-21  8:56   ` Christoph Hellwig
2026-01-21 14:14     ` Chuck Lever
2026-01-21 14:57       ` Christoph Hellwig
2026-01-21 15:10         ` Chuck Lever
2026-01-20 14:31 ` [PATCH v2 2/4] RDMA/core: use IOVA-based DMA mapping for bvec RDMA operations Chuck Lever
2026-01-21  8:51   ` Christoph Hellwig
2026-01-20 14:31 ` [PATCH v2 3/4] RDMA/core: add MR support for bvec-based " Chuck Lever
2026-01-21  9:05   ` Christoph Hellwig [this message]
2026-01-20 14:31 ` [PATCH v2 4/4] svcrdma: use bvec-based RDMA read/write API Chuck Lever

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260121090508.GE16458@lst.de \
    --to=hch@lst.de \
    --cc=cel@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=dai.ngo@oracle.com \
    --cc=jgg@nvidia.com \
    --cc=jlayton@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=neilb@ownmail.net \
    --cc=okorniev@redhat.com \
    --cc=tom@talpey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.