[PATCH net-next v11 0/8] net: bcmgenet: support larger MTUs

From: Nicolai Buchwitz

Date: Sat Dec 05 2026 - 07:09:17 EST


This is v11 of my genet series which adds larger MTU / jumbo packet support.

Larger MTU aka. jumbo frames are requested often by Raspberry Pi users, but
the hardware has its quirks with larger frames. Dave Stevenson's PoC [1] had
the receive side working, and thanks to Justin, who checked the RTL for what
the hardware does with long frames, I could add the missing puzzle pieces.

GENET never sets dev->max_mtu and the packet ready thresholds stay at their
2048 byte reset default, so long frames were dropped on receive and never
sent on transmit.

Patches 1 to 4 prepare the driver, patch 7 sets the MTU, as far as one
descriptor reaches (3564 bytes with 4K pages). Patch 8 reassembles what the
hardware hands up above that, which gets the ceiling to 16347 [2]. Patch 5
splits transmit frames at the packet ready threshold, so none can end just
past it and stop the transmitter [3]. Patch 6 builds the new rings before
dropping the old ones, so a failed allocation leaves the interface alone.

Only v5 gets the larger MTU, and only a v5 gets the packet ready thresholds
programmed at all. The TBUF sizing, the transmit length width and the reset
values on v2 to v4 are unconfirmed, so those parts keep the default and the
driver leaves their registers alone until someone with the hardware or the
RTL can say.

Patch 5 cuts every transmit frame longer than the threshold in two, so none
can end in the window that stops the transmitter. The split costs one
descriptor, which patch 5 adds to the two limits that 1e09af397bc7 and
fbfd7cfd2019 put on the 32 descriptor rings, so the queue stops one
descriptor earlier and a frame is flattened one fragment sooner. At the
default MTU no frame reaches the threshold.

Tested on a Raspberry Pi CM4 (GENET v5), peer at the same MTU:
- MTU 1500: iperf3 TCP 940 Mbit/s, unchanged
- MTU 9000: iperf3 TCP 990/989 Mbit/s, UDP 993 Mbit/s, 0 of 110960 lost
- 17 MTU changes between 1500 and 16347 under a ping flood, carrier up and
the flood unbroken
- 118 transmit lengths, from just below the threshold to 5 kB past it, each
followed by a short frame, no stall and Tx DMA still halts afterwards
- UDP at line rate with 8000, 3900 and 100 byte datagrams, no loss
- 123 raw frame lengths across every receive descriptor boundary, byte exact
- the same with CONFIG_DMA_API_DEBUG over 2 GB of split frames each way, no
error and no leaked mapping

Pierre-Marin Leclercq tested v5 on a Raspberry Pi 4.

[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 v11:
- Patch 4 and 5: program the packet ready thresholds only on v5 (Willem)
- Patch 5: split every frame longer than the transmit threshold (Willem)
- Rebased on net-next
- Link to v10: https://patch.msgid.link/20261127-nb-genet-mtu-nn-v2-v10-0-749c7cc45d97@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: netdev@xxxxxxxxxxxxxxx

---
Nicolai Buchwitz (8):
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: split transmit frames at the packet ready threshold
net: bcmgenet: build the DMA rings before giving up the running ones
net: bcmgenet: allow the MTU to be changed
net: bcmgenet: reassemble jumbo frames from status block fragments

drivers/net/ethernet/broadcom/genet/bcmgenet.c | 784 +++++++++++++++++++------
drivers/net/ethernet/broadcom/genet/bcmgenet.h | 37 +-
2 files changed, 637 insertions(+), 184 deletions(-)
---
base-commit: d5cf954cebe4f175dfd834e1dc471a3aa203ec7d
change-id: 20261002-nb-genet-mtu-nn-v2-402b5e6f306f

Best regards,
--
Nicolai Buchwitz <nb@xxxxxxxxxxx>