public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] io_uring: add IORING_OP_BPF for extending io_uring
@ 2025-11-04 16:21 Ming Lei
  2025-11-04 16:21 ` [PATCH 1/5] io_uring: prepare for extending io_uring with bpf Ming Lei
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Ming Lei @ 2025-11-04 16:21 UTC (permalink / raw)
  To: Jens Axboe, io-uring
  Cc: Caleb Sander Mateos, Akilesh Kailash, bpf, Alexei Starovoitov,
	Ming Lei

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


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2025-11-11 14:07 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-04 16:21 [PATCH 0/5] io_uring: add IORING_OP_BPF for extending io_uring Ming Lei
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-04 16:21 ` [PATCH 4/5] io_uring: bpf: add buffer support for IORING_OP_BPF Ming Lei
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox