🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #16079

Re: [PATCH net-next v4 3/3] net: ethernet: mtk_eth_soc: add 9K jumbo frame

#16079
From: Sandeep Haemoon
Date: Sat, 14 Nov 2026 00:20
82 lines
11981 bytes
On the v4 review of patch 3/3:

> [Medium] The shared RX length leaves no room for an 802.1Q tag at
> 1 KiB boundaries, including the advertised max_mtu.

Right, thank you.  v5 adds VLAN_HLEN to the length before the 1 KiB
round-up and lowers the advertised max_mtu by the same four bytes to
9194, so a tagged maximum-size frame is exactly rx_buf_len 9216 and
still at or under the XMAC 9216 cap.  XMAC_RX_CFG2 and the ring
buffers therefore cover a tagged frame at every MTU, including the
maximum.

> [Medium] GMAC1 (the built-in switch port and DSA conduit on MT7988)
> advertises max_mtu = 9198, but the only receive limit the driver
> can program caps at 2048.

You found the missing piece: the vendor driver has a second MCR
max-rx field (bits 31:28, 1024-byte units) that this port never
wrote.  v5 clears and programs MAC_MCR_MAX_RX_JUMBO for GMAC1, so the
same shared length is programmable for the switch port as for the
XGMII MACs.  The new field handling is limited to the
MTK_NETSYS_RX_9K SoCs, so every other SoC keeps its previous MCR
programming bit for bit.  Whether the internal switch path enforces
the field for switch-side frames at all remains a hardware question;
the commit message documents it honestly.

> [Medium] The unpolled QDMA RX ring is now filled with jumbo-sized
> buffers.

Right.  v5 changes mtk_max_frag_size()/mtk_max_buf_size() to take the
buffer length instead of struct mtk_eth, and mtk_rx_alloc() sizes the
never-polled QDMA RX ring at the fixed 2K length; only the polled
rings grow.  HW-LRO rings keep their 12288-byte sizing.

> [Medium] Possible kernel memory exposure (speculative).

Accepted as a robustness fix: v5 drops any descriptor whose PLEN0
exceeds ring->buf_size, with rx_length_errors, before the buffer can
be passed up, so the larger build_skb() size can no longer expose
unwritten memory even if the engine over-reports the length.

> [Medium] The PDMA RX max-frame (SDL) field may now be set 12 KiB
> above the posted buffer size (speculative).

The field is programmed the way the MediaTek downstream driver does
(frame length offset by MTK_PDMA_LRO_SDL in GENMASK(30,16)); the
local 6.18 backport drops jumbo frames without the write, and the
vendor 5.4 tree programs the plain 0x3000 LRO offset, both consistent
with the offset reading.  The encoding is the vendor's and not
publicly documented, and the comment and commit message now say
exactly that and ask for a datasheet confirmation.  No code change
in v5.

> [Medium] net: mtk_eth_soc: mtk_xdp_setup() rejects XDP detach when
> MTU is jumbo.

Right, the pool-size check now runs only when a program is attached,
so a detach always succeeds.  The shared eth->prog weakness the rest
of the analysis describes is pre-existing and is not addressed in
this series.

> [Low] The commit message hides a behaviour change on other SoCs and
> gets the buffer sizes wrong.

The message is corrected: order-1 (8 KiB) covers rx_buf_len
4096..7168 and order-2 (16 KiB) starts at rx_buf_len 8192, and it
now mentions that the build_skb()/truesize change also covers the
HW-LRO rings on mt2701, mt7622, mt7623 and mt7629.

> [High] On the first open, a failure while filling an RX ring leaks
> the buffers and frees with size 0.

Pre-existing in v7.3: ring->dma_size is set only after the fill loop
(introduced by ee40681037c0, "net: ethernet: mediatek: add HW LRO
functions of PDMA RX rings"), so this series does not create it.  It
will be sent as a separate fix that sets ring->dma_size before the
fill loop.

v5: https://lore.kernel.org/all/patch-f1e62a87eb0f914e1ea52a395f465998@loljews.com/

pw-bot: cr
Technical Details
Message-ID: <patch-63fdf3015315ecb8ed8c06b638f66d45@loljews.com>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363008-linux-kernel-netdev=dewy.ru
References: <patch-271a13eac7135a653a78c355e66438ab@loljews.com> <179452725692.2199510.7733814065763991670@kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363008-linux-kernel-netdev=dewy.ru
From: sandeeph@loljews.com (Sandeep Haemoon)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v4 3/3] net: ethernet: mtk_eth_soc: add 9K jumbo frame
Date: Sat, 14 Nov 2026 02:20:50 +0200
Organization: Usenet Network
Message-ID: <patch-63fdf3015315ecb8ed8c06b638f66d45@loljews.com>
References: <patch-271a13eac7135a653a78c355e66438ab@loljews.com> <179452725692.2199510.7733814065763991670@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network; logging-data="1474542"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:d79z/l7a4HNVFq4WFlo/vt/nFV4= sha256:bgqzb2P45UAz6UoZuWQwITyk9bBLplrtHbQYb57nUY8= sha1:fIb7lLlSnAvKuQwzl4y7ChxGe3g= sha256:L2NiuW7zuGigWEqqSrkMP+n6gUssx+BMt+4NBiTmP5A=
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 2810E11470C; Sat, 14 Nov 2026 03:21:19 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.05
X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=loljews.com
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 BICXaLHvuTrT; Sat, 14 Nov 2026 03:21:15 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-363008-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=loljews.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 1BDBA114706; Sat, 14 Nov 2026 03:21:07 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 50C4C80F67; Sat, 14 Nov 2026 00:20:59 +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=1794615659; b=EbJk6l6+zvjPiZrGcInsqUajR0dOJ3+9icdOUuQWgwXdJUcKM8EzdR0FC4QDxzEWiCNw FgGxcLHcbQoosdjBhiGjzO1ROADZ674bc73PnIMKkdpqDIVggYlT9+xxORwFItMeMW6sa pRh7qcfEpTOJki11yb8FcJ0do+G+shY7x5+49Fzg+IDE9gzV5VvFbNyeyc3GTj9axYKbP X6FI18wNpcHKxiShzsnVFTeDsLdFHenGguX64L8J9/Ysen+wfQpCIto3epBL2OlR32rdX DdD8iFYf5PQb4wFDCSDqzP3onObEZZNuh5IWTRaLvEQmmYn9s19QmL2Xv6ucuWoG1bg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794615659; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:From:To: Cc:Subject:Date:Message-Id:In-Reply-To:References:X-Mailing-List: List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe: List-Owner:Precedence:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=WIopzPvsYRfZHQFGDuvt4Tkqdc0XaieTCpebg+KuRL8=; b=dWjAQKT6vFiLg2fH5mx2BORg7d7Kb+taCI/n4rJ3ObMv1fLgBLGkPXHXrra4cdu+PJ0P sO0nVx/vYAl15eiXYapdKjcQNg+lkF/JDOYM/Kq0/NlH2YvHgb3x49u0OOCDQNJPyG82y yyFyPQ26XiSpYTKuT9imzQ9oQGYgPLaSBQFS1MuAfZIRCMOsfeASqtCsuWqmkLO4YwL3Y e9MrSKKhCowXCm3Ne+b9A06M8pzmauLYY8W9I7uDynvPypZRSFi3Vx0+Oc1KNKo8/sLq8 IHYQ++Xza30UsCof9m+wzbrpWOS1Mw4MgtBuhOZRXRP4d7Tf73MeINmJxdTcVNxR25w==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=loljews.com header.i=@loljews.com header.a=rsa-sha256 header.s=mail header.b=RxO8jvzs; dmarc=pass header.from=loljews.com; spf=pass smtp.mailfrom=loljews.com; 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 28BD9606A331; Sat, 14 Nov 2026 00:20:59 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=loljews.com header.i=@loljews.com header.a=rsa-sha256 header.s=mail header.b=RxO8jvzs
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=54.38.221.178
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794615653; b=fBKk7B9b6iW/fIA+oOCQbMyY6mFRMIyQ6R/5DKM7krqcpk/f7LICboTVplErZNcBsS1G g/qjQ5xIqOMf+Ic1Cv++ubEqY4HkJLTnuyy9h3U249zqfMFQXIk3SwY8iru3JGZT00+DU 5JVohyQIIc947lA0eiqGpZLiEeRvzZhx0loH6BAMBxdfOqD20FeQv89RrU/mHTG5wSgQY 0N0mG4VaAnwCrj/D4T1kzQc9dMUETCZx5o5pNtDhOxcQuaWaM63U3bcwF3gRwzXJCtnyQ yEMRHJHzZbfaDyWu7qK5QqjSpZ0td1JnbkSLDUYVPFPwyUaD3mYJJc11foRuasceRSA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794615653; h=DMARC-Filter:DKIM-Signature:Received:From:To:Cc:Subject:Date: Message-Id:In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=WIopzPvsYRfZHQFGDuvt4Tkqdc0XaieTCpebg+KuRL8=; b=eiXaiYVpdrpr6NhmV2zDN/qw8SOU3S+nYcwYIGIIfx56Vg1yg8mCJ17ANYqo+pAUTLWK eptuhOAlro3jKru9OaOLfAEesbZ8Kcgm0a4a4w8KKR/nRfnlbycxKaMTa4RkMAF/zacg8 /I+2MbK4zoRmX/z4u+kAFeyLenT3wwjC+q4qnKe6c2a6YzYdKJPOeezQvfPny4eLzUdP0 QjpmR5dd23COzp3+CC/DP8iltck+tAXan6Efuzn6KRVYEWd1CUc5SpQBLfk+qU7hhv9Xf QgNpWtV0sQUmnVi6PVEcjUlv0Pk0refDQtjh+HOBEeZrlwKu6K6v56hIk/4tB8MG5+g==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=loljews.com; spf=pass smtp.mailfrom=loljews.com; dkim=pass header.d=loljews.com header.i=@loljews.com header.a=rsa-sha256 header.s=mail header.b=RxO8jvzs; arc=none smtp.remote-ip=54.38.221.178
X-Received: from mnc015mcc432.ss7-reroute.local (unknown [54.38.221.178]) (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 84C97606A334; Sat, 14 Nov 2026 00:20:52 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 84C97606A334
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=loljews.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=loljews.com
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=loljews.com; s=mail; t=1794615650; bh=WIopzPvsYRfZHQFGDuvt4Tkqdc0XaieTCpebg+KuRL8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=RxO8jvzs03Urb+YEtVImRGsENxFCcHzrUzMO4qQjPk4T1WgL54vTWHivqJE/7RIFi b9VlbSMuQjs9ew7gULmz2ExvnS5EzwTIH6HeAphqMikOH78H82OAFFb7hu8BpE8c3+ K3+LzsG6cnFjDA5pLLvetmm7ISQRlANqEvWivM8nPa7a1Mca0qRr2T5pNaslqejzw0 a7+zPXUkBEMCrrZPjVlYrYML0s9ZAVl1/9VtqiqAZGvGoF7oMvTpS2ZD8A1kLtnOfn egONkWgzIvPGWENQiiANg7ESTh8J4hnnO8dUZs1NdI9k0a/y3ZSS1TxylrJSF4cTW7 xjQpc4+VjsGHw==
X-Received: from loljews.com (localhost [127.0.0.1]) by postfix (Postfix) with ESMTP id 8EF6427A347E; Sat, 14 Nov 2026 02:20:50 +0200 (EET)
X-Cc: netdev-bot+sashiko@kernel.org, Felix Fietkau <nbd@nbd.name>, Lorenzo Bianconi <lorenzo@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Daniel Golle <daniel@makrotopia.org>, Mason Chang <mason-cw.chang@mediatek.com>, Frank Wunderlich <frank-w@public-files.de>, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org
X-In-Reply-To: <179452725692.2199510.7733814065763991670@kernel.org>
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