From: Keith Busch <kbusch@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Jens Axboe <axboe@kernel.dk>, Sagi Grimberg <sagi@grimberg.me>,
Chaitanya Kulkarni <kch@nvidia.com>,
Kanchan Joshi <joshi.k@samsung.com>,
Leon Romanovsky <leon@kernel.org>,
Nitesh Shetty <nj.shetty@samsung.com>,
Logan Gunthorpe <logang@deltatee.com>,
linux-block@vger.kernel.org, linux-nvme@lists.infradead.org,
Leon Romanovsky <leonro@nvidia.com>
Subject: Re: [PATCH 6/8] nvme-pci: convert the data mapping to blk_rq_dma_map
Date: Mon, 23 Jun 2025 09:44:05 -0600 [thread overview]
Message-ID: <aFl2RWQWaldHce4x@kbusch-mbp> (raw)
In-Reply-To: <20250623141259.76767-7-hch@lst.de>
On Mon, Jun 23, 2025 at 04:12:28PM +0200, Christoph Hellwig wrote:
> Use the blk_rq_dma_map API to DMA map requests instead of scatterlists.
> This removes the need to allocate a scatterlist covering every segment,
> and thus the overall transfer length limit based on the scatterlist
> allocation.
>
> Instead the DMA mapping is done by iterating the bio_vec chain in the
> request directly. The unmap is handled differently depending on how
> we mapped:
>
> - when using an IOMMU only a single IOVA is used, and it is stored in
> iova_state
> - for direct mappings that don't use swiotlb and are cache coherent,
> unmap is not needed at all
> - for direct mappings that are not cache coherent or use swiotlb, the
> physical addresses are rebuild from the PRPs or SGL segments
>
> The latter unfortunately adds a fair amount of code to the driver, but
> it is code not used in the fast path.
>
> The conversion only covers the data mapping path, and still uses a
> scatterlist for the multi-segment metadata case. I plan to convert that
> as soon as we have good test coverage for the multi-segment metadata
> path.
Looks good.
Reviewed-by: Keith Busch <kbusch@kernel.org>
next prev parent reply other threads:[~2025-06-23 19:42 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-23 14:12 new DMA API conversion for nvme-pci v2 Christoph Hellwig
2025-06-23 14:12 ` [PATCH 1/8] block: don't merge different kinds of P2P transfers in a single bio Christoph Hellwig
2025-06-23 15:43 ` Keith Busch
2025-06-23 14:12 ` [PATCH 2/8] block: add scatterlist-less DMA mapping helpers Christoph Hellwig
2025-06-23 15:43 ` Keith Busch
2025-06-23 14:12 ` [PATCH 3/8] nvme-pci: refactor nvme_pci_use_sgls Christoph Hellwig
2025-06-23 15:27 ` Keith Busch
2025-06-24 12:46 ` Christoph Hellwig
2025-06-25 4:28 ` Chaitanya Kulkarni
2025-06-25 6:07 ` Christoph Hellwig
2025-06-23 14:12 ` [PATCH 4/8] nvme-pci: merge the simple PRP and SGL setup into a common helper Christoph Hellwig
2025-06-23 15:43 ` Keith Busch
2025-06-23 14:12 ` [PATCH 5/8] nvme-pci: remove superfluous arguments Christoph Hellwig
2025-06-23 14:12 ` [PATCH 6/8] nvme-pci: convert the data mapping to blk_rq_dma_map Christoph Hellwig
2025-06-23 15:44 ` Keith Busch [this message]
2025-06-23 14:12 ` [PATCH 7/8] nvme-pci: replace NVME_MAX_KB_SZ with NVME_MAX_BYTE Christoph Hellwig
2025-06-23 15:44 ` Keith Busch
2025-06-23 14:12 ` [PATCH 8/8] nvme-pci: rework the build time assert for NVME_MAX_NR_DESCRIPTORS Christoph Hellwig
2025-06-23 15:44 ` Keith Busch
2025-06-23 21:45 ` new DMA API conversion for nvme-pci v2 Chaitanya Kulkarni
2025-06-25 4:32 ` Chaitanya Kulkarni
-- strict thread matches above, loose matches on Subject: below --
2025-06-25 11:34 new DMA API conversion for nvme-pci v3 Christoph Hellwig
2025-06-25 11:35 ` [PATCH 6/8] nvme-pci: convert the data mapping to blk_rq_dma_map Christoph Hellwig
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=aFl2RWQWaldHce4x@kbusch-mbp \
--to=kbusch@kernel.org \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=joshi.k@samsung.com \
--cc=kch@nvidia.com \
--cc=leon@kernel.org \
--cc=leonro@nvidia.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=logang@deltatee.com \
--cc=nj.shetty@samsung.com \
--cc=sagi@grimberg.me \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).