Skip to content

RFC add BPF-driven requests

Pavel Begunkov io-uring 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest4 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4bpf: add IOURING program typefs/io_uring.c include/linux/bpf_types.h include/uapi/linux/bpf.h +2 more+28 -00 replies
2/4io_uring: implement bpf prog registrationfs/io_uring.c include/uapi/linux/io_uring.h+82 -00 replies
3/4io_uring: add IORING_OP_BPFfs/io_uring.c include/uapi/linux/io_uring.h+84 -00 replies
4/4io_uring: enable BPF to submit SQEsfs/io_uring.c include/uapi/linux/bpf.h+72 -80 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC 0/4] add BPF-driven requests

Pretty much an RFC for executing BPF requests in io_uring to start a discussion, so any ideas and wish lists are welcom. Some technical but not much important for the discussion detais are omitted in the patchset, i.e. good cancellation system, optimisations and some BPF specific parts.

Some of major missing points:
1. We need to pass an CQE/result of a previous linked request to BPF.

2. Whether to keep to a new IORING_OP_BPF opcode, or do it in a common path for each request, e.g. on CQE completion. The former looks saner, but is not nicely aligned with (1.).

3. Allow BPF programs to generate CQEs not binded to a request. A problem can be with supporting overflowed CQEs, it's either to always kmalloc()'ing storage for them instead of using req's memory or piling up on top. Eventually we will need it anyway to be able to post several CQEs for a single requests.

Pavel Begunkov (4):
bpf: add IOURING program type
io_uring: implement bpf prog registration
io_uring: add IORING_OP_BPF
io_uring: enable BPF to submit SQEs

 fs/io_uring.c                 | 259 +++++++++++++++++++++++++++++++++-
 include/linux/bpf_types.h     |   2 +
 include/uapi/linux/bpf.h      |   2 +
 include/uapi/linux/io_uring.h |   3 +
 kernel/bpf/syscall.c          |   1 +
 kernel/bpf/verifier.c         |   3 +
 6 files changed, 264 insertions(+), 6 deletions(-)
Signature · 1 line
2.24.0