zig/lib
Igor Anić 3ea1276eeb
io_uring: ring mapped buffers (#17806)
* io_uring: ring mapped buffers

Ring mapped buffers are newer implementation of ring provided buffers, supported
since kernel 5.19. Best described in Jens Axboe [post](https://github.com/axboe/liburing/wiki/io_uring-and-networking-in-2023#provided-buffers)

This commit implements low level io_uring_*_buf_ring_* functions as mostly
direct translation from liburing. It also adds BufferGroup abstraction over those
low level functions.

* io_uring: add multishot recv to BufferGroup

Once we have ring mapped provided buffers functionality it is possible to use
multishot recv operation. Multishot receive is submitted once, and completions
are posted whenever data arrives on the socket. Received data are placed in a
new buffer from buffer group.

Reference: [io_uring and networking in 2023](https://github.com/axboe/liburing/wiki/io_uring-and-networking-in-2023#multi-shot)

Getting NOENT for cancel completion result, meaning:
  -ENOENT
    The request identified by user_data could not be located.
    This could be because it completed before the cancelation
    request was issued, or if an invalid identifier is used.

https://man7.org/linux/man-pages/man3/io_uring_prep_cancel.3.html
https://github.com/ziglang/zig/actions/runs/6801394000/job/18492139893?pr=17806

Result in cancel/recv cqes are different depending on the kernel.
on older kernel (tested with v6.0.16, v6.1.57, v6.2.12, v6.4.16)
  cqe_cancel.err() == .NOENT
  cqe_crecv.err() == .NOBUFS
on kernel (tested with v6.5.0, v6.5.7)
  cqe_cancel.err() == .SUCCESS
  cqe_crecv.err() == .CANCELED
2024-03-15 22:34:31 -04:00
..
compiler Merge pull request #19174 from squeek502/lazy-resinator 2024-03-11 17:18:09 -07:00
compiler_rt bsd: debitrot AtomicOrder renames 2024-03-15 02:28:50 -04:00
docs autodoc: Use code for keyboard events 2024-03-13 18:37:00 -07:00
include update C language headers to LLVM 17 2023-09-19 09:37:31 -07:00
init Grammar fixes (#18320) 2023-12-20 13:17:15 +02:00
libc mingw-w64: remove msvcrt sources 2024-01-20 00:21:34 +00:00
libcxx update libcxx to latest LLVM release/17.x 2023-09-19 09:37:53 -07:00
libcxxabi libcxxabi: update to LLVM 17 2023-09-19 09:37:31 -07:00
libunwind libunwind: update to LLVM 17 2023-09-19 09:37:31 -07:00
std io_uring: ring mapped buffers (#17806) 2024-03-15 22:34:31 -04:00
tsan tsan: update rtl files to LLVM 17.0.6 2024-01-10 01:00:37 -07:00
build_runner.zig build runner: add --summary new 2024-03-15 09:13:01 -07:00
c.zig std.builtin: make link mode fields lowercase 2024-03-11 07:09:10 -07:00
compiler_rt.zig move libssp into libcompiler_rt 2023-11-10 13:12:10 -07:00
zig.h cbe: fix non-msvc externs and exports 2024-01-03 02:52:25 -05:00