Visitar URL original
Use netip types throughout the network stack by copybara-service[bot] · Pull Request #17623 · google/gvisor · GitHub
Skip to content

Use netip types throughout the network stack - #17623

Open
copybara-service[bot] wants to merge 1 commit into
masterfrom
test/cl1020737196
Open

copybara-service[bot] wants to merge 1 commit into
masterfrom
test/cl1020737196

Conversation

@copybara-service

Copy link
Copy Markdown

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:

                                        │ /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.

Auto-fixed-by: [🤖] @EtiennePerot
FUTURE_COPYBARA_INTEGRATE_REVIEW=#15730 from tamird:tcpip-netip-core 1baff64

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
@copybara-service copybara-service Bot added the exported Issue was exported automatically label Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

exported Issue was exported automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant