[PATCH] nvme-pci: fix dma unmapping when using PRPs and not using the IOVA mapping
Christoph Hellwig
hch at lst.de
Mon Jul 7 08:01:16 PDT 2025
On Mon, Jul 07, 2025 at 08:29:57AM -0600, Keith Busch wrote:
> Given it works fine for SGL, how do you feel about unconditionally
> creating an NVMe SGL, and then call some "nvme_sgl_to_prp()" helper only
> when needed? This means we only have one teardown path that matches the
> setup.
I briefly thought about it and discard it because:
1) I thought it was too complex
2) the need to allocate relatively expensive data dma coherent
memory for something that is never DMAed to.
> This is something I hacked up over the weekend. It's only lightly
> tested, and I know there's a bug somewhere here with the chainging, but
> it's a start.
This looks a lot less complex than I feared. I still don't think having
to allocate DMA memory for storing the ranges is all that great, mostly
because this is exactly the path we're going to hit for non-coherent
attachment where the DMA coherent memory will have a performance impact
because it is marked uncachable.
More information about the Linux-nvme
mailing list