github / glb-director

GitHub Load Balancer Director and supporting tooling.
Other
2.37k stars 227 forks source link

XDP version of glb-director #96

Closed theojulienne closed 4 years ago

theojulienne commented 4 years ago

Building on https://github.com/github/glb-director/pull/95 which pulled out the hashing and packet parsing to reusable code, this PR adds an initial XDP implementation of the glb-director, along with packaging that is essentially identical to the DPDK director except that the technology changes.

It's worth noting quite a few of the files in here are actually not new code, but are just vendored into this project for convenience since they have the same licenses. The copyright headers retain and indicate the original authors, mostly this is either specific bpf headers from the kernel that are not packaged by Debian, integration with xdpcap, or using the similar root array shim from FB's katran.

After this PR, the test setup has both a DPDK and an XDP director that work side by side. Additionally, the same Scapy test suite runs against both the DPDK and XDP variety of directors.

Generally the answer to most other questions of "why is it done this weird way?" are going to be "because clang and the kernel eBPF verifier have a antagonistic relationship".

This branch is currently targeting https://github.com/github/glb-director/pull/95 to reduce the diff, but will target master once that branch merges. There will need to be yet another pass, building on top of this PR, to fully update documentation and provide examples.