]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
io_uring/zcrx: notify user when out of buffers
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 19 May 2026 11:44:32 +0000 (12:44 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 26 May 2026 16:42:01 +0000 (10:42 -0600)
commit0719e10d826aa0ba4840917d0261986eaead9a51
tree7c48c63ba0815792df9ac3e2e7db3558759e3a73
parent8503f2de11f7fe78a7fdb87746255c8d02897279
io_uring/zcrx: notify user when out of buffers

There are currently no easy ways for the user to know if zcrx is out of
buffers and page pool fails to allocate. Add uapi for zcrx to communicate
it back.

It's implemented as a separate CQE, which for now is posted to the creator
ctx. To use it, on registration the user space needs to pass an instance
of struct zcrx_notification_desc, which tells the kernel the user_data
for resulting CQEs and which event types are expected / allowed.

When an allowed event happens, zcrx will post a CQE containing the
specified user_data, and lower bits of cqe->res will be set to the event
mask. Before the kernel could post another notification of the given
type, the user needs to acknowledge that it processed the previous one
by issuing IORING_REGISTER_ZCRX_CTRL with ZCRX_CTRL_ARM_NOTIFICATION.

The only notification type the patch implements is
ZCRX_NOTIF_NO_BUFFERS, but we'll need more of them in the future.

Co-developed-by: Vishwanath Seshagiri <vishs@meta.com>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Vishwanath Seshagiri <vishs@meta.com>
Link: https://patch.msgid.link/35cd307a03a43583838a2e151fc641c69abd786f.1779189667.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/uapi/linux/io_uring/zcrx.h
io_uring/io_uring.c
io_uring/io_uring.h
io_uring/zcrx.c
io_uring/zcrx.h