On 2019-08-24 09:36, Pavel Popa wrote:
I'd like to join the questions too, specifically more oriented towards AF_XDP devs. I understand why the choice of SPSC ring queue design, however what would be the cost of a MPSC design (Multiple Producer Single Consumer)? In order to have a single UMEM available to the entire net device (i.e. bound to all net device's hardware queues), imho this would have a huge impact because now, among other things, one wouldn't have to bother with ethtool. And do we really want to question the convenience of "UMEM per hardware queue" vs "UMEM per net device"? Btw, congrats for the great work guys.
Late on the ball... A MPSC will definitely have a negative performance impact (let me see if I can find some number from back when we started), but also open up other issues like shared/multiple address spaces. We opted in for a simple, performant model where filtering should be done in HW (zero-copy mode). What you're describing (SW based switching) might be a better fit for a XDP + (say) tap with AF_XDP. Most, if not all, users looking into AF_XDP do it for the zero-copy performance, and going to the model you're describing will impact performance too much. Cheers, Björn