6 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 KrakauerandgVisor bot f76d64021e xdp: update the incorrectly named "Readonly*" names
PiperOrigin-RevId: 592664806
2023-12-20 14:57:27 -08:00
Kevin KrakauerandgVisor bot cd4a40b584 xdp: use builtin constants and functions in xdp_loader eBPF
With cl/590826409's submission, we can use these.

PiperOrigin-RevId: 591148462
2023-12-14 22:25:20 -08:00
Kevin KrakauerandgVisor bot 6beb925dfd xdp: add flag for runsc to use an XDP socket on a host device
In combination with `xdp_loader redirect`, this allows `runsc` to receive
packets directly from any NIC. It is intended to be used with a machine's NIC
to avoid the Linux networking stack entirely.

PiperOrigin-RevId: 591090544
2023-12-14 17:02:25 -08:00
Kevin KrakauerandgVisor bot 3b77e29e3b xdp: split xdp_loader subcommands into cmd directory
This allows other code to use them as deps, which is impossible as a go_binary.

PiperOrigin-RevId: 591054831
2023-12-14 14:38:57 -08:00