Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next v4 0/8] net: bcmgenet: support larger MTUs
@ 2026-10-12  9:00 Nicolai Buchwitz
  2026-10-12  9:00 ` [PATCH net-next v4 1/8] net: bcmgenet: ring the doorbell when the last frame of a batch is dropped Nicolai Buchwitz
                   ` (7 more replies)
  0 siblings, 8 replies; 17+ messages in thread
From: Nicolai Buchwitz @ 2026-10-12  9:00 UTC (permalink / raw)
  To: Doug Berger, Florian Fainelli,
	Broadcom internal kernel review list, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: netdev, linux-kernel, Dave Stevenson, Justin Chen,
	Pierre-Marin Leclercq, Nicolai Buchwitz, Florian Fainelli

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 three 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@tipi-net.de>
---
Changes in v4:
- patch 5:
  - floor UMAC_MAX_FRAME_LEN and the flow period at ETH_DATA_LEN, a lower
    MTU narrowed what the MAC accepts (clashiko)
  - move the TBUF threshold write to patch 6, where the padding needs it
- patch 6:
  - keep the transmit threshold at its reset value up to ETH_DATA_LEN, v3
    raised it on every system at the default MTU
  - unshare the skb before padding or checksumming, ether_setup() leaves
    IFF_TX_SKB_SHARING set
  - note the threshold goes by skb->len and the window is reachable only
    later in the series (clashiko)
- patch 7:
  - skip the restart when both MTUs derive the same values
  - clear datapath_up on the suspend teardown (clashiko)
  - unwind only the Rx NAPI instances a failed ring init added, the retry
    would otherwise re-add a listed NAPI (sashiko)
  - note the one descriptor limit is lifted later in the series (clashiko)
- patch 8:
  - count a reassembled frame once for DIM, not per descriptor
  - require a continuation descriptor to carry payload
  - give the measured TX descriptor length
  - note the checksum fallback is on transmit

To: Doug Berger <opendmb@gmail.com>
To: Florian Fainelli <florian.fainelli@broadcom.com>
To: Nicolai Buchwitz <nb@tipi-net.de>
To: Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
To: Andrew Lunn <andrew+netdev@lunn.ch>
To: "David S. Miller" <davem@davemloft.net>
To: Eric Dumazet <edumazet@kernel.org>
To: Jakub Kicinski <kuba@kernel.org>
To: Paolo Abeni <pabeni@redhat.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
v3: https://patch.msgid.link/20261007-nb-genet-mtu-nn-v2-v3-0-74a796c019ce@tipi-net.de
v2: https://patch.msgid.link/20261006-nb-genet-mtu-nn-v2-v2-0-c4be21151912@tipi-net.de
v1: https://patch.msgid.link/20261002-nb-genet-mtu-nn-v2-v1-0-96dc6d54cbee@tipi-net.de

---
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 | 405 ++++++++++++++++++++++---
 drivers/net/ethernet/broadcom/genet/bcmgenet.h |  25 +-
 2 files changed, 381 insertions(+), 49 deletions(-)
---
base-commit: d8674294aefef02266c4d47ad10131f1bffbe534
change-id: 20261002-nb-genet-mtu-nn-v2-402b5e6f306f

Best regards,
--  
Nicolai Buchwitz <nb@tipi-net.de>


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2026-10-13  9:19 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-12  9:00 [PATCH net-next v4 0/8] net: bcmgenet: support larger MTUs Nicolai Buchwitz
2026-10-12  9:00 ` [PATCH net-next v4 1/8] net: bcmgenet: ring the doorbell when the last frame of a batch is dropped Nicolai Buchwitz
2026-10-12 21:29   ` Florian Fainelli
2026-10-12  9:00 ` [PATCH net-next v4 2/8] net: bcmgenet: let the caller decide whether to start the PHY Nicolai Buchwitz
2026-10-12  9:00 ` [PATCH net-next v4 3/8] net: bcmgenet: allow a continuation descriptor without the alignment pad Nicolai Buchwitz
2026-10-13  9:19   ` netdev-bot+sashiko
2026-10-12  9:00 ` [PATCH net-next v4 4/8] net: bcmgenet: rename ENET_MAX_MTU_SIZE to ENET_MAX_FRAME_LEN Nicolai Buchwitz
2026-10-12  9:00 ` [PATCH net-next v4 5/8] net: bcmgenet: derive the receive buffer length from the MTU Nicolai Buchwitz
2026-10-12 21:45   ` Florian Fainelli
2026-10-12  9:00 ` [PATCH net-next v4 6/8] net: bcmgenet: pad transmit frames out of the packet ready window Nicolai Buchwitz
2026-10-12 21:48   ` Florian Fainelli
2026-10-13  9:19   ` netdev-bot+sashiko
2026-10-12  9:00 ` [PATCH net-next v4 7/8] net: bcmgenet: allow the MTU to be changed Nicolai Buchwitz
2026-10-12 21:38   ` Florian Fainelli
2026-10-13  9:19   ` netdev-bot+sashiko
2026-10-12  9:00 ` [PATCH net-next v4 8/8] net: bcmgenet: reassemble jumbo frames from status block fragments Nicolai Buchwitz
2026-10-12 21:49   ` Florian Fainelli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox