Re: [PATCH v3 net-next 5/5] net: fec: enable the Jumbo frame support for i.MX8QM

From: Andrew Lunn
Date: Sat Aug 23 2025 - 16:45:19 EST


> > > - /* enable ENET store and forward mode */
> > > - writel(FEC_TXWMRK_STRFWD, fep->hwp + FEC_X_WMRK);
> > > +
> > > + /* When Jumbo Frame is enabled, the FIFO may not be large enough
> > > + * to hold an entire frame. In this case, configure the interface
> > > + * to operate in cut-through mode, triggered by the FIFO threshold.
> > > + * Otherwise, enable the ENET store-and-forward mode.
> > > + */
> > > + if (fep->quirks & FEC_QUIRK_JUMBO_FRAME)
> > > + writel(0xF, fep->hwp + FEC_X_WMRK);
> >
> > The quirk indicates the hardware is capable of jumbo frames, not that jumbo
> > frames are enabled. Don't you need to compare the mtu with ETH_FRAME_LEN +
> > ETH_FCS_LEN to say jumbo is enabled?
> >
>
> The comments here do have some confusion. The goal is to enable cut-through mode
> when the hardware supports Jumbo frames. But we can limit the scope to enable it
> only when MTU is less than 2k bytes.

That would be good. I've no idea how many embedded systems actually
use jumbo packets. Maybe your marketing people can tell you. 1%? 5%?
But you are changing this for 100% of your customers, which might
cause regressions. So it would be better to only enable this when
needed.

> > Is there a counter or other indication that the FIFO experienced an underflow?
> >
>
> There is a Underrun bit in the status field in the TX buffer descriptor. The hardware
> supports retransmit frames if high memory latency is encountered due to other
> high-priority bus masters.

So this:
if (status & BD_ENET_TX_UN) /* Underrun */
ndev->stats.tx_fifo_errors++;

Good to see there is a counter for it.

Andrew