Skip to content

[GIT PULL] setup: add variant taking io_uring_buf_reg input - #1661

Open
eqvinox wants to merge 1 commit into
axboe:masterfrom
eqvinox:io_uring_setup_buf_ring_param
Open

eqvinox wants to merge 1 commit into
axboe:masterfrom
eqvinox:io_uring_setup_buf_ring_param

Conversation

@eqvinox

@eqvinox eqvinox commented Oct 22, 2026

Copy link
Copy Markdown

context: #1657 (comment) (nothing related to alignment yet, just prep work. It's useful on its own since it allows using min_left with liburing buffer ring setup.)

I'm a little unhappy with the long function name but didn't have better/shorter ideas.

Also, there's that architecture specific part for HPPA… I compile-tested with a cross compiler but can't properly test it. At least I don't seem to have made silly typos making it outright fail build.


struct io_uring_buf_reg has gotten the "min_size" field added recently, and now something for alignment for incremental consumption is being worked on. io_uring_setup_buf_ring has the original fields as function parameters, individually, so there's no way to pass min_size or anything else added in the future.

Rather than creating a new variant with different parameters each time something gets added, this just creates one that takes io_uring_buf_reg as input. This way, at least additions that don't need special handling in setup can just be transparently passed through to the kernel. It's const since (a) it can indeed be a constant for simple applications and (b) it makes obvious to consumers it won't be updated for changes.

Test by running recvmsg-inc-tail twice, the 2nd time using this new function instead of setting up its own buffer ring.


git request-pull output:

The following changes since commit f33bc2f24cf3b38df8553aab5f9714fc5cf0aff4:

  Merge branch 'man-small-fixes' of github.com:ilyas-mallah/liburing (2026-10-22 13:28:14 -0600)

are available in the Git repository at:

  https://github.com/eqvinox/liburing.git io_uring_setup_buf_ring_param

for you to fetch changes up to 3306b24d472335d201ef0d0dbe6caa1d63dc9735:

  setup: add variant taking io_uring_buf_reg input (2026-10-23 00:25:53 +0200)

----------------------------------------------------------------
David 'equinox' Lamparter (1):
      setup: add variant taking io_uring_buf_reg input

 man/io_uring_setup_buf_ring.3       | 25 ++++++++++++++++++++++---
 man/io_uring_setup_buf_ring_param.3 |  1 +
 src/include/liburing.h              |  3 +++
 src/liburing-ffi.map                |  1 +
 src/liburing.map                    |  5 +++++
 src/setup.c                         | 55 ++++++++++++++++++++++++++++++++++---------------------
 test/recvmsg-inc-tail.c             | 49 ++++++++++++++++++++++++++++++++++++++++++++++---
 7 files changed, 112 insertions(+), 27 deletions(-)
 create mode 120000 man/io_uring_setup_buf_ring_param.3

By submitting this pull request, I acknowledge that:

  1. I have followed the above pull request guidelines.
  2. I have the rights to submit this work under the same license.
  3. I agree to a Developer Certificate of Origin (see https://developercertificate.org for more information).

struct io_uring_buf_reg has gotten the "min_size" field added recently,
and now something for alignment for incremental consumption is being
worked on.  io_uring_setup_buf_ring has the original fields as function
parameters, individually, so there's no way to pass min_size or anything
else added in the future.

Rather than creating a new variant with different parameters each time
something gets added, this just creates one that takes io_uring_buf_reg
as input.  This way, at least additions that don't need special handling
in setup can just be transparently passed through to the kernel.  It's
const since (a) it can indeed be a constant for simple applications and
(b) it makes obvious to consumers it won't be updated for changes.

Test by running recvmsg-inc-tail twice, the 2nd time using this new
function instead of setting up its own buffer ring.

Signed-off-by: David 'equinox' Lamparter <equinox@diac24.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant