Skip to contentSkip to conversation

AF_XDP Rx and overload

DISCUSSION Dan Siemon 2 participants 2 messages Apr 30, 2021 – May 3, 2021

lore
Share & tools
lore

Dan Siemon

author
#0 lore raw

When an AF_XDP based application is overloaded, it is preferable for the application to:
* Service the Rx ring as fast as it can and drop in the application if required?
* Let the Rx ring fill up and let the NIC drop?

This is mostly a performance/PPS question. Obviously the application loses the ability to directly count the drops if the NIC drops among other limitations.

If it makes a difference, the use case is only i40e right now.

#1 lore raw
Quoted 6 lines · Dan Siemon

When an AF_XDP based application is overloaded, it is preferable for the application to:
* Service the Rx ring as fast as it can and drop in the application if required?
* Let the Rx ring fill up and let the NIC drop?

Let the NIC drop, since this is much faster. And always process Tx first, if you have such a component. This alleviates buffering problems and makes sure you get as much as possible out of the system to the devices that want your packets. You generally want to get as many packets through your whole processing pipeline, not trying to receive as many packets as possible (and not getting them the whole way through).

Quoted 4 lines

This is mostly a performance/PPS question. Obviously the application loses the ability to directly count the drops if the NIC drops among other limitations.

You will not be able to keep up counting anyway :-). It is not possible to count all drops in user-space (or the kernel). You would need HW support for this. Just think of blasting 162 Mpps at one port and trying to count the drops in the CPU. Would need a lot of cores for just that.

Quoted 2 lines

If it makes a difference, the use case is only i40e right now.