<feed xmlns='http://www.w3.org/2005/Atom'>
<title>wireguard-linux/io_uring/dma-buf.c, branch stable</title>
<subtitle>WireGuard for the Linux kernel</subtitle>
<id>https://git.zx2c4.com/wireguard-linux/atom/io_uring/dma-buf.c?h=stable</id>
<link rel='self' href='https://git.zx2c4.com/wireguard-linux/atom/io_uring/dma-buf.c?h=stable'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/'/>
<updated>2026-10-16T14:23:04Z</updated>
<entry>
<title>io_uring/dma-buf: allow cloning registered dma-bufs</title>
<updated>2026-10-16T14:23:04Z</updated>
<author>
<name>Pavel Begunkov</name>
<email>asml.silence@gmail.com</email>
</author>
<published>2026-10-16T09:26:55Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=f57b957778a33d98e15e394ab426e93c3ead659c'/>
<id>urn:sha1:f57b957778a33d98e15e394ab426e93c3ead659c</id>
<content type='text'>
One problem that was brought up is that the file table size is often a
limiting factor when working with dma-bufs, which is quite an old
problem. With a single io_uring people can work it around by closing
the dma-buf fd after registration, but for more complex cases we need
a way to dynamically register it into another ring. We also need to
deduplicate internal registrations as each creates a new attachment and
related structures, which could involve large allocations and iommu
mappings. Solve it by enabling io_uring buffer cloning.

I made dma-bufs registered for io_uring not cloneable between rings
because the implementation could modify parts of struct io_buf_dma
without any locking and sharing it would've created races. That was an
optimisation that got dropped at some point for simplicity, so we can
safely enable cloning back as long as IORING_SETUP_IOPOLL rejection
is honoured. Kill the uncloneable flag as unused as well.

Reported-by: William Power &lt;william.power@intel.com&gt;
Reported-by: Tushar Gohad &lt;tushar.gohad@intel.com&gt;
Signed-off-by: Pavel Begunkov &lt;asml.silence@gmail.com&gt;
Link: https://patch.msgid.link/b76cf21ee0e2362489c864e43781b20d95fd75f7.1792142588.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>io_uring/rsrc: add dmabuf backed registered buffers</title>
<updated>2026-10-14T13:36:03Z</updated>
<author>
<name>Pavel Begunkov</name>
<email>asml.silence@gmail.com</email>
</author>
<published>2026-10-14T11:02:11Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=62e4bf5b25d4458cf8aa9dece9022359f39f2294'/>
<id>urn:sha1:62e4bf5b25d4458cf8aa9dece9022359f39f2294</id>
<content type='text'>
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.

&gt;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 &lt;dw@davidwei.uk&gt;
Suggested-by: Vishal Verma &lt;vishal1.verma@intel.com&gt;
Suggested-by: Tushar Gohad &lt;tushar.gohad@intel.com&gt;
Signed-off-by: Pavel Begunkov &lt;asml.silence@gmail.com&gt;
Link: https://patch.msgid.link/4aa230df871ee275536f367087b44ebfebb88cc1.1791975048.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
</feed>
