Re: Measuring/Debugging XDP Performance

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hey everyone,


The only NIC our hosting provider could replace our old NIC with is using the `e1000e` driver (it's a one gigabit NIC card). I dug through some older mailing list threads and read XDP isn't very effective with one gigabit NICs (the preferred minimum is 10 gbps IIRC). These were threads from 2017 and I'm not sure if this is still the case. However, if it is, I'm still hoping I can use XDP, but hopefully have the performance equal to the network stack at the very least.


I understand the `e1000e` driver doesn't have XDP support upstream. Therefore, I tried implementing the driver patch that adds XDP support here:


https://github.com/adjavon/e1000e_xdp


Unfortunately, this patch was based off of kernel 4.10.2 (I'm using 4.19). Therefore, I had to manually implement the patch code (this is my first time messing with NIC driver code). Sadly, it doesn't seem like the patch worked based off of the 'perf' results which are linked below. I still see "do_xdp_generic" calls:


```

xxx@xxx/xxxx/xxxx# cat results_2.log | grep "xdp"
                          do_xdp_generic
     0.33%  006  swapper          [kernel.kallsyms]         [k] do_xdp_generic                         -      -      0.09%  006  swapper          [kernel.kallsyms]         [k] bpf_xdp_adjust_head                    -      -      0.09%  005  swapper          [kernel.kallsyms]         [k] do_xdp_generic                         -      -      0.07%  006  swapper          [kernel.kallsyms]         [k] generic_xdp_tx                         -      -      0.07%  004  swapper          [kernel.kallsyms]         [k] do_xdp_generic                         -      -      0.05%  003  swapper          [kernel.kallsyms]         [k] do_xdp_generic                         -      -      0.02%  004  swapper          [kernel.kallsyms]         [k] generic_xdp_tx                         -      -      0.01%  005  swapper          [kernel.kallsyms]         [k] generic_xdp_tx                         -      -
```


With that said, it appears my other POP servers that are using the "virtio_net" NIC driver are using XDP generic according to the 'perf' results as well (they're similar to the above). They're also on kernel 4.18.


My question is, how would you know if you're using XDP-native or not? Is it possible you're still using XDP-native, even when there are XDP generic calls from the 'perf' command?


Here's a link to the outputs of the 'perf' command discussed above for anyone interested:


https://g.gflclan.com/6sHmHPlo3W.zip


Any help is highly appreciated and thank you for your time!


On 1/23/2020 3:38 PM, Christian Deacon wrote:
Hey Jesper,


Thank you for the information and that makes a lot more sense! I didn't realize we had a NIC that doesn't support XDP-native. I will see if I can get a better NIC card for this dedicated server (I don't believe our current NIC card supports any other drivers besides `igb`).


In the meantime, I have stopped announcing my dedicated server to our Anycast network and have started announcing the four-core VPS that had similar issues before ordering the dedicated server (even though I feel this VPS should be able to handle the traffic load). The CPU is virtualized and running at 2.5 GHz per core. The VPS's OS is Ubuntu 18.10 and the kernel is '4.18.0-20'. The NIC driver is "virtio-pci", which I believe is supported (please correct me if I'm wrong, I do see 'virtio_net' in the list of supported XDP drivers which I'd assume is the same thing).


I will execute the 'perf' commands tonight when we have higher traffic load and reply with the output.


Thank you for your help!


On 1/23/2020 2:38 PM, Jesper Dangaard Brouer wrote:
On Thu, 23 Jan 2020 11:22:31 -0600
Christian Deacon <gamemann@xxxxxxxxxxx> wrote:

Thank you for the information and I will try these commands tonight when
there is higher traffic load! The 'perf' command seems interesting.
Thanks for the perf output in the private email thread. From the output
I can clearly see the problem (some copy pasted below signature).  You
are using the driver igb which does not support XDP-native, and is thus
using generic-XDP.

This driver only have 192 bytes headroom, where 256 is needed. Thus,
running XDP-generic will be slower than running the normal network
stack, as every packet will get reallocated and copied.




[Index of Archives]     [Linux Networking Development]     [Fedora Linux Users]     [Linux SCTP]     [DCCP]     [Gimp]     [Yosemite Campsites]

  Powered by Linux