io_uring/bpf-ops: implement loop_step with BPF struct_ops

Introduce io_uring BPF struct ops implementing the loop_step callback,
which will allow BPF to overwrite the default io_uring event loop logic.

The callback takes an io_uring context, the main role of which is to be
passed to io_uring kfuncs. The other argument is a struct iou_loop_params,
which BPF can use to request CQ waiting and communicate other parameters.
See the event loop description in the previous patch for more details.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://patch.msgid.link/98db437651ce64e9cbeb611c60bf5887259db09f.1772109579.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Pavel Begunkov
2026-02-26 12:48:39 +00:00
committed by Jens Axboe
parent 033af2b3eb
commit d0e437b76b
5 changed files with 148 additions and 0 deletions

View File

@@ -14,3 +14,8 @@ config IO_URING_BPF
def_bool y
depends on BPF
depends on NET
config IO_URING_BPF_OPS
def_bool y
depends on IO_URING
depends on BPF_SYSCALL && BPF_JIT && DEBUG_INFO_BTF