From: Ming Lei <ming.lei@redhat.com>
To: Jens Axboe <axboe@kernel.dk>, io-uring@vger.kernel.org
Cc: Caleb Sander Mateos <csander@purestorage.com>,
Akilesh Kailash <akailash@google.com>,
bpf@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,
Ming Lei <ming.lei@redhat.com>
Subject: [PATCH 0/5] io_uring: add IORING_OP_BPF for extending io_uring
Date: Wed, 5 Nov 2025 00:21:15 +0800 [thread overview]
Message-ID: <20251104162123.1086035-1-ming.lei@redhat.com> (raw)
Hello,
Add IORING_OP_BPF for extending io_uring operations, follows typical cases:
- buffer registered zero copy [1]
Also there are some RAID like ublk servers which needs to generate data
parity in case of ublk zero copy
- extend io_uring operations from application
Easy to add one new syscall with IORING_OP_BPF
- extend 64 byte SQE
bpf map can store IO data conveniently
- communicate in IO chain
IORING_OP_BPF can be used for communicate among IOs seamlessly without requiring
extra syscall
- pretty handy to inject error for test purpose
The 1st 3 patches adds IORING_OP_BPF framework & struct_ops.
The 4th patch adds both fixed and plain user buffer support, in future
vector and fixed vector buffer can be supported.
The last patch exports io_uring_bpf_req_memcpy() for copying data among
different request buffers, so far fixed and plain buffers are supported,
this is also one demo for showing how to solve above requirements with
IORING_OP_BPF.
Follows liburing support and tests:
https://github.com/ming1/liburing/commits/uring_bpf/
Any comments & feedback are welcome!
[1] lpc2024: ublk based zero copy I/O - use case in Android
https://lpc.events/event/18/contributions/1710/attachments/1440/3070/LPC2024_ublk_zero_copy.pdf
Ming Lei (5):
io_uring: prepare for extending io_uring with bpf
io_uring: bpf: add io_uring_ctx setup for BPF into one list
io_uring: bpf: extend io_uring with bpf struct_ops
io_uring: bpf: add buffer support for IORING_OP_BPF
io_uring: bpf: add io_uring_bpf_req_memcpy() kfunc
include/linux/io_uring_types.h | 5 +
include/uapi/linux/io_uring.h | 56 ++++
init/Kconfig | 7 +
io_uring/Makefile | 1 +
io_uring/bpf.c | 556 +++++++++++++++++++++++++++++++++
io_uring/io_uring.c | 8 +
io_uring/io_uring.h | 6 +-
io_uring/opdef.c | 10 +
io_uring/uring_bpf.h | 86 +++++
9 files changed, 733 insertions(+), 2 deletions(-)
create mode 100644 io_uring/bpf.c
create mode 100644 io_uring/uring_bpf.h
--
2.47.0
next reply other threads:[~2025-11-04 16:21 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-04 16:21 Ming Lei [this message]
2025-11-04 16:21 ` [PATCH 1/5] io_uring: prepare for extending io_uring with bpf Ming Lei
2025-11-04 16:21 ` [PATCH 2/5] io_uring: bpf: add io_uring_ctx setup for BPF into one list Ming Lei
2025-11-04 16:21 ` [PATCH 3/5] io_uring: bpf: extend io_uring with bpf struct_ops Ming Lei
2025-11-07 19:02 ` kernel test robot
2025-11-08 6:53 ` kernel test robot
2025-11-13 10:32 ` Stefan Metzmacher
2025-11-13 10:59 ` Ming Lei
2025-11-13 11:19 ` Stefan Metzmacher
2025-11-14 3:00 ` Ming Lei
2025-11-19 14:39 ` Jonathan Corbet
2025-11-20 1:46 ` Ming Lei
2025-11-20 1:51 ` Ming Lei
2025-11-04 16:21 ` [PATCH 4/5] io_uring: bpf: add buffer support for IORING_OP_BPF Ming Lei
2025-11-13 10:42 ` Stefan Metzmacher
2025-11-13 11:04 ` Ming Lei
2025-11-13 11:25 ` Stefan Metzmacher
2025-11-04 16:21 ` [PATCH 5/5] io_uring: bpf: add io_uring_bpf_req_memcpy() kfunc Ming Lei
2025-11-07 18:51 ` kernel test robot
2025-11-05 12:47 ` [PATCH 0/5] io_uring: add IORING_OP_BPF for extending io_uring Pavel Begunkov
2025-11-05 15:57 ` Ming Lei
2025-11-06 16:03 ` Pavel Begunkov
2025-11-07 15:54 ` Ming Lei
2025-11-11 14:07 ` Pavel Begunkov
2025-11-13 4:18 ` Ming Lei
2025-11-19 19:00 ` Pavel Begunkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251104162123.1086035-1-ming.lei@redhat.com \
--to=ming.lei@redhat.com \
--cc=akailash@google.com \
--cc=ast@kernel.org \
--cc=axboe@kernel.dk \
--cc=bpf@vger.kernel.org \
--cc=csander@purestorage.com \
--cc=io-uring@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox