Skip to content

Add support for vectored registered buffers

Pavel Begunkov io-uring 4 versions – Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest9 patches 1 replyApplied
  2. v39 patches 0 repliesSuperseded
  3. v29 patches 6 repliesApplied
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v18 patches16 repliesSuperseded

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/9io_uring: introduce struct iou_vecinclude/linux/io_uring_types.h io_uring/rsrc.c io_uring/rsrc.h +2 more+39 -120 replies
2/9io_uring: add infra for importing vectored reg buffersinclude/linux/io_uring_types.h io_uring/rsrc.c io_uring/rsrc.h+138 -20 replies
3/9io_uring/rw: implement vectored registered rwinclude/uapi/linux/io_uring.h io_uring/opdef.c io_uring/rw.c +1 more+94 -00 replies
4/9io_uring/rw: defer reg buf vec importinclude/linux/io_uring_types.h io_uring/rw.c+37 -80 replies
5/9io_uring/net: combine msghdr copyio_uring/net.c+19 -270 replies
6/9io_uring/net: pull vec alloc out of msghdr importio_uring/net.c+15 -80 replies
7/9io_uring/net: convert to struct iou_vecio_uring/alloc_cache.h io_uring/net.c io_uring/net.h+25 -410 replies
8/9io_uring/net: implement vectored reg bufs for zctxio_uring/net.c+55 -40 replies
9/9io_uring: cap cached iovec/bvec sizeio_uring/net.c io_uring/rsrc.h io_uring/rw.c+8 -00 replies

Reviews trailers per patch

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

Read the v4 thread

Cover letter [PATCH v4 0/9] Add support for vectored registered buffers

Add registered buffer support for vectored io_uring operations. That allows to pass an iovec, all entries of which must belong to and point into the same registered buffer specified by sqe->buf_index.

The series covers zerocopy sendmsg and reads / writes. Reads and writes are implemented as new opcodes, while zerocopy sendmsg reuses IORING_RECVSEND_FIXED_BUF for the user API.

Results are aligned to what one would expect from registered buffers:

t/io_uring + nullblk, single segment 16K:
34 -> 46 GiB/s
examples/send-zerocopy.c default send size (64KB):
82558 -> 123855 MB/s

The series is placed on top of 6.15 + zcrx + epoll.

v4: Address cast and include warnings
v3: Handle 32 bit where bvec is larger than iovec
v2: Nowarn alloc
Cap bvec caching
Check length overflow
Reject 0 len segments
Check op direction
Other minor changes

Pavel Begunkov (9):
io_uring: introduce struct iou_vec
io_uring: add infra for importing vectored reg buffers io_uring/rw: implement vectored registered rw io_uring/rw: defer reg buf vec import io_uring/net: combine msghdr copy io_uring/net: pull vec alloc out of msghdr import io_uring/net: convert to struct iou_vec io_uring/net: implement vectored reg bufs for zctx
io_uring: cap cached iovec/bvec size

 include/linux/io_uring_types.h |  11 ++
 include/uapi/linux/io_uring.h  |   2 +
 io_uring/alloc_cache.h         |   9 --
 io_uring/net.c                 | 180 +++++++++++++++++++++------------
 io_uring/net.h                 |   6 +-
 io_uring/opdef.c               |  39 +++++++
 io_uring/rsrc.c                | 137 +++++++++++++++++++++++++
 io_uring/rsrc.h                |  23 +++++
 io_uring/rw.c                  |  99 ++++++++++++++++--
 io_uring/rw.h                  |   6 +-
 10 files changed, 420 insertions(+), 92 deletions(-)
Signature · 1 line
2.48.1