[PATCH RFC net-next 0/5] net: ethernet: ti: am65-cpsw: add AF_XDP zero copy support

Roger Quadros posted 5 patches 7 months ago
There is a newer version of this series
drivers/net/ethernet/ti/Makefile         |   2 +-
drivers/net/ethernet/ti/am65-cpsw-nuss.c | 526 +++++++++++++++++++++++++++----
drivers/net/ethernet/ti/am65-cpsw-nuss.h |  37 ++-
drivers/net/ethernet/ti/am65-cpsw-xdp.c  | 155 +++++++++
4 files changed, 656 insertions(+), 64 deletions(-)
[PATCH RFC net-next 0/5] net: ethernet: ti: am65-cpsw: add AF_XDP zero copy support
Posted by Roger Quadros 7 months ago
This series adds AF_XDP zero coppy support to am65-cpsw driver.

Tests were performed on AM62x-sk with xdpsock application [1].

A clear improvement is seen in 64 byte packets on Transmit (txonly)
and receive (rxdrop).
1500 byte test seems to be limited by line rate (1G link) so no
improvement seen there in packet rate. A test on higher speed link
(or PHY-less setup) might be worthwile.

There is some issue during l2fwd with 64 byte packets and benchmark
results show 0. I'm still investigating this issue.

AF_XDP performance using 64 byte packets in Kpps.
Benchmark:	XDP-SKB		XDP-Native	XDP-Native(ZeroCopy)
rxdrop		317		504		824
txonly		400		405		757
l2fwd 		207		264		0

AF_XDP performance using 1500 byte packets in Kpps.
Benchmark:	XDP-SKB		XDP-Native	XDP-Native(ZeroCopy)
rxdrop		82		82		82
txonly		82		82		82
l2fwd 		82		82		82

[1]: https://github.com/xdp-project/bpf-examples/tree/master/AF_XDP-example

To: 

Signed-off-by: Roger Quadros <rogerq@kernel.org>
---
Roger Quadros (5):
      net: ethernet: ti: am65-cpsw: fix BPF Program change on multi-port CPSW
      net: ethernet: ti: am65-cpsw: add XSK pool helpers
      net: ethernet: ti: am65-cpsw: Add AF_XDP zero copy for RX
      net: ethernet: ti: am65-cpsw: Add AF_XDP zero copy for TX
      net: ethernet: ti: am65-cpsw: enable zero copy in XDP features

 drivers/net/ethernet/ti/Makefile         |   2 +-
 drivers/net/ethernet/ti/am65-cpsw-nuss.c | 526 +++++++++++++++++++++++++++----
 drivers/net/ethernet/ti/am65-cpsw-nuss.h |  37 ++-
 drivers/net/ethernet/ti/am65-cpsw-xdp.c  | 155 +++++++++
 4 files changed, 656 insertions(+), 64 deletions(-)
---
base-commit: 9f607dc39b6658ba8ea647bd99725e68c66071b7
change-id: 20250225-am65-cpsw-xdp-zc-2af9e4be1356

Best regards,
-- 
Roger Quadros <rogerq@kernel.org>
Re: [PATCH RFC net-next 0/5] net: ethernet: ti: am65-cpsw: add AF_XDP zero copy support
Posted by Malladi, Meghana 5 months, 1 week ago
Hi Roger,

On 5/20/2025 3:53 PM, Roger Quadros wrote:
> This series adds AF_XDP zero coppy support to am65-cpsw driver.
> 
> Tests were performed on AM62x-sk with xdpsock application [1].
> 
> A clear improvement is seen in 64 byte packets on Transmit (txonly)
> and receive (rxdrop).
> 1500 byte test seems to be limited by line rate (1G link) so no
> improvement seen there in packet rate. A test on higher speed link
> (or PHY-less setup) might be worthwile.
> 
> There is some issue during l2fwd with 64 byte packets and benchmark
> results show 0. I'm still investigating this issue.
> 
> AF_XDP performance using 64 byte packets in Kpps.
> Benchmark:	XDP-SKB		XDP-Native	XDP-Native(ZeroCopy)
> rxdrop		317		504		824
> txonly		400		405		757
> l2fwd 		207		264		0
> 
> AF_XDP performance using 1500 byte packets in Kpps.
> Benchmark:	XDP-SKB		XDP-Native	XDP-Native(ZeroCopy)
> rxdrop		82		82		82
> txonly		82		82		82
> l2fwd 		82		82		82
> 
> [1]: https://github.com/xdp-project/bpf-examples/tree/master/AF_XDP-example
> 
> To:
> 
> Signed-off-by: Roger Quadros <rogerq@kernel.org>

This series crashes Linux on am64xx-hsevm, when I tried nfs boot using 
AM65-CPSW-NUSS driver:
logs: 
https://gist.github.com/MeghanaMalladiTI/d655a1c8ca88113ee7f5f57d6ab0ec4c

Seems like you have reverted the fix for the same bug which was reported 
by Siddharth and fixed by Julien: 
https://lore.kernel.org/all/7f7fb71a-6d15-46f1-b63c-b569a2e230b7@baylibre.com/

reverted lines:
		if (!common->ports[port].ndev)
		/* FIXME should we BUG here? */
			continue;

Can you please take a look at it.

> ---
> Roger Quadros (5):
>        net: ethernet: ti: am65-cpsw: fix BPF Program change on multi-port CPSW
>        net: ethernet: ti: am65-cpsw: add XSK pool helpers
>        net: ethernet: ti: am65-cpsw: Add AF_XDP zero copy for RX
>        net: ethernet: ti: am65-cpsw: Add AF_XDP zero copy for TX
>        net: ethernet: ti: am65-cpsw: enable zero copy in XDP features
> 
>   drivers/net/ethernet/ti/Makefile         |   2 +-
>   drivers/net/ethernet/ti/am65-cpsw-nuss.c | 526 +++++++++++++++++++++++++++----
>   drivers/net/ethernet/ti/am65-cpsw-nuss.h |  37 ++-
>   drivers/net/ethernet/ti/am65-cpsw-xdp.c  | 155 +++++++++
>   4 files changed, 656 insertions(+), 64 deletions(-)
> ---
> base-commit: 9f607dc39b6658ba8ea647bd99725e68c66071b7
> change-id: 20250225-am65-cpsw-xdp-zc-2af9e4be1356
> 
> Best regards,

-- 
Thanks,
Meghana Malladi
Re: [PATCH RFC net-next 0/5] net: ethernet: ti: am65-cpsw: add AF_XDP zero copy support
Posted by Jakub Kicinski 5 months, 1 week ago
On Mon, 14 Jul 2025 14:50:05 +0530 Malladi, Meghana wrote:
> > AF_XDP performance using 64 byte packets in Kpps.
> > Benchmark:	XDP-SKB		XDP-Native	XDP-Native(ZeroCopy)
> > rxdrop		317		504		824
> > txonly		400		405		757
> > l2fwd 		207		264		0
> > 
> > AF_XDP performance using 1500 byte packets in Kpps.
> > Benchmark:	XDP-SKB		XDP-Native	XDP-Native(ZeroCopy)
> > rxdrop		82		82		82
> > txonly		82		82		82
> > l2fwd 		82		82		82
> > 
> > [1]: https://github.com/xdp-project/bpf-examples/tree/master/AF_XDP-example
> > 
> > To:
> > 
> > Signed-off-by: Roger Quadros <rogerq@kernel.org>  
> 
> This series crashes Linux on am64xx-hsevm, when I tried nfs boot using 
> AM65-CPSW-NUSS driver:
> logs: 
> https://gist.github.com/MeghanaMalladiTI/d655a1c8ca88113ee7f5f57d6ab0ec4c
> 
> Seems like you have reverted the fix for the same bug which was reported 
> by Siddharth and fixed by Julien: 
> https://lore.kernel.org/all/7f7fb71a-6d15-46f1-b63c-b569a2e230b7@baylibre.com/
> 
> reverted lines:
> 		if (!common->ports[port].ndev)
> 		/* FIXME should we BUG here? */
> 			continue;
> 
> Can you please take a look at it.

Just to be clear -- you're reporting this problem to Roger so that its
fixed before the series is reposted? I don't see this in the tree, I
wanted to make sure it's not something I need to track as a regression.
Re: [EXTERNAL] Re: [PATCH RFC net-next 0/5] net: ethernet: ti: am65-cpsw: add AF_XDP zero copy support
Posted by Malladi, Meghana 5 months, 1 week ago
Hi Jakub,

Sorry for the duplicate mail.

On 7/14/2025 8:36 PM, Jakub Kicinski wrote:
> On Mon, 14 Jul 2025 14: 50: 05 +0530 Malladi, Meghana wrote: > > AF_XDP 
> performance using 64 byte packets in Kpps. > > Benchmark: XDP-SKB XDP- 
> Native XDP-Native(ZeroCopy) > > rxdrop 317 504 824 > > txonly 400 405 757 >
> ZjQcmQRYFpfptBannerStart
> This message was sent from outside of Texas Instruments.
> Do not click links or open attachments unless you recognize the source 
> of this email and know the content is safe.
> Report Suspicious
> <https://us-phishalarm-ewt.proofpoint.com/EWT/v1/G3vK! 
> uDdqXRfP1m37CoZlPNNDnQgOintsvKy- 
> cENuCwB1b5Qxa66rT1SFJDmyny6jsjalW7Wur6ukCSGrdQ$>
> ZjQcmQRYFpfptBannerEnd
> 
> On Mon, 14 Jul 2025 14:50:05 +0530 Malladi, Meghana wrote:
>> > AF_XDP performance using 64 byte packets in Kpps.
>> > Benchmark:	XDP-SKB		XDP-Native	XDP-Native(ZeroCopy)
>> > rxdrop		317		504		824
>> > txonly		400		405		757
>> > l2fwd 		207		264		0
>> > 
>> > AF_XDP performance using 1500 byte packets in Kpps.
>> > Benchmark:	XDP-SKB		XDP-Native	XDP-Native(ZeroCopy)
>> > rxdrop		82		82		82
>> > txonly		82		82		82
>> > l2fwd 		82		82		82
>> > 
>> > [1]: https://urldefense.com/v3/__https://github.com/xdp-project/bpf-examples/ 
> tree/master/AF_XDP-example__;!!G3vK!Sv1p-bFPBDlzD-YMO2sjo- 
> X2gv3CW5uHD_O771StRVzMR8Vr75k7tTGQJ27MRy_fz3d9m40aZg$ <https://urldefense.com/v3/__https://github.com/xdp-project/bpf-examples/tree/master/AF_XDP-example__;!!G3vK!Sv1p-bFPBDlzD-YMO2sjo-X2gv3CW5uHD_O771StRVzMR8Vr75k7tTGQJ27MRy_fz3d9m40aZg$>
>> > 
>> > To:
>> > 
>> > Signed-off-by: Roger Quadros <rogerq@kernel.org>  
>> 
>> This series crashes Linux on am64xx-hsevm, when I tried nfs boot using 
>> AM65-CPSW-NUSS driver:
>> logs: 
>> https://urldefense.com/v3/__https://gist.github.com/MeghanaMalladiTI/ 
> d655a1c8ca88113ee7f5f57d6ab0ec4c__;!!G3vK!Sv1p-bFPBDlzD-YMO2sjo- 
> X2gv3CW5uHD_O771StRVzMR8Vr75k7tTGQJ27MRy_fz3ecuWN_dw$ <https://urldefense.com/v3/__https://gist.github.com/MeghanaMalladiTI/d655a1c8ca88113ee7f5f57d6ab0ec4c__;!!G3vK!Sv1p-bFPBDlzD-YMO2sjo-X2gv3CW5uHD_O771StRVzMR8Vr75k7tTGQJ27MRy_fz3ecuWN_dw$>
>> 
>> Seems like you have reverted the fix for the same bug which was reported 
>> by Siddharth and fixed by Julien: 
>> https://urldefense.com/v3/__https://lore.kernel.org/ 
> all/7f7fb71a-6d15-46f1-b63c-b569a2e230b7@baylibre.com/__;!!G3vK!Sv1p- 
> bFPBDlzD-YMO2sjo-X2gv3CW5uHD_O771StRVzMR8Vr75k7tTGQJ27MRy_fz3exh7VnCw$ <https://urldefense.com/v3/__https://lore.kernel.org/all/7f7fb71a-6d15-46f1-b63c-b569a2e230b7@baylibre.com/__;!!G3vK!Sv1p-bFPBDlzD-YMO2sjo-X2gv3CW5uHD_O771StRVzMR8Vr75k7tTGQJ27MRy_fz3exh7VnCw$>
>> 
>> reverted lines:
>> 		if (!common->ports[port].ndev)
>> 		/* FIXME should we BUG here? */
>> 			continue;
>> 
>> Can you please take a look at it.
> 
> Just to be clear -- you're reporting this problem to Roger so that its
> fixed before the series is reposted? I don't see this in the tree, I
> wanted to make sure it's not something I need to track as a regression.
> 

Yes you are right. This isn't a regression, I reported this as part of 
my testing for this RFC patch series.

-- 
Thanks,
Meghana Malladi