|
|
Log in / Subscribe / Register

io_uring/net: support registered buffer for plain send and recv

From:  Ming Lei <tom.leiming-AT-gmail.com>
To:  Jens Axboe <axboe-AT-kernel.dk>, io-uring-AT-vger.kernel.org
Subject:  [PATCH 0/2] io_uring/net: support registered buffer for plain send and recv
Date:  Mon, 01 Jun 2026 04:58:44 -0500
Message-ID:  <20260601095853.3670199-1-ming.lei@redhat.com>
Cc:  Ming Lei <tom.leiming-AT-gmail.com>
Archive-link:  Article

From: Ming Lei <tom.leiming@gmail.com>

Hi,

This series wires IORING_RECVSEND_FIXED_BUF into the plain IORING_OP_SEND
and IORING_OP_RECV paths. So far the flag has only been honoured on the
SEND_ZC path, even though the import wiring is already present for plain
send and completely absent for recv.

Motivation: targets such as ublk's NBD backend want to push/pull I/O data
directly to/from an io_uring registered buffer over a plain send/recv on a
TCP socket, without the SEND_ZC notification machinery.

The flag is accepted at prep time for the non-vectorized IORING_OP_SEND /
IORING_OP_RECV opcodes only, and is mutually exclusive with buffer select,
bundles and (for recv) multishot. The registered buffer is imported lazily
at issue time via io_import_reg_buf() (mirroring the existing send path),
and the resulting bvec iter persists in async_data so MSG_WAITALL partial
send/recv retries resume at the right offset.

Patch 1 is the kernel change.
Patch 2 adds a liburing test and is meant for the liburing tree. It covers
send-fixed/recv-fixed/both-fixed roundtrips (with non-zero offsets into
distinct registered buffers), a large MSG_WAITALL transfer that exercises
the persisted bvec iter across partial retries, and the negative
validation cases (sendmsg/bundle/recv-multishot rejected with -EINVAL, bad
buf_index returning -EFAULT).

Ming Lei (2):
  io_uring/net: support registered buffer for plain send and recv
  test: add fixed-buf-send-recv for registered buffer send/recv

 io_uring/net.c             |  46 ++++++-
 test/Makefile              |   1 +
 test/fixed-buf-send-recv.c | 300 +++++++++++++++++++++++++++++++++++++
 3 files changed, 345 insertions(+), 2 deletions(-)

--
2.54.0



Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds