Re: [PATCH net] net: fec: change the default rx copybreak length to 1518

From: Jakub Kicinski
Date: Fri Aug 19 2022 - 18:04:52 EST


On Fri, 19 Aug 2022 17:57:07 +0200 Andrew Lunn wrote:
> On Fri, Aug 19, 2022 at 05:00:41PM +0800, wei.fang@xxxxxxx wrote:
> > Set the default rx copybreak value to 1518 so that improve the
> > performance when SMMU is enabled. User can change the copybreak
> > length in dynamically by ethtool.
>
> Please provide some benchmark for this. And include a range of SoCs
> which include the FEC. Maybe this helps for the platform you are
> testing on, but is bad for imx25, Vybrid etc?
>
> > + * The driver support .set_tunable() interface for ethtool, user
> > + * can dynamicly change the copybreak value.
> > + */
>
> Which also means you could change it for your platform. So a patch
> like this needs justifying.

Fully agreed, perhaps if the DMA mapping on the platform is extremely
slow we're better off making the platform use bounce buffers for
everything.

Another though is that you can try to manually sync only the parts
of the buffers that the device actually touched instead of full 2kB,
and tell the DMA core to skip the sync of the full buffer.