
Building an XDP (EXpress Data Path) Based BGP Peering Router - atoonk
https://medium.com/@atoonk/building-a-xdp-express-data-path-based-peering-router-20db4995da66
======
wmf
I'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
The 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.

