fix: split io_uring UDP availability gate#133
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR separates Linux io_uring availability gating for the UDP recvmsg/sendmsg ring from the (still-disabled) TUN reader gate, so UDP can activate independently while TUN io_uring reads remain disabled pending bare-metal validation.
Changes:
- Introduces independent UDP/TUN
io_uringavailability gates and a small helper (selectUdpPath) to classify the chosen UDP path. - Updates startup logging to clearly report the chosen TUN reader path and UDP path (including init failure error names).
- Adds tests for gate-selection logic and a Linux loopback receive probe for the UDP ring; updates docs to reflect runtime-gated UDP ring support and fallback behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/net/io_uring.zig | Adds split availability gates, UdpPath selection helper, and new tests including a UDP ring loopback probe. |
| src/main.zig | Uses the split gates, attempts UDP ring init only when runtime-available, and improves startup logging with clearer fallback reasons. |
| README.md | Documents runtime-gated UDP io_uring ring support and the still-disabled TUN reader. |
| docs/reference/modules.md | Updates module description to reflect UDP ring + TUN reader gate responsibilities. |
| docs/concepts/architecture.md | Updates architecture docs to reflect the split io_uring responsibilities. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+455
to
+457
| var ring: UdpRing = undefined; | ||
| try ring.init(rx.fd); | ||
| defer ring.deinit(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validation
zig fmt src/net/io_uring.zig src/main.zigzig build test --summary allon Windows: 120/120 tests passedzig build --summary allon Windowszig build -Dtarget=x86_64-linux-gnu -Dno-sodium=true --summary allzig build -Dtarget=aarch64-macos -Dno-sodium=true --summary allzig build -Dtarget=x86_64-freebsd -Dno-sodium=true --summary allzig build test -Dno-sodium=true --cache-dir /tmp/meshguard-zig-cache --global-cache-dir /tmp/meshguard-zig-global --summary all, 246/246 tests passedzig build test -Dno-sodium=truewith/tmpcaches, 246/246 tests passedwslc run -d,wslc exec,wslc stop, andwslc removeall worked againstalpine:latestNote: the Linux/WSLC test runs print pre-existing
unexpected errno: 9stack traces from SWIM tests that intentionally catch fake-socket send failures; the final build summaries reported success.Closes #128