[PATCH v5 0/4] dma-buf backed NVMe passthrough I/O

Anuj Gupta anuj20.g at samsung.com
Wed Dec 2 00:51:02 PST 2026


This series adds support for dma-buf registered buffers in NVMe
uring_cmd passthrough.

Patch 1 adds import flags to io_import_reg_buf(). Patch 2 adds
io_uring_cmd_import_fixed_dmabuf(), so uring_cmd can users opt in to
dma-buf by calling it. Patch 3 lets the block layer map dma-buf
iterators for passthrough, and patch 4 enables it for the NVMe namespace
character device.

Tested with this liburing test:
https://github.com/anuj7781/liburing/tree/rw-dmabuf-pt

Changes since v4:
- add io_uring_cmd_import_fixed_dmabuf() instead of adding an import
  flags argument to io_uring_cmd_import_fixed() (Jens)

v4: https://lore.kernel.org/linux-block/20261119095615.1840522-1-anuj20.g@samsung.com/

Changes since v3:
- rebase on current for-next; no functional changes

v3: https://lore.kernel.org/linux-block/20261030014540.3065403-1-anuj1072538@gmail.com/

Changes since v2:
- return -EOPNOTSUPP when the controller has no dma-buf support (Pavel)

v2: https://lore.kernel.org/linux-block/20261022144501.2478417-1-anuj1072538@gmail.com/

Changes since v1:
- split into io_uring, block and nvme patches (Christoph)
- pass import flags to io_import_reg_buf() and
  io_uring_cmd_import_fixed(), and make callers opt in to dma-buf
  (Christoph, Pavel)
- add io_uring_cmd_hw_done(), so nvme no longer handles the dma-buf
  map (Pavel)
- warn if task_work is queued with a dma-buf map attached (Pavel)
- make the -EREMOTEIO conversion explicit and comment it (Christoph)
- refuse dma-bufs larger than 4GiB on the character device

v1: https://lore.kernel.org/linux-nvme/20261016103453.1129150-1-anuj1072538@gmail.com/

Anuj Gupta (4):
  io_uring/rsrc: pass import flags to io_import_reg_buf()
  io_uring/uring_cmd: support dma-buf registered buffers
  block: map dma-buf iterators in blk_rq_map_user_iov()
  nvme: support dma-buf registered buffers for passthrough

 block/blk-map.c              | 15 +++++++++++-
 drivers/nvme/host/core.c     | 16 +++++++++++++
 drivers/nvme/host/ioctl.c    |  4 ++--
 include/linux/io_uring/cmd.h | 18 +++++++++++++++
 io_uring/net.c               |  6 ++---
 io_uring/rsrc.c              |  6 ++---
 io_uring/rsrc.h              | 13 +++--------
 io_uring/rw.c                |  5 ++--
 io_uring/uring_cmd.c         | 44 +++++++++++++++++++++++++++++++++++-
 9 files changed, 105 insertions(+), 22 deletions(-)

-- 
2.25.1




More information about the Linux-nvme mailing list