Re: [PATCH net-next v9 0/2] net: ethernet: mtk_eth_soc: 9K jumbo frame support

From: Frank Wunderlich

Date: Tue Dec 01 2026 - 02:13:48 EST


Hi

Thank you very much for working on it.

Am 1. Dezember 2026 00:16:10 MEZ schrieb Sandeep Haemoon <sandeeph@xxxxxxxxxxx>:
>This series makes the MediaTek SoC ethernet driver support 9K jumbo
>frames on the 10G XGMII MACs (MT7988). The driver advertises a
>2030-byte max_mtu and programs the MAC max-rx field for at most 2048
>bytes, so an MTU above 2030 is rejected and 9K frames are not usable.
>
>The 36-bit DMA fix that was patch 1 of the previous revisions has been
>split out and sent to net on its own, with Cc: stable and a field
>Tested-by, after a report of real memory corruption on an MT7988 board
>with 8 GiB of RAM. It is not part of this series.

Thanks again for fixing this.

>Patch 1 gates the page_pool on the ring's descriptor length: the pool
>hands out order-0 pages and maps at most MTK_PP_MAX_BUF_SIZE, so a
>ring whose descriptor length is larger has to use the
>netdev_alloc_frag()/mtk_max_buf_alloc() path.
>
>Patch 2 adds the MTK_NETSYS_RX_9K capability, advertises a 9194-byte
>max_mtu on the XGMII MACs (from the DT phy_mode at probe, so DSA can
>raise the conduit MTU before the netdev is opened), programs
>XMAC_RX_CFG2 and the PDMA RX SDL, derives the shared RX buffer length
>from the largest MTU (802.1Q headroom included) and sizes the RX rings
>from it, keeping the never-polled QDMA ring at its 2K buffers. The
>MAC max-rx limits stay in sync with that shared length, including
>GMAC1's MCR jumbo field. A runtime MTU change that needs larger
>buffers is rejected with -EBUSY while DMA is running; shrinking is
>allowed. GMAC1, the built-in switch port, keeps its MCR programming
>(bucket plus the jumbo field in 1024-byte units), written after the
>MAC_MCR_FORCE_LINK_DOWN reset so it survives every mac_config(); only
>GMAC1 is given the jumbo length, and whether the internal switch path
>decodes it is a hardware property the commit message documents.

Sounds like it is still needed to bring down macs like in SDK to increase MTU or always use 9K on mac/dma layer. See below comment for possible solution.

>This work is a forward-port of the MediaTek downstream jumbo work:
>Mason Chang's "change default rx buffer length" and "add 9k jumbo
>frame support" (MediaTek OpenWrt feed 999-eth-30/31, carried in
>frank-w/BPI-Router-Linux), plus Frank Wunderlich's "try to fix crash
>the right way". The runtime reallocation of Mason's "dynamic rx
>buffer adjustment" (feed 999-eth-33) is not included and will be sent
>separately. Attribution is prose plus Link: tags: Co-developed-by
>requires the original authors' own Signed-off-by lines, which we do
>not have, and the port diverges from the downstream implementation
>(2K buffer floor, per-ring pool gate, the -EBUSY rule, the XDP checks
>and the truesize fix are not in the downstream patches).

Have you seen Mihai Ordean change to prevent the needed down-up configuration of MACs needed by SDK code?

https://github.com/frank-w/BPI-Router-Linux/commit/f2d6ce7925c7111e2241a88c9158c15aa97d4452

Or have you found/thinking of an alternative solution?

>The equivalent change was tested on a BPI-R4 Pro 8X (MT7988, 10G
>lan6 / MxL86252) on the 6.18.60 backport: with both ends at MTU 9000,
>8K ICMP passes and iperf3 with MSS 8900 reaches ~9.87 Gbit/s (vs
>~2.57 Gbit/s at MSS 1460); the DSA conduit (GMAC1, the internal switch
>port) is raised to 9004 at boot, so that test exercised the MCR jumbo
>path.
>This series is compile-tested with CONFIG_NET_MEDIATEK_SOC=y and
>COMPILE_TEST=y; no hardware run of this exact tree yet.
>
>With the 1 KiB rounding the RX buffer length is order-1 (8 KiB) for
>rx_buf_len 4096..7168 and order-2 (16 KiB) from rx_buf_len 8192 up;
>at the 9K ring size the 16 KiB buffers pin about 32 MiB in the polled
>ring while DMA is up (the 2K QDMA ring adds about 8 MiB) and make the
>refill a high-order GFP_ATOMIC allocation. That cost
>is inherent to the downstream design; skb->truesize now reports the
>allocation that was actually made.
>

>Tested on a BPI-R4 Pro 8X (MT7988, 10G port) on a 6.18.60 backport:
>8K ICMP passes and iperf3 with MSS 8900 at MTU 9000 reaches about
>9.87 Gbit/s. This series is compile-tested with
>CONFIG_NET_MEDIATEK_SOC=y and COMPILE_TEST=y.

Do you need to bring down macs when changing (increasing) the mtu?

regards Frank