From: Ming Lei <ming.lei@redhat.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: io-uring@vger.kernel.org, Pavel Begunkov <asml.silence@gmail.com>,
Caleb Sander Mateos <csander@purestorage.com>,
Stefan Metzmacher <metze@samba.org>,
Ming Lei <ming.lei@redhat.com>
Subject: [PATCH v2 0/13] io_uring: add IORING_OP_BPF for extending io_uring
Date: Tue, 6 Jan 2026 18:11:09 +0800 [thread overview]
Message-ID: <20260106101126.4064990-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
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
V2:
- per-ring struct ops (Stefan Metzmacher, Caleb Sander Mateos)
- refactor io_import_fixed()/io_prep_reg_iovec()/io_import_reg_vec()
for allowing to handle multiple buffers for single request
- kernel selftests
- all kinds of comments from Caleb Sander Mateos
- support vectored and registered vector buffer
Ming Lei (12):
io_uring: make io_import_fixed() global
io_uring: refactor io_prep_reg_iovec() for BPF kfunc use
io_uring: refactor io_import_reg_vec() for BPF kfunc use
io_uring: prepare for extending io_uring with bpf
io_uring: bpf: extend io_uring with bpf struct_ops
io_uring: bpf: implement struct_ops registration
io_uring: bpf: add BPF buffer descriptor for IORING_OP_BPF
io_uring: bpf: add uring_bpf_memcpy() kfunc
selftests/io_uring: add BPF struct_ops and kfunc tests
selftests/io_uring: add bpf_memcpy selftest for uring_bpf_memcpy()
kfunc
selftests/io_uring: add copy_user_to_fixed() and copy_fixed_to_user()
bpf_memcpy tests
selftests/io_uring: add copy_user_to_reg_vec() and
copy_reg_vec_to_user() bpf_memcpy tests
Pavel Begunkov (1):
selftests/io_uring: update mini liburing
include/linux/io_uring_types.h | 5 +
include/uapi/linux/io_uring.h | 40 ++
init/Kconfig | 7 +
io_uring/Makefile | 1 +
io_uring/bpf_op.c | 669 ++++++++++++++++++
io_uring/bpf_op.h | 61 ++
io_uring/io_uring.c | 5 +
io_uring/io_uring.h | 6 +-
io_uring/opdef.c | 16 +
io_uring/rsrc.c | 46 +-
io_uring/rsrc.h | 68 +-
tools/include/io_uring/mini_liburing.h | 67 +-
tools/testing/selftests/Makefile | 3 +-
tools/testing/selftests/io_uring/.gitignore | 2 +
tools/testing/selftests/io_uring/Makefile | 173 +++++
.../selftests/io_uring/basic_bpf_ops.bpf.c | 94 +++
.../selftests/io_uring/basic_bpf_ops.c | 215 ++++++
.../selftests/io_uring/bpf_memcpy.bpf.c | 98 +++
tools/testing/selftests/io_uring/bpf_memcpy.c | 517 ++++++++++++++
.../selftests/io_uring/include/iou_test.h | 98 +++
tools/testing/selftests/io_uring/runner.c | 206 ++++++
21 files changed, 2339 insertions(+), 58 deletions(-)
create mode 100644 io_uring/bpf_op.c
create mode 100644 io_uring/bpf_op.h
create mode 100644 tools/testing/selftests/io_uring/.gitignore
create mode 100644 tools/testing/selftests/io_uring/Makefile
create mode 100644 tools/testing/selftests/io_uring/basic_bpf_ops.bpf.c
create mode 100644 tools/testing/selftests/io_uring/basic_bpf_ops.c
create mode 100644 tools/testing/selftests/io_uring/bpf_memcpy.bpf.c
create mode 100644 tools/testing/selftests/io_uring/bpf_memcpy.c
create mode 100644 tools/testing/selftests/io_uring/include/iou_test.h
create mode 100644 tools/testing/selftests/io_uring/runner.c
--
2.47.0
next reply other threads:[~2026-01-06 10:11 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-06 10:11 Ming Lei [this message]
2026-01-06 10:11 ` [PATCH V2 01/13] io_uring: make io_import_fixed() global Ming Lei
2026-01-06 10:11 ` [PATCH V2 02/13] io_uring: refactor io_prep_reg_iovec() for BPF kfunc use Ming Lei
2026-01-06 10:11 ` [PATCH V2 03/13] io_uring: refactor io_import_reg_vec() " Ming Lei
2026-01-06 10:11 ` [PATCH V2 04/13] io_uring: prepare for extending io_uring with bpf Ming Lei
2026-01-06 10:11 ` [PATCH V2 05/13] io_uring: bpf: extend io_uring with bpf struct_ops Ming Lei
2026-01-06 10:11 ` [PATCH V2 06/13] io_uring: bpf: implement struct_ops registration Ming Lei
2026-01-06 10:11 ` [PATCH V2 07/13] io_uring: bpf: add BPF buffer descriptor for IORING_OP_BPF Ming Lei
2026-01-06 10:11 ` [PATCH V2 08/13] io_uring: bpf: add uring_bpf_memcpy() kfunc Ming Lei
2026-01-06 10:11 ` [PATCH V2 09/13] selftests/io_uring: update mini liburing Ming Lei
2026-01-06 10:11 ` [PATCH V2 10/13] selftests/io_uring: add BPF struct_ops and kfunc tests Ming Lei
2026-01-06 10:11 ` [PATCH V2 11/13] selftests/io_uring: add bpf_memcpy selftest for uring_bpf_memcpy() kfunc Ming Lei
2026-01-06 10:11 ` [PATCH V2 12/13] selftests/io_uring: add copy_user_to_fixed() and copy_fixed_to_user() bpf_memcpy tests Ming Lei
2026-01-06 10:11 ` [PATCH V2 13/13] selftests/io_uring: add copy_user_to_reg_vec() and copy_reg_vec_to_user() " Ming Lei
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=20260106101126.4064990-1-ming.lei@redhat.com \
--to=ming.lei@redhat.com \
--cc=asml.silence@gmail.com \
--cc=axboe@kernel.dk \
--cc=csander@purestorage.com \
--cc=io-uring@vger.kernel.org \
--cc=metze@samba.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