Repository navigation
Fix TUN recovery and batch accounting; reuse FEC buffers - #70
Merged
Merged
Conversation
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.
TUN write results were counted as packets although NativeTun returns bytes, partial carrier batches could be resent or miscounted, and permanent interface errors left a healthy-looking generation alive. FEC also rebuilt scratch buffers on the packet hot path.
Correct TUN/partial-batch accounting, retry only unsent tails, reject short scalar writes and return from pumps on permanent interface errors so the supervisor rebuilds the generation. Reuse bounded FEC transmit/parity/read scratch buffers, clear padding and release delivered references.
AutoMTU can raise packets above the configured initial MTU. Retain the grown GRE scratch buffer after wrapping instead of allocating it again for every larger packet. The raised-MTU benchmark avoids roughly 2 KiB and one allocation per packet; normal-size packets are unchanged. Every regression packet is decrypted and unwrapped to verify content. Earlier warmed FEC benchmarks reduced transmit allocations from three to zero and receive allocation bytes by about 88%. These use actual protocol code with fixture I/O, not WAN throughput measurements.
Validation: Complete original Linux CI passed full tests/races, coverage gates, analysis, fuzz, soak and builds. Latest exact-source payload/race checks and benchmarks passed at
152499a59ffc7c556ab67bd06c2b8a0296346021; old-source measurements reproduce repeated buffer growth. The latest full integrated suite and race/coverage gates also passed in the performance workflow; its baseline diagnostic-match issue was corrected in the linked baseline workflow.Only existing production files change. No files or tests are added; supplemental fixtures/workflows stay on fork validation branches. No wire-format change.