🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #20473

Re: [PATCH net v2 1/2] net: stmmac: Limit the MTU of normal descriptors to one buffer

#20473
From: Chen-Yu Tsai
Date: Sun, 22 Nov 2026 16:56
72 lines
11860 bytes
On Mon, Nov 23, 2026 at 12:27 AM Nicolai Buchwitz <nb@tipi-net.de> wrote:
>
> On 22.11.2026 10:13, Arun Iyengar via B4 Relay wrote:
> > From: Arun Iyengar <aiyengar1990@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@armlinux.org.uk>
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Arun Iyengar <aiyengar1990@gmail.com>
>
> > [...]
>
> Thanks,
> Nicolai
>
Technical Details
Message-ID: <CAGb2v65RZAVX6FNV_y+TO+frP9RBCURZbW=B3Ws2_4f8f+1acQ@mail.gmail.com>
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368758-linux-kernel-netdev=dewy.ru
References: <20261122-sun8i-emac-mtu-limit-v2-0-c4081e5b83cf@gmail.com> <20261122-sun8i-emac-mtu-limit-v2-1-c4081e5b83cf@gmail.com> <d3af70f9334370a1d32511504aa14725@tipi-net.de>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368758-linux-kernel-netdev=dewy.ru
From: wens@kernel.org (Chen-Yu Tsai)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v2 1/2] net: stmmac: Limit the MTU of normal
 descriptors to one buffer
Date: Mon, 23 Nov 2026 00:56:08 +0800
Organization: Usenet Network
Message-ID: <CAGb2v65RZAVX6FNV_y+TO+frP9RBCURZbW=B3Ws2_4f8f+1acQ@mail.gmail.com>
References: <20261122-sun8i-emac-mtu-limit-v2-0-c4081e5b83cf@gmail.com>
 <20261122-sun8i-emac-mtu-limit-v2-1-c4081e5b83cf@gmail.com> <d3af70f9334370a1d32511504aa14725@tipi-net.de>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
	logging-data="3680894"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:zOgl9cCmrVt2zG3VMV0C9UHHC8E= sha256:UAK7lPU9tZ8wnkLK2obqHvdkz/IX4csjOhdIQy/4Md4=
	sha1:8N9FSUkaBLa1fG4stQTkcuZQ5Z4= sha256:F2sASatdYR+SKXZHX3mClOft48dWpUgtoktn4r58Qaw=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 2A790125D81; Sun, 22 Nov 2026 19:56:42 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 2FnCaoprSF17;
	Sun, 22 Nov 2026 19:56:38 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-368758-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id A96C9125D80; Sun, 22 Nov 2026 19:56:28 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 2190D2B0FA; Sun, 22 Nov 2026 16:56:27 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1795366586;
	b=QwNyi5u2ayYOjwEWcFw6aQluPO+ZtkP+3o5qGgp/5xHk1uqTZik91LNy1V6kaDFmoAD2
	 lJ6OmQT22PP5qTOsObuSjDkfmOWg43MyRDrmH7Awt+z3ipcpaXE2N25Y3oquSwzUKPJ7q
	 MfzVSIwp1TQ52wDUgjjrX5a5WEW+5Qybs34vouFFDYb4Tpf0hFmJCsxdoLZu9ZBy2pute
	 PJGkLuZ3lP+Cyt382ho0Gl4ybYiotHkiADXUmCFiuodDivfhr5kaN7PgkDDVBYb+PHdzd
	 g2i9pBT7HxahMfzMPK2s6hPdWpz+goXFFWyNruTpZJT1g7bUnBG3+YRhy35CeTewiLg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795366586;
	h=X-Original-To:Received:Received:DKIM-Signature:Received:
	 X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:X-Mailing-List:
	 List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
	 List-Owner:Precedence:MIME-Version:References:In-Reply-To:Reply-To:
	 From:Date:X-Gmail-Original-Message-ID:X-Gm-Features:Message-ID:
	 Subject:To:Cc:Content-Type:Content-Transfer-Encoding;
	bh=r0teGaLFiZbnip2X0hbOa3BQ614Td9G1LXhr62qV31A=;
	b=RxRplc3UvAOQJLr/xVzuHKaHGRCU7BHyjetgvNVSVoAlgrCte7/jMTRIaJQcOgi9hZNY
	 sEL7NADpXP7oYky3BIDGz4mFviw+CBbL1PBgzyxb1Mxv446ai/qsaLGBZqfpEVHEHyuVy
	 KaIxk4591l0auA+0vZwOxTqotUZEhakyDFsPtuEUHbeak+bI84hfgpWeORR3A3oRTrRaw
	 Lmx8nOPDwyeBKoMGKqbG7PcFbYtaYULe8iAZU2ZMbl0q7kywjNlDZPrJ3JGd84fEnHecI
	 AAfeSZ0ItAyXuLHp9cBm6X27tE0EiA5m7h/TCjLNG6b2iB2knJv7bUlSHp3iFZNmiAA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ZUohEqQH;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 405C3606A336;
	Sun, 22 Nov 2026 16:56:26 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ZUohEqQH
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795366585;
	b=gA9jFk9AVCJVFZ5MKxFxZ/qBkfAhkc5k4dUj2b8mbWAQgr/vzL0iCvZj6SADGR4Jmu+c
	 LIMcBqTFm7smkIXJw/Tu1MHVNgETtyuj65DCS/PYeEE1v/f1+oVCrT5u5YoxX8YZQAP82
	 5BWJvxUIrjl2vOXy5T7mMnCln99ZEeYNwIlI0YkA9aXBkxyr5GKkBrhTZmcg9TZmX25KM
	 /lGdYCyuDZWg7W341nXewkrYbsBgTAHGdkTdC6JteOGs2ze6CGvB+O7jeJfGT8kANVz4W
	 7YvcDdwBrx9k2/QF36tBMrd4e/4S8z4Twc13z2X7aZ0G/d24cqz6WidVoVU53VT/JHA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795366585;
	h=Received:DKIM-Signature:Received:X-Forwarded-Encrypted:
	 X-Gm-Message-State:X-Received:MIME-Version:References:In-Reply-To:
	 Reply-To:From:Date:X-Gmail-Original-Message-ID:X-Gm-Features:
	 Message-ID:Subject:To:Cc:Content-Type:Content-Transfer-Encoding;
	bh=r0teGaLFiZbnip2X0hbOa3BQ614Td9G1LXhr62qV31A=;
	b=jWEvZ0uulQ23/IWToZbIe6x6F7AqhkgABweGdb1loGX4oEzQNS+wCObYvSR3Qwt6hkJE
	 fbt+A2kq1mUcXzQ3Bv+DJWBejs0GqOsiV1lL5wOyfLuRBSGYwOeUZmTsGUcj81+R7p0PG
	 GkMkAKINpn/m5pEpB4yCrbnblkhYAk1f7/aKG4eSmo/NJNyTO44DEOydii5J7ssI1N34L
	 rkSFJtqg3VIMgcGjWDaOTnAnT2OQys/3eY3wLgleqNjXQS2SQ+57B5WpWTs6lXu7QgtLg
	 rcixkY1lATDIbIIL72PLswC3u+JoP/xoMttXUT2YFYnmdtSrfEN04+vmEoFXCYcNIXw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ZUohEqQH;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5C8E2606A320
	for <netdev@vger.kernel.org>; Sun, 22 Nov 2026 16:56:25 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF9B41F000EF
	for <netdev@vger.kernel.org>; Sun, 22 Nov 2026 16:56:24 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795366584;
	bh=r0teGaLFiZbnip2X0hbOa3BQ614Td9G1LXhr62qV31A=;
	h=References:In-Reply-To:Reply-To:From:Date:Subject:To:Cc;
	b=ZUohEqQHZSFC/64bYg2uf7z2xhayzkxTB6MF49gU9OZp9iFnDYg1QyEMGRWipn8S1
	 ILAD+xbGhrU1Z1zu5k0r6tkQ/RRTPnHNM/dwaPDWOmIdFQNiaufWQNilIuWRcckpXD
	 oHSb2N8vDrUfwRoaZ9PsArpHQRz+ikKjZutJuOICcDDZgPaKkDx6B/LXT0T9+DoGy7
	 TsqaGUhwFRZTL/wW/OHFyw161X8LxQND8HTzN/z8fRZsuvsHpLPipywWd6OhLoZyzJ
	 8cLTLfos1iCfsPLTKXnK9nnJTeWy2QGb+mrO5hNOpC8fempSfe+i3i7xc28/TR/ZnE
	 VLBxx+TE4zAtA==
X-Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-3ab4354db11so24258701fa.1
        for <netdev@vger.kernel.org>; Sun, 22 Nov 2026 08:56:24 -0800 (PST)
X-Forwarded-Encrypted: i=1; AL+hErHeqV6zOoHD03veERa0SqPmQtl1vdm3Wu+UEWwLJfsnLNFRs0dpWjrZNSOa7hMQu/fM6cEY1Aw=@vger.kernel.org
X-Gm-Message-State: APuU4Z/UYYqvRM/xAwoyaOCgo5Kg5ZOJrjhDrYnbSTeLpLLZst7PtRkb
	P7RnNvm4DysKTKrgvS51++84HZCUYgppQuGEYIm37pASa98SgD8Q4iFuReuSIvkQMh8251ysBIZ
	BebjkbmoMBko3K9TZeOJ9C2dY3bPbD00=
X-Received: by 2002:a2e:b8c3:0:b0:3ae:6f2b:6caa with SMTP id
 38308e7fff4ca-3ae7f9f6483mr26598401fa.11.1795366582998; Sun, 22 Nov 2026
 08:56:22 -0800 (PST)
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <d3af70f9334370a1d32511504aa14725@tipi-net.de>
X-Reply-To: wens@kernel.org
X-Gmail-Original-Message-ID: <CAGb2v65RZAVX6FNV_y+TO+frP9RBCURZbW=B3Ws2_4f8f+1acQ@mail.gmail.com>
X-Gm-Features: Aa3M54oulFi-3Qjl1WQec184X79yaVwtpOneI4puTLfYjiDU5sNNxxTSKipqNJ0
X-Cc: aiyengar1990@gmail.com, Maxime Chevallier <maxime.chevallier@bootlin.com>, 
	Andrew Lunn <andrew+netdev@lunn.ch>, "David S. Miller" <davem@davemloft.net>, 
	Eric Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, 
	Jernej Skrabec <jernej.skrabec@gmail.com>, Samuel Holland <samuel@sholland.org>, 
	Maxime Coquelin <mcoquelin.stm32@gmail.com>, Alexandre Torgue <alexandre.torgue@foss.st.com>, 
	LABBE Corentin <clabbe.montjoie@gmail.com>, netdev@vger.kernel.org, 
	linux-stm32@st-md-mailman.stormreply.com, 
	linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, 
	Russell King <rmk+kernel@armlinux.org.uk>, stable@vger.kernel.org