5 Commits
Author SHA1 Message Date
Kevin KrakauerandgVisor bot 9db874189a xdp: user real BPF helper functions, not a hacky forward definition
PiperOrigin-RevId: 600574627
2024-01-22 14:41:45 -08:00
Kevin KrakauerandgVisor bot 9e2db2c131 xdp: add a tunnel mode to avoid sharing UMEM among sandboxes
The existing redirect mode uses XDP to maximize performance but is not suitably
secure: packets are copied directly from the driver into a userspace buffer
(UMEM). But because the UMEM is shared among all processes with a socket open
on a particular NIC queue, sandboxes using redirect mode all map the same UMEM
and thus can read each other's packets.

Tunnel mode instead installs an eBPF program that copies packets from the
host's NIC driver into a per-sandbox NIC driver. This incurs an additional
copy, but there is no longer memory shared between sandboxes.

Benchmarking tunnel mode with redis-benchmark shows a performance gain over
standard Docker networking of 20%. Redirect mode showed a 30% improvement.

PiperOrigin-RevId: 595746162
2024-01-04 10:45:43 -08:00
Kevin Krakauer 3a9134c2f0 netstack: benchmark xdp endpoint
This just swaps out the fdbased endpoint for an XDP one. Some related
changes in here:

- Moved the AF_XDP BPF program into its own Go package so it can be
  shared.
- Added a flag to tcp_benchmark to disable user namespaces. This helps
  when running as root, which is required to install BPF programs.
2023-08-31 11:09:15 -07:00
Adin ScannellandgVisor bot 1ceb814544 Add default_applicable_licenses rules to packages.
PiperOrigin-RevId: 513581243
2023-03-02 10:50:04 -08:00
Kevin KrakauerandgVisor bot 6840864b0e experimental xdp dispatcher
PiperOrigin-RevId: 472509327
2022-09-06 11:16:40 -07:00