Repository navigation
Use netip types throughout the network stack - #17623
Open
copybara-service[bot] wants to merge 1 commit into
Open
copybara-service[bot] wants to merge 1 commit into
copybara-service[bot] wants to merge 1 commit into
Conversation
Replace the stack's custom addresses, subnets and transport address/port
pairs with netip values. Sharing the standard representation removes
custom prefix operations and conversions between the stack and its
callers.
Keep deprecated type aliases and constructors while external callers
migrate uses of the removed fields and methods. Preserve IPv4/IPv6
identity, wildcard bindings and assigned-address host bits. Register
netip's binary encodings with the shared state codec so addresses also
survive checkpoints.
Preserve route-family and type validation when constructing netip
prefixes, including gateway truncation and family-sized destination
padding before applying the prefix length.
Address microbenchmarks [1] measured faster construction, 55–149% slower
byte copies and 25–42% slower map lookups.
Single-connection TCP throughput [2] used 30 samples per version on each
Linux AMD64 runner. Runner 0 measured higher upload throughput:
```text
│ /home/runner/work/_temp/qualification/iperf/before.bench │ /home/runner/work/_temp/qualification/iperf/after.bench │
│ bandwidth.bytes_per_second │ bandwidth.bytes_per_second vs base │
IperfOneConnection/operation.Upload-4 2.264G ± 1% 2.283G ± 1% +0.84% (p=0.000 n=30)
```
The upload gain did not repeat on runner 1. Neither runner showed a
significant change in download throughput.
[1]: https://app.buildbuddy.io/invocation/f8379578-d061-43c8-83f2-0e3c3b0e1b05
[2]: https://github.com/tamird/gvisor/actions/runs/38138807312
Auto-fixed-by: [🤖] @EtiennePerot
FUTURE_COPYBARA_INTEGRATE_REVIEW=#15730 from tamird:tcpip-netip-core 1baff64
PiperOrigin-RevId: 1020737196
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.
Use netip types throughout the network stack
Replace the stack's custom addresses, subnets and transport address/port
pairs with netip values. Sharing the standard representation removes
custom prefix operations and conversions between the stack and its
callers.
Keep deprecated type aliases and constructors while external callers
migrate uses of the removed fields and methods. Preserve IPv4/IPv6
identity, wildcard bindings and assigned-address host bits. Register
netip's binary encodings with the shared state codec so addresses also
survive checkpoints.
Preserve route-family and type validation when constructing netip
prefixes, including gateway truncation and family-sized destination
padding before applying the prefix length.
Address microbenchmarks 1 measured faster construction, 55–149% slower
byte copies and 25–42% slower map lookups.
Single-connection TCP throughput 2 used 30 samples per version on each
Linux AMD64 runner. Runner 0 measured higher upload throughput:
The upload gain did not repeat on runner 1. Neither runner showed a
significant change in download throughput.
Auto-fixed-by: [🤖] @EtiennePerot
FUTURE_COPYBARA_INTEGRATE_REVIEW=#15730 from tamird:tcpip-netip-core 1baff64