summaryrefslogtreecommitdiff
path: root/io_uring/dma-buf.h
AgeCommit message (Collapse)Author
2 daysio_uring/dma-buf: don't fail fixed buffers without dma-buf supportAnuj Gupta
io_attach_dmabuf_map() is called for every fixed read/write, but returns -EOPNOTSUPP when CONFIG_DMA_SHARED_BUFFER is disabled before checking whether the request uses a dma-buf at all. So READ_FIXED and WRITE_FIXED fail for ordinary registered buffers. Check REQ_F_DMABUF first. Fixes: 62e4bf5b25d4 ("io_uring/rsrc: add dmabuf backed registered buffers") Signed-off-by: Anuj Gupta <anuj20.g@samsung.com> Link: https://patch.msgid.link/20261022132027.2293931-1-anuj1072538@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
10 daysio_uring/rsrc: add dmabuf backed registered buffersPavel Begunkov
Implement dmabuf backed registered buffers. To register them, the user should specify IO_REGBUF_TYPE_DMABUF for the regitration and pass the desired dmabuf fd and a file for which it should be registered. >From there, it can be used with io_uring read/write requests IORING_OP_{READ,WRITE}_FIXED) as normal. The requests should be issued against the file specified during registration, and otherwise they'll be failed. The user should also be prepared to handle spurious -EAGAIN by reissuing the request. Internally, dmabuf registered buffers is an optin feature for io_uring request opcodes and they should pass a special flag on import to use it. Suggested-by: David Wei <dw@davidwei.uk> Suggested-by: Vishal Verma <vishal1.verma@intel.com> Suggested-by: Tushar Gohad <tushar.gohad@intel.com> Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://patch.msgid.link/4aa230df871ee275536f367087b44ebfebb88cc1.1791975048.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>