18 Commits
Author SHA1 Message Date
Jing Chen a093ad0450 Simplify and format gVisor codebase.
The changes are just output of `gofmt -s -w .`.
2024-10-13 00:50:32 -07:00
Nayana BidariandgVisor bot 90266aa28a Netstack S/R: Mark all the structs in netstack as savable.
Marks the structs in netstack as savable. This does not change or break any
existing behavior as the netstack itself is not savable yet.

PiperOrigin-RevId: 635943481
2024-05-21 15:19:07 -07:00
Kevin KrakauerandgVisor bot 5b4fbd06d8 netstack: remove PacketBufferPtr
PacketBufferPtr is leftover from a dead experiment. Just use *PacketBuffer.

PiperOrigin-RevId: 611531815
2024-02-29 11:10:38 -08:00
Kevin KrakauerandgVisor bot 89d6bf18c8 have gVisor use renamed buffer package
PiperOrigin-RevId: 537209194
2023-06-01 21:27:49 -07:00
Adin ScannellandgVisor bot 1ceb814544 Add default_applicable_licenses rules to packages.
PiperOrigin-RevId: 513581243
2023-03-02 10:50:04 -08:00
Ayush RanjanandgVisor bot 175db901ca Replace pkg/refs with pkg/refsvfs2.
All VFS1 only bits have been deleted.

Updates #1624

PiperOrigin-RevId: 492273183
2022-12-01 12:46:11 -08:00
Kevin KrakauerandgVisor bot 4eca206fa4 netstack: introduce PacketBufferPtr
PiperOrigin-RevId: 479437464
2022-10-06 16:16:54 -07:00
Lucas ManningandgVisor bot 1f2b30d70c Refactor netstack to use bufferv2 instead of buffer.
This change has significant performance implications. bufferv2 is reference
counted and pooled, which alleviates heap/GC pressure. Below are the results
from running the iperf benchmark.

HEAD:
BenchmarkIperf/operation.Upload-16    1552  ns/op   46.6GiB total allocations
BenchmarkIperf/operation.Download-16  1114  ns/op   68.6GiB total allocations

w/ change:
BenchmarkIperf/operation.Upload-16    1139  ns/op (-27%)   1.41GiB total allocations (-97%)
BenchmarkIperf/operation.Download-16  753.2 ns/op (-33%)   706MiB  total allocations (-99%)

PiperOrigin-RevId: 462453185
2022-07-21 13:09:31 -07:00
Nate HurleyandgVisor bot 7d3a75fa60 Enable multicast forwarding per protocol.
After this change, multicast packets will only be forwarded if
multicast forwarding is enabled on the relevant NIC AND it is
enabled for the relevant protocol (IPv4 or IPv6).

Multicast forwarding at the protocol level will be tied to the lifetime
of the IPv4/IPv6RoutingTableControllers. In particular, this change
enables us to satisfy the following requirements:

https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.net.multicast.admin/ipv4.fidl;l=20-21;drc=acd6519f50c92e30f18cc1816bd1c400759b533c

Updates #7338.

PiperOrigin-RevId: 455155793
2022-06-15 10:00:49 -07:00
Lucas ManningandgVisor bot 6103b4b3b6 Replace VectorisedView in network endpoints.
PiperOrigin-RevId: 451267391
2022-05-26 16:25:30 -07:00
Nate HurleyandgVisor bot 28eda96b00 Cleanup the multicast routing table.
This change does the following:

- Uses shared types for the route key and multicast route.
- Returns a bool instead of error from GetRouteOrInsertPending since only one
error type is possible.
- Improves the naming of PendingRouteState using the suggestions in
cl/445157188.

Updates #7338.

PiperOrigin-RevId: 449812803
2022-05-19 12:54:32 -07:00
Nick BrownandgVisor bot 1ccbffc235 Fix typo in comment
PiperOrigin-RevId: 449535537
2022-05-18 11:42:46 -07:00
Nate HurleyandgVisor bot add538a44f Run multicast cleanup routine only when needed.
Aside from saving resources, this is also a workaround for the case where
timers are bound after the netstack is initialized.

Updates #7338.

PiperOrigin-RevId: 448509194
2022-05-13 09:14:24 -07:00
Nate HurleyandgVisor bot e916e4fde3 Remove the MonotonicTime.Nanoseconds() accessor.
Updates #7338.

PiperOrigin-RevId: 448360987
2022-05-12 16:15:15 -07:00
Nate HurleyandgVisor bot 09b7a17066 Cleanup multicast routing table.
The purpose of this change is twofold:

1. Simplify AddInstalledRoute by returning a PacketBuffer slice instead of a
PendingRoute. This obviates PendingRoute.Dequeue and PendingRoute.IsEmpty.
2. Address PacketBuffer lifetime issues. With this change, the routing table
will call PacketBuffer.Clone() if it decides to enqueue the packet. When
AddInstalledRoute is called, the caller will then assume ownership of the
relevant packets and is expected to call PacketBuffer.DecRef() after
forwarding.

Updates #7338.

PiperOrigin-RevId: 446740297
2022-05-05 09:46:49 -07:00
Nate HurleyandgVisor bot ef4a490693 Expire pending multicast packets/routes.
Updates #7338.

PiperOrigin-RevId: 445231315
2022-04-28 13:21:12 -07:00
Nate HurleyandgVisor bot 9f41bb6d62 Implement remaining multicast routing table operations.
In particular, this change adds support for AddInstalledRoute,
RemoveInstalledRoute, and GetLastUsedTimestamp.

Updates #7338.

PiperOrigin-RevId: 445205505
2022-04-28 11:34:51 -07:00
Nate HurleyandgVisor bot 02e1f2bb45 Implement the initial multicast routing table.
The purpose of this change is to:

- Introduce the needed abstractions for the table.
- Implement support for queuing pending packets.

Subsequent changes will:

- Implement the other needed table operations (i.e. AddInstalledRoute,
 RemoveInstalledRoute, and GetLastUsedTimestamp).
- Implement the logic for expiring pending packets.

Updates #7338.

PiperOrigin-RevId: 442828835
2022-04-19 09:17:48 -07:00