Re: [PATCH net-next v8 3/3] net: ethernet: ti: am65-cpsw: Add minimal XDP support

From: Julien Panis
Date: Fri Apr 12 2024 - 09:56:57 EST


On 4/10/24 17:02, Jakub Kicinski wrote:
On Wed, 10 Apr 2024 16:02:00 +0200 Julien Panis wrote:
You shouldn't build the skb upfront any more. Give the page to the HW,
once HW sends you a completion - build the skbs. If build fails
(allocation failure) just give the page back to HW. If it succeeds,
however, you'll get a skb which is far more likely to be cache hot.
Not sure I get this point.

"Give the page to the HW" = Do you mean that I should dma_map_single()
a full page (|PAGE_SIZE|) in am65_cpsw_nuss_rx_push() ?
Yes, I think so. I think that's what you effectively do now anyway,
you just limit the len and wrap it in an skb. But
am65_cpsw_nuss_rx_push() will effectively get that page back from
skb->data and map it.

That's much better indeed, with the implementation you suggest: 600 Mbits/sec
instead of 500. I did not expect such improvement.
I'll send a new version when I finish retesting.