From: Sandeep Haemoon <sandeeph@loljews.com>
To: netdev@vger.kernel.org
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
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 [thread overview]
Message-ID: <patch-63fdf3015315ecb8ed8c06b638f66d45@loljews.com> (raw)
In-Reply-To: <179452725692.2199510.7733814065763991670@kernel.org>
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
prev parent reply other threads:[~2026-11-14 0:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-09 23:59 [PATCH net-next v4 0/3] net: ethernet: mtk_eth_soc: 9K jumbo frame support Sandeep Haemoon
2026-11-09 23:46 ` [PATCH net-next v4 1/3] net: ethernet: mtk_eth_soc: reset RX DMA Sandeep Haemoon
2026-11-12 23:47 ` netdev-bot+sashiko
2026-11-09 23:46 ` [PATCH net-next v4 2/3] net: ethernet: mtk_eth_soc: skip page_pool Sandeep Haemoon
2026-11-09 23:59 ` [PATCH net-next v4 3/3] net: ethernet: mtk_eth_soc: add 9K jumbo Sandeep Haemoon
2026-11-12 23:47 ` netdev-bot+sashiko
2026-11-14 0:20 ` Sandeep Haemoon [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=patch-63fdf3015315ecb8ed8c06b638f66d45@loljews.com \
--to=sandeeph@loljews.com \
--cc=daniel@makrotopia.org \
--cc=frank-w@public-files.de \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=lorenzo@kernel.org \
--cc=mason-cw.chang@mediatek.com \
--cc=nbd@nbd.name \
--cc=netdev-bot+sashiko@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox