aboutsummaryrefslogtreecommitdiff
path: root/lib/std/os/linux/IoUring.zig
AgeCommit message (Collapse)Author
2025-10-30Merge pull request #25763 from mrjbq7/cancelledJohn Benediktsson
rename Cancelled to Canceled
2025-10-29std.os.linux.IoUring: disable failing testAndrew Kelley
tracked by https://github.com/ziglang/zig/issues/25734
2025-10-29std.os.linux.IoUring: use linux msghdrAndrew Kelley
it disagrees with posix msghdr
2025-10-29std: fix some Io compilation errorsAndrew Kelley
2025-10-29std: updating to std.Io interfaceAndrew Kelley
got the build runner compiling
2025-08-16implement registering NAPI on IoUring (#24850)Özgür Akkurt
2025-05-06Add register_file_alloc_rangeSeiichi Uchida
2025-03-05io_uring: refactor buf_reg flagsIgor Anić
Use packed struct instead of or-ed integers. Thanks to @linsug for pr comments: https://github.com/ziglang/zig/pull/23062
2025-03-05io_uring: incremental provided buffer consumptionIgor Anić
[Incremental provided buffer consumption](https://github.com/axboe/liburing/wiki/What's-new-with-io_uring-in-6.11-and-6.12#incremental-provided-buffer-consumption) support is added in kernel 6.12. IoUring.BufferGroup will now use incremental consumption whenever kernel supports it. Before, provided buffers are wholly consumed when picked. Each cqe points to the different buffer. With this, cqe points to the part of the buffer. Multiple cqe's can reuse same buffer. Appropriate sizing of buffers becomes less important. There are slight changes in BufferGroup interface (it now needs to track current receive point for each buffer). Init requires allocator instead of buffers slice, it will allocate buffers slice and head pointers slice. Get and put now requires cqe becasue there we have information will the buffer be reused.
2025-03-05io_uring: add setsockopt/getsockoptIgor Anić
ring.cmd_sock is generic socket operation. Two most common uses are setsockopt and getsockopt. This provides same interface as posix versions of this methods. libring has also [sqe_set_flags](https://man7.org/linux/man-pages/man3/io_uring_sqe_set_flags.3.html) method. Adding that in our io_uring_sqe. Adding sqe.link_next method for setting most common flag.
2025-03-05io_uring: probe capabilities functionIgor Anić
ring.get_probe returns io_uring_probe which can be use to probe capabilities of the current running kernel. Ref: https://unixism.net/loti/ref-liburing/supported_caps.html https://github.com/axboe/liburing/blob/e1003e496e66f9b0ae06674869795edf772d5500/src/setup.c#L454
2025-03-05io_uring: fix tests on 5.4.0 kernelIgor Anić
Found it failing in a new way on that kernel.
2025-03-05io_uring: add bind and listenIgor Anić
2025-02-11linux/IoUring: add register_files_sparsenikneym
2025-02-06adjust runtime page size APIsAndrew Kelley
* fix merge conflicts * rename the declarations * reword documentation * extract FixedBufferAllocator to separate file * take advantage of locals * remove the assertion about max alignment in Allocator API, leaving it Allocator implementation defined * fix non-inline function call in start logic The GeneralPurposeAllocator implementation is totally broken because it uses global state but I didn't address that in this commit.
2025-02-06runtime page size detectionArchbirdplus
heap.zig: define new default page sizes heap.zig: add min/max_page_size and their options lib/std/c: add miscellaneous declarations heap.zig: add pageSize() and its options switch to new page sizes, especially in GPA/stdlib mem.zig: remove page_size
2024-10-11IoUring: fix an issue in tests where InvalidVersion might get thrown by ↵Jean-Baptiste "Jiboo" Lepesme
skipKernelLessThan, due to some kernel versions not being SemVer compliant.
2024-07-23add std.testing.random_seedAndrew Kelley
closes #17609
2024-07-19std.c reorganizationAndrew Kelley
It is now composed of these main sections: * Declarations that are shared among all operating systems. * Declarations that have the same name, but different type signatures depending on the operating system. Often multiple operating systems share the same type signatures however. * Declarations that are specific to a single operating system. - These are imported one per line so you can see where they come from, protected by a comptime block to prevent accessing the wrong one. Closes #19352 by changing the convention to making types `void` and functions `{}`, so that it becomes possible to update `@hasDecl` sites to use `@TypeOf(f) != void` or `T != void`. Happily, this ended up removing some duplicate logic and update some bitrotted feature detection checks. A handful of types have been modified to gain namespacing and type safety. This is a breaking change. Oh, and the last usage of `usingnamespace` site is eliminated.
2024-07-09std: fix typos (#20560)Jora Troosh
2024-06-20io_uring: don't assume completions order (2)Igor Anić
In my first [try](https://github.com/ziglang/zig/pull/20224) to fix 20212 I didn't reproduce bug on required kernel (6.9.2) and wrongly concluded that first two completions have different order on newer kernel. On my current kernel (6.5.0) order of completions is: send1, recv, send2. On 6.9.2 order is send1, send2, recv. This fix allows second two completions to arrive in any order. Tested on both kernels. Fixes: #20212
2024-06-13std: Convert deprecated aliases to compile errors and fix usagesRyan Liptak
Deprecated aliases that are now compile errors: - `std.fs.MAX_PATH_BYTES` (renamed to `std.fs.max_path_bytes`) - `std.mem.tokenize` (split into `tokenizeAny`, `tokenizeSequence`, `tokenizeScalar`) - `std.mem.split` (split into `splitSequence`, `splitAny`, `splitScalar`) - `std.mem.splitBackwards` (split into `splitBackwardsSequence`, `splitBackwardsAny`, `splitBackwardsScalar`) - `std.unicode` + `utf16leToUtf8Alloc`, `utf16leToUtf8AllocZ`, `utf16leToUtf8`, `fmtUtf16le` (all renamed to have capitalized `Le`) + `utf8ToUtf16LeWithNull` (renamed to `utf8ToUtf16LeAllocZ`) - `std.zig.CrossTarget` (moved to `std.Target.Query`) Deprecated `lib/std/std.zig` decls were deleted instead of made a `@compileError` because the `refAllDecls` in the test block would trigger the `@compileError`. The deleted top-level `std` namespaces are: - `std.rand` (renamed to `std.Random`) - `std.TailQueue` (renamed to `std.DoublyLinkedList`) - `std.ChildProcess` (renamed/moved to `std.process.Child`) This is not exhaustive. Deprecated aliases that I didn't touch: + `std.io.*` + `std.Build.*` + `std.builtin.Mode` + `std.zig.c_translation.CIntLiteralRadix` + anything in `src/`
2024-06-08io_uring: don't assume completions orderIgor Anić
We are posting two submission (zero copy send and receive) and then reading two completions. There is no guarantee that those completions will be in the order of submissions. This test was expecting fist send completion then receive. Fix is allowing them to come other way too.
2024-06-06disable failing IoUring testAndrew Kelley
tracked by #20212
2024-05-09fix integer overflow in IoUring buffer ring size calculationKarl Bohlmark
2024-04-28std.posix.iovec: use .base and .len instead of .iov_base and .iov_lenNameless
2024-03-31io_uring: simplify copy_cqe logicIgor Anić
First copy as much as we can in this cycle. If there is more needed wrap and start from the buffer 0 position.
2024-03-31io_uring: fix copy_cqes logicIgor Anić
2024-03-31io_uring: add failing testIgor Anić
For issue: #19451
2024-03-19extract std.posix from std.osAndrew Kelley
closes #5019
2024-03-15io_uring: ring mapped buffers (#17806)Igor Anić
* 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-11std.builtin: make atomic order fields lowercaseTristan Ross
2024-03-08std.os.linux: rework io_uring supportmlugg
* `linux.IO_Uring` -> `linux.IoUring` to align with naming conventions. * All functions `io_uring_prep_foo` are now methods `prep_foo` on `io_uring_sqe`, which is in a file of its own. * `SubmissionQueue` and `CompletionQueue` are namespaced under `IoUring`. This is a breaking change. The new file and namespace layouts are more idiomatic, and allow us to eliminate one more usage of `usingnamespace` from the standard library. 2 remain.