Skip to content

Commit d1de61d

Browse files
committed
io_uring/zcrx: document area chunking parameter
struct io_uring_zcrx_ifq_reg::rx_buf_len is used as a hint specifying the kernel what buffer size it should use. Document the API and limitations. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
1 parent a32bb32 commit d1de61d

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Documentation/networking/iou-zcrx.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,26 @@ Return buffers back to the kernel to be used again::
196196
rqe->len = cqe->res;
197197
IO_URING_WRITE_ONCE(*refill_ring.ktail, ++refill_ring.rq_tail);
198198

199+
Area chunking
200+
-------------
201+
202+
zcrx splits the memory area into fixed-length physically contiguous chunks.
203+
This limits the maximum buffer size returned in a single io_uring CQE. Users
204+
can provide a hint to the kernel to use larger chunks by setting the
205+
``rx_buf_len`` field of ``struct io_uring_zcrx_ifq_reg`` to the desired length
206+
during registration. If this field is set to zero, the kernel defaults to
207+
the system page size.
208+
209+
To use larger sizes, the memory area must be backed by physically contiguous
210+
ranges whose sizes are multiples of ``rx_buf_len``. It also requires kernel
211+
and hardware support. If registration fails, users are generally expected to
212+
fall back to defaults by setting ``rx_buf_len`` to zero.
213+
214+
Larger chunks don't give any additional guarantees about buffer sizes returned
215+
in CQEs, and they can vary depending on many factors like traffic pattern,
216+
hardware offload, etc. It doesn't require any application changes beyond zcrx
217+
registration.
218+
199219
Testing
200220
=======
201221

0 commit comments

Comments
 (0)