3 ms·
Building an XDP (EXpress Data Path) Based BGP Peering Router
- wmf 7y agoI'm curious about any feature differences between this XDP code and the normal routing code path. Where are the cycles going? Given that they're both using the same drivers and the same FIB lookup, I wonder if there's a way to increase normal routing performance closer to XDP.
- atoonk 7y agoThe main reason for the difference is that there's just a lot less code being executed. The XDP code runs very early on, basically immediately after the nic receives the packet. The XDP hook is placed in the NIC driver just after the interrupt processing and before any memory allocation needed by the network stack itself. It is not being sent up the Kernel. So all this happens before an SKB (the most fundamental data structure in the Linux networking code) is allocated. Practically this means this is executed before things like tc and iptables. Less code, much faster.
- BenjiWiebe 7y agoCloudFlare tested various ways of dropping packets, such as iptables, nftables, and xdp.[1] They could drop 1.8 Mpps (million packets per second) with tc, which was the best, until they tested xdp. XDP handled 10.1 Mpps. [1]: https://blog.cloudflare.com/how-to-drop-10-million-packets/ https://blog.cloudflare.com/how-to-drop-10-million-packets/