[PATCH net-next v3 0/8] net: bcmgenet: support larger MTUs
From: Nicolai Buchwitz
Date: Wed Oct 07 2026 - 04:52:30 EST
Larger MTU aka. jumbo frames are requested often by Raspberry Pi users, but
the hardware has its quirks with larger frames, so it never got done. Dave
Stevenson's PoC [1] had the receive side working and Justin checked the RTL
what the hardware does with long frames, which got me past the rest.
GENET never sets dev->max_mtu, and the packet ready thresholds cut frames
off at their 2048 byte reset default. With this the receive dropped them as
fragmented and transmit never sent them out. See commit messages of the
patches for more details.
Patch 1 fixes a transmit error exit that left queued frames unpublished,
the padding in patch 6 adds two more of them. Patches 2 to 5 and 7
implement the MTU as far as one descriptor reaches (3564 bytes with 4K
pages). Patch 6 pads around a transmit quirk where a frame ending just past
the threshold stops the transmitter [3]. Patch 8 reassembles the fragments
the hardware produces above it, which gets the ceiling to 16347 [2].
Tested on a CM4 (GENET v5). MTU 1500 is unchanged, MTU 9000 reaches 991/987
Mbit/s. Pierre-Marin Leclercq tested on a Pi 4 (also GENET v5) with various
MTU sizes.
[1] https://github.com/raspberrypi/linux/pull/7614
[2] https://github.com/raspberrypi/linux/pull/7617#issuecomment-5669564355
[3] https://github.com/raspberrypi/linux/pull/7617#issuecomment-5735557324
Signed-off-by: Nicolai Buchwitz <nb@xxxxxxxxxxx>
---
Changes in v3 (all from clashiko):
- new patch 1: ring the doorbell on the transmit drop exits, the last
frame of an xmit_more batch left the earlier ones unpublished
- patch 6 (pad) now precedes the max_mtu change, a bisect between them
could stall the transmitter on large page kernels, the
ENET_MAX_FRAME_LEN(mtu) helper moves into patch 5 for that
- patch 6: mention the checksum fallback in the commit message
- patch 8: read the status block before the FCS trim, pskb_trim() can
release the page it lives in
- patch 8: drop a start descriptor without end that cannot hold the
Ethernet header
- patch 8: threshold comment, note on the TX descriptor length
- Link to v2: https://lore.kernel.org/r/20261006-nb-genet-mtu-nn-v2-v2-0-c4be21151912@xxxxxxxxxxx
Changes in v2:
- patch 5: resync the PHY state machine after the MTU restart, a latched
link event was lost and an internal PHY is never polled (v1-4)
- patch 6: move the checksum fallback here from patch 7, a bisect between
them dropped checksummed frames on large page kernels
- patch 6: note the trailer limitation of the padding
- patch 7: pskb_trim() for the FCS trim, a reassembled frame is paged
- patch 7: latch frag_drop on a continuation without a start, the counter
inflated per descriptor
- comment and commit message corrections in patches 2, 4 and 5
- Link to v1: https://lore.kernel.org/r/20261002-nb-genet-mtu-nn-v2-v1-0-96dc6d54cbee@xxxxxxxxxxx
To: Doug Berger <opendmb@xxxxxxxxx>
To: Florian Fainelli <florian.fainelli@xxxxxxxxxxxx>
To: Nicolai Buchwitz <nb@xxxxxxxxxxx>
To: Broadcom internal kernel review list <bcm-kernel-feedback-list@xxxxxxxxxxxx>
To: Andrew Lunn <andrew+netdev@xxxxxxx>
To: "David S. Miller" <davem@xxxxxxxxxxxxx>
To: Eric Dumazet <edumazet@xxxxxxxxxx>
To: Jakub Kicinski <kuba@xxxxxxxxxx>
To: Paolo Abeni <pabeni@xxxxxxxxxx>
Cc: Florian Fainelli <f.fainelli@xxxxxxxxx>
Cc: netdev@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
---
Nicolai Buchwitz (8):
net: bcmgenet: ring the doorbell when the last frame of a batch is dropped
net: bcmgenet: let the caller decide whether to start the PHY
net: bcmgenet: allow a continuation descriptor without the alignment pad
net: bcmgenet: rename ENET_MAX_MTU_SIZE to ENET_MAX_FRAME_LEN
net: bcmgenet: derive the receive buffer length from the MTU
net: bcmgenet: pad transmit frames out of the packet ready window
net: bcmgenet: allow the MTU to be changed
net: bcmgenet: reassemble jumbo frames from status block fragments
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 368 ++++++++++++++++++++++---
drivers/net/ethernet/broadcom/genet/bcmgenet.h | 21 +-
2 files changed, 342 insertions(+), 47 deletions(-)
---
base-commit: a5e7d8e446af9803e37a3b6a4d416fb41178348f
change-id: 20261002-nb-genet-mtu-nn-v2-402b5e6f306f
Best regards,
--
Nicolai Buchwitz <nb@xxxxxxxxxxx>