nvme: add support for pre-mapped IO buffers
authorJens Axboe <axboe@kernel.dk>
Fri, 17 Dec 2021 19:33:56 +0000 (12:33 -0700)
committerJens Axboe <axboe@kernel.dk>
Sun, 18 Dec 2022 18:20:05 +0000 (11:20 -0700)
commiteed468ab1ce95e97ab1a707c6a309a8f16ce69d1
treee8ef430adde0ce817bc8f7b6cf98964979b4fc6c
parent67a2b8bfb94883088130cb73e4307f0489a34cb5
nvme: add support for pre-mapped IO buffers

Normally when an IO comes in, NVMe will DMA map the page(s) and setup
the PRP or SG list. When IO completes, the mappings are undone. This
takes time, obviously.

Add support for mapping buffers upfront, by filling in the
mq_ops->dma_map() handler. The ownership of the mappings goes to the
caller, and the caller is responsible for tearing them down.

This is good for a ~4% improvement in peak IOPS without an IOMMU,
much more so with an IOMMU enabled.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/nvme/host/pci.c