Skip to content

Commit

Permalink
Merge branch 'man-fixes' of https://github.com/wlukowicz/liburing
Browse files Browse the repository at this point in the history
* 'man-fixes' of https://github.com/wlukowicz/liburing:
  man/io_uring_register.2: improve IORING_REGISTER_BUFFERS2 description
  man: fix title headings
  man: fix buf ring registration flags
  • Loading branch information
axboe committed Dec 1, 2024
2 parents 65da697 + 416d96c commit 231d5c2
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 28 deletions.
6 changes: 3 additions & 3 deletions man/io_uring.7
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,8 @@ its return value.

The
.I flags
field carries request-specific information. As of the 6.0 kernel, the following
flags are defined:
field carries request-specific information. As of the 6.12 kernel,
the following flags are defined:

.TP
.B IORING_CQE_F_BUFFER
Expand Down Expand Up @@ -488,7 +488,7 @@ buffer space left, and hence the application should expect more completions
with this buffer ID. Each completion will continue where the previous one
left off. This can only happen if the provided buffer ring has been setup
with
.B IORING_REGISTER_PBUF_RING
.B IOU_PBUF_RING_INC
to allow for incremental / partial consumption of buffers.
.PP
The general sequence to read completion events off the completion queue is
Expand Down
2 changes: 1 addition & 1 deletion man/io_uring_prep_msg_ring_fd.3
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.\"
.\" SPDX-License-Identifier: LGPL-2.0-or-later
.\"
.TH io_uring_prep_msg_ring 3 "Mar 16, 2023" "liburing-2.4" "liburing Manual"
.TH io_uring_prep_msg_ring_fd 3 "Mar 16, 2023" "liburing-2.4" "liburing Manual"
.SH NAME
io_uring_prep_msg_ring_fd \- send a direct descriptor to another ring
.SH SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion man/io_uring_prep_read_fixed.3
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.\"
.\" SPDX-License-Identifier: LGPL-2.0-or-later
.\"
.TH io_uring_prep_read 3 "February 13, 2022" "liburing-2.1" "liburing Manual"
.TH io_uring_prep_read_fixed 3 "February 13, 2022" "liburing-2.1" "liburing Manual"
.SH NAME
io_uring_prep_read_fixed \- prepare I/O read request with registered buffer
.SH SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion man/io_uring_prep_timeout.3
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.\"
.\" SPDX-License-Identifier: LGPL-2.0-or-later
.\"
.TH io_uring_prep_poll_timeout 3 "March 12, 2022" "liburing-2.2" "liburing Manual"
.TH io_uring_prep_timeout 3 "March 12, 2022" "liburing-2.2" "liburing Manual"
.SH NAME
io_uring_prep_timeout \- prepare a timeout request
.SH SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion man/io_uring_prep_timeout_update.3
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.\"
.\" SPDX-License-Identifier: LGPL-2.0-or-later
.\"
.TH io_uring_prep_poll_timeout_update 3 "March 12, 2022" "liburing-2.2" "liburing Manual"
.TH io_uring_prep_timeout_update 3 "March 12, 2022" "liburing-2.2" "liburing Manual"
.SH NAME
io_uring_prep_timeout_update \- prepare a request to update an existing timeout
.SH SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion man/io_uring_prep_write_fixed.3
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.\"
.\" SPDX-License-Identifier: LGPL-2.0-or-later
.\"
.TH io_uring_prep_write 3 "February 13, 2022" "liburing-2.1" "liburing Manual"
.TH io_uring_prep_write_fixed 3 "February 13, 2022" "liburing-2.1" "liburing Manual"
.SH NAME
io_uring_prep_write_fixed \- prepare I/O write request with registered buffer
.SH SYNOPSIS
Expand Down
31 changes: 23 additions & 8 deletions man/io_uring_register.2
Original file line number Diff line number Diff line change
Expand Up @@ -113,27 +113,25 @@ but aims to have a more extensible ABI.

.I arg
points to a
.IR struct io_uring_rsrc_register ,
.I struct
.IR io_uring_rsrc_register ,
and
.I nr_args
should be set to the number of bytes in the structure.

.PP
.in +8n
.IP
.in +4n
.EX
struct io_uring_rsrc_register {
__u32 nr;
__u32 resv;
__u32 flags;
__u64 resv2;
__aligned_u64 data;
__aligned_u64 tags;
};
.EE
.in
.PP

.in +8n
.IP

The
.I data
Expand All @@ -154,6 +152,23 @@ posted with
.I user_data
set to the specified tag and all other fields zeroed.

The
.I flags
field supports the following flags:

.IP
.in +4n
.B IORING_RSRC_REGISTER_SPARSE
If set, io_uring will register
.I nr
empty buffers, which need to be updated before use. When this flag is set,
.I data
and
.I tags
must be NULL. Available since 5.19.
.in
.IP

Note that resource updates, e.g.
.BR IORING_REGISTER_BUFFERS_UPDATE ,
don't necessarily deallocate resources by the time it returns, but they might
Expand Down
10 changes: 5 additions & 5 deletions man/io_uring_register_buf_ring.3
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ The
.I flags
argument can be set to one of the following values:
.TP
.B IORING_REGISTER_PBUF_RING
.B IOU_PBUF_RING_INC
The buffers in this ring can be incrementally consumed. With partial
consumption, each completion of a given buffer ID will continue where the
previous one left off, or from the start if no completions have been seen yet.
Expand All @@ -81,7 +81,7 @@ have
.B IORING_CQE_F_BUF_MORE
set in the
.I flags
member.
member. Available since 6.12.
.PP

A shared buffer ring looks as follows:
Expand All @@ -90,13 +90,13 @@ A shared buffer ring looks as follows:
.EX
struct io_uring_buf_ring {
union {
struct {
struct {
__u64 resv1;
__u32 resv2;
__u16 resv3;
__u16 tail;
};
struct io_uring_buf bufs[0];
};
struct io_uring_buf bufs[0];
};
};
.EE
Expand Down
12 changes: 6 additions & 6 deletions man/io_uring_setup_buf_ring.3
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ io_uring_setup_buf_ring \- setup and register buffer ring for provided buffers
.B #include <liburing.h>
.PP
.BI "struct io_uring_buf_ring *io_uring_setup_buf_ring(struct io_uring *" ring ",
.BI " unsigned int " nentries ",
.BI " int " bgid ",
.BI " unsigned int " flags ",
.BI " int *" err ");"
.BI " unsigned int " nentries ",
.BI " int " bgid ",
.BI " unsigned int " flags ",
.BI " int *" err ");"
.BI "
.fi
.SH DESCRIPTION
Expand Down Expand Up @@ -49,7 +49,7 @@ The
.I flags
argument can be set to one of the following values:
.TP
.B IORING_REGISTER_PBUF_RING
.B IOU_PBUF_RING_INC
The buffers in this ring can be incrementally consumed. With partial
consumption, each completion of a given buffer ID will continue where the
previous one left off, or from the start if no completions have been seen yet.
Expand All @@ -58,7 +58,7 @@ have
.B IORING_CQE_F_BUF_MORE
set in the
.I flags
member.
member. Available since 6.12.
.PP

Under the covers, this function uses
Expand Down
2 changes: 1 addition & 1 deletion man/io_uring_sq_space_left.3
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.\"
.\" SPDX-License-Identifier: LGPL-2.0-or-later
.\"
.TH io_uring_sq_space-left 3 "January 25, 2022" "liburing-2.1" "liburing Manual"
.TH io_uring_sq_space_left 3 "January 25, 2022" "liburing-2.1" "liburing Manual"
.SH NAME
io_uring_sq_space_left \- free space in the SQ ring
.SH SYNOPSIS
Expand Down

0 comments on commit 231d5c2

Please sign in to comment.