RE: [PATCH V3 net-next] net: fec: add XDP_TX feature support
From: Wei Fang
Date: Thu Aug 03 2023 - 23:09:15 EST
> > The FEC of i.MX8MP-EVK has dma_coherent=false, and as I mentioned
> > above, I did not see an obvious difference in the performance. :(
>
> That is surprising - given the results.
>
> (see below, lack of perf/diff might be caused by Ethernet flow-control).
>
> >
> >>> The result of the current modification.
> >>> root@imx8mpevk:~# ./xdp2 eth0
> >>> proto 17: 260180 pkt/s
> >>
> >> These results are*significantly* better than reported in patch-1.
> >> What happened?!?
> >>
> > The test environment is slightly different, in patch-1, the FEC port
> > was directly connected to the port of another board. But in the latest
> > test, the ports of the two boards were connected to a switch, so the
> > ports of the two boards are not directly connected.
> >
>
> Hmm, I've seen this kind of perf behavior of direct-connected or via switch
> before. The mistake I made was, that I had not disabled Ethernet flow-control.
> The xdp2 XDP_TX program will swap the mac addresses, and send the packet
> back to the packet generator (running pktgen), which will get overloaded
> itself and starts sending Ethernet flow-control pause frames.
>
> Command line to disable:
> # ethtool -A eth0 rx off tx off
>
> Can I ask/get you to make sure that Ethernet flow-control is disabled (on
> both generator and DUT (to be on safe-side)) and run the test again?
>
The flow-control was not disabled before, so according to your suggestion,
I disable the flow-control on the both boards and run the test again, the
performance is slightly improved, but still can not see a clear difference
between the two methods. Below are the results.
Result: use "sync_dma_len" method
root@imx8mpevk:~# ./xdp2 eth0
proto 17: 258886 pkt/s
proto 17: 258879 pkt/s
proto 17: 258872 pkt/s
proto 17: 258312 pkt/s
proto 17: 258926 pkt/s
proto 17: 259057 pkt/s
proto 17: 258437 pkt/s
proto 17: 259242 pkt/s
proto 17: 258665 pkt/s
proto 17: 258779 pkt/s
proto 17: 259209 pkt/s
Result: use the current method
root@imx8mpevk:~# ./xdp2 eth0
proto 17: 258752 pkt/s
proto 17: 258672 pkt/s
proto 17: 258317 pkt/s
proto 17: 258787 pkt/s
proto 17: 258757 pkt/s
proto 17: 258542 pkt/s
proto 17: 258829 pkt/s
proto 17: 258480 pkt/s
proto 17: 258859 pkt/s
proto 17: 258918 pkt/s
proto 17: 258782 pkt/s
proto 17: 259086 pkt/s
proto 17: 258337 pkt/s