fix: remaining netns-tunnel-test flakes (io_uring RX drop + flowshape spread gate) #161
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
femboy/yip!161
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/uring-recv-depth"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Supersedes #160 (which was the diagnostic step; this PR includes that instrumentation plus the actual fix).
Root cause
The
netns-tunnel-testjob'sarq_recovers_bulk_lossfailed under the io_uring driver: 80–96% delivery vs the poll driver's 99.3% in the same run, with no driver fallback (the log had nofalling back to PollDriverline, so it wasn't the teardown path).The io_uring backend kept only
UDP_RECV_DEPTH=16single-shot recvs outstanding, so onepoll_onceharvests at most 16 datagrams (~3 ms of a 5000 pps flow) before re-arming. The poll backend'sdrain_udpdrains the whole socket backlog per wakeup (recvmmsg(64)until a short read). Under the CI container's CPU contention the socket receive queue outpaced the 16-deep uring drain and overflowed a clampednet.core.rmem_max→ kernel-level UDP drops the poll driver never saw.Fix
UDP_RECV_DEPTH16 → 256 (matchesRING_BUFS; ~590 KB of slots) — onepoll_oncenow drains up to ~256 datagrams, closing the gap to poll.RING_ENTRIES512 → 1024 (CQ → 2048) — headroom for the deeper recv queue + in-flight sends + TUN reads.Evidence / how it was found
/proc/net/snmpUdpRcvbufErrorsdeltas +udp_rx.pystop=/idle_gap=. The refuting datapoint: a uring run printedstop=idle idle_gap=30.0at 80.1% — the receiver waited the full 30 s and packets never came, so it was not receiver patience.Verification
Local: 60
yip-iotests pass (all io_uring driver tests), arq passes on both drivers,RcvbufErrors=0. Not reproducible on bare metal (both drivers ≥99.2% even under load) — the CI container is the constrained regime, so this PR's CI is the real validation (uring arq should recover to ~99%, RcvbufErrors ~0).Follow-ups (found in the same review, NOT in this PR)
uring.rs:1093/1146), or onECONNREFUSED/ENOMEM.submit+submit_and_wait(1)(twoio_uring_enter) per idle iteration.RecvMsgMulti(multishot recvmsg, recovers src addr per completion) as the structural fix that removes the fixed depth entirely.eprintln!cost.fix(io): deepen io_uring UDP recv queue (fixes arq-uring CI drop)to fix: remaining netns-tunnel-test flakes (io_uring RX drop + flowshape spread gate)