[PATCH net v2 1/2] net: stmmac: Limit the MTU of normal descriptors to one buffer
Chen-Yu Tsai
wens at kernel.org
Sun Nov 22 08:56:08 PST 2026
On Mon, Nov 23, 2026 at 12:27 AM Nicolai Buchwitz <nb at tipi-net.de> wrote:
>
> On 22.11.2026 10:13, Arun Iyengar via B4 Relay wrote:
> > From: Arun Iyengar <aiyengar1990 at gmail.com>
> >
> > Russell King noted in [1] that max_mtu for normal descriptors,
> > SKB_MAX_HEAD() (3712 on arm64), does not match the hardware. Their
> > buffer sizes are 11 bits, and stmmac neither splits TX frames nor joins
> > RX descriptors for them, so a frame must fit one 2047-byte buffer.
>
> AFAIU TX does split (jumbo_frm() in chain_mode.c).
Yes. But it also assumes each buffer is 2KB or 8KB, which this series
already says is not correct. (I do wonder why the size field is not
size - 1.)
And also, if I'm reading this correctly, the jumbo frame conditional
is only ever true if enhanced descriptors are available:
/* To program the descriptors according to the size of the frame */
if (enh_desc)
is_jumbo = stmmac_is_jumbo_frm(priv, skb->len, enh_desc);
csum_insertion = skb->ip_summed == CHECKSUM_PARTIAL;
if (unlikely(is_jumbo)) {
entry = stmmac_jumbo_frm(priv, tx_q, skb, csum_insertion);
if (unlikely(entry < 0) && (entry != -EINVAL))
I might have pointed this out in a reply to Arun's other patch, but here
it is again. This seems to have been broke since 2014 by
29896a674c8e stmmac: fix chained mode
> This makes RX the real limit as ndesc_get_rx_status() drops a frame that
> spans more than one descriptor. Please say that instead, it should also
> answer Chen-Yu's question about hardware vs driver?
It's great that we have interest in getting this working again, and tools
to help us get there.
FWIW the the new "GMAC200" cores in the latest Allwinner SoCs, and the GMAC
in Rockchip SoCs would also benefit. As far as I can tell they don't support
enhanced descriptors, based on DMA cap values reported in debugfs.
ChenYu
> >
> > Limit max_mtu so that a frame with two VLAN tags and the FCS fits.
> >
> > Link:
> > https://lore.kernel.org/r/E1vLJcL-0000000ExBL-0GFe@rmk-PC.armlinux.org.uk
> > [1]
> > Fixes: 48febf7e6476 ("stmmac: allow mtu bigger than 1500 in case of
> > normal desc (V4)")
> > Cc: Russell King <rmk+kernel at armlinux.org.uk>
> > Cc: stable at vger.kernel.org
> > Signed-off-by: Arun Iyengar <aiyengar1990 at gmail.com>
>
> > [...]
>
> Thanks,
> Nicolai
>
More information about the linux-arm-kernel
mailing list