🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #27360

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

#27360
From: Nicolai Buchwitz
Date: Sat, 05 Dec 2026 12:08
90 lines
13302 bytes
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@tipi-net.de>
---
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@tipi-net.de

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: netdev@vger.kernel.org

---
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@tipi-net.de>
Technical Details
Message-ID: <20261205-nb-genet-mtu-nn-v2-v11-0-57ae833f16fa@tipi-net.de>
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377965-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377965-linux-kernel-netdev=dewy.ru
From: nb@tipi-net.de (Nicolai Buchwitz)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next v11 0/8] net: bcmgenet: support larger MTUs
Date: Sat, 05 Dec 2026 13:08:42 +0100
Organization: Usenet Network
Message-ID: <20261205-nb-genet-mtu-nn-v2-v11-0-57ae833f16fa@tipi-net.de>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="3021297"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:djKWpw/NPiOIUsCikp6XDT0O3cI= sha256:WkykzuiRnNByFkq/4X0jrXnWY8q15dHbTKuzAiSD1yE=
	sha1:eowGpw1PE+JK8Wbu5vT0pVE2cQo= sha256:uZnRts4i+xFVb1JxvcCXlibCr7Ru9HgKN5ja2fPg/B4=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 48F3D117E0B; Sat,  5 Dec 2026 15:09:26 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.398
X-Spam-Status: No, score=-3.398 tagged_above=-9999 required=6.31
	tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
	HEADER_FROM_DIFFERENT_DOMAINS=0.001, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
	URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=tipi-net.de
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id wYe3IZwB5Y76;
	Sat,  5 Dec 2026 15:09:23 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-377965-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=tipi-net.de
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id F2730117E01; Sat,  5 Dec 2026 15:09:12 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 70AB3296B3; Sat,  5 Dec 2026 12:09:09 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796472544;
	b=22/BDAlQPmkDhiyVdxQchvVzp3ztuxN/s+u1ublFj8NR6aQlWnfV+aY8ww2WfvQg3GGg
	 ScWLr533ePNW+ujwrDPIW9X+k4G4z6srU0fMPbezwYnMsys3xWcI7yNXJyT69GVPX4mTM
	 w1rWDvymlNRvmTD1HknpLdflbyyNwpSIAAEPTBVeJtE98gJLdA+mgeV18OJNK28Cy+vng
	 LkNJdidW2002w7NDNFXClbOLA7tlbsd/00CCbs7NDpfogbhDCV8sFHx4Y1LK+s4lXXbWg
	 DhHQXEpnqnFw8Gv2fSzehRUfUAK+sY5w6hxBWAw52PIRJwhNaExIwCyoOk3XYLjEC5g==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796472544;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:From:
	 Subject:Date:Message-Id:X-Mailing-List:List-Id:List-Post:List-Help:
	 List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Type:Content-Transfer-Encoding:X-B4-Tracking:X-Change-ID:To:
	 Cc:X-Mailer:X-Last-TLS-Session-Version;
	bh=V/1EGRN3Zbw/y5svgzjJMe2DRoUVizQ/2EpmfsXpXWg=;
	b=arcEQirg7N5UFDDjG66Xtxobq7PaId+UhjQF9sh6RYpQUGsolulq79AvIZOJ6jYvfGzh
	 vUsNWmIk7ye1xc3CcF9Gw0eFqyBKVuqCYL+gfsTEoXpaO+XhCWg7L87CfMxjf13zVCnCg
	 h3o1mY8r4PMM+U7znwBTgZgQUw1lg9ul9UKwUvSTVMq0dabAaIKmNWgLeg3ashPtbPaTj
	 H5L23brpsQ5K4S6yanWcKDGAAgPSeM29x3mpOzSnQZEq7N8lVesBhiPJjGBqGyyrAD4xQ
	 2AFmI0uujhSJ9PGFEB5ICw/hSHojoRDemEY15K0KZou4kPtyg42AaAUgLTtSILDMWUQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=clA6fSWa;
	dmarc=none header.from=tipi-net.de;
	spf=pass smtp.mailfrom=tipi-net.de;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 0A8A9606A690;
	Sat,  5 Dec 2026 12:09:04 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=clA6fSWa
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=194.13.80.246
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796472543;
	b=FRgpWZvREKkx+G3h3vkb2L+amCMnByl8UFp3Gtr1ucBd28Gm50yJsSsxeUcirVL1V0fu
	 VoO6LWi48ud8fepmELm+RKwz7bn9ITKd7EO6AfpnqY/h3wO4f8+aUZxe/iKXSrkA0a+ED
	 Wlr3vWD34K0Vtfxu+erma6aNg9t8yS0hqGenTM02sY2zCBNs3ExzhZEDbqDOJYc3t58vE
	 RSZ4qnC+DaxBUX3VHkfkcq+8HlU/3ILPIIXk4ygTtqzwLhflTKXHglv7UghhLdTcP94M+
	 FThNC7SJSPC5biZaaSJrySOnC3eNDGntHvRPRSq1ixTmMVgZ16r7MkOv2smlAATvm+A==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796472543;
	h=DMARC-Filter:Received:DKIM-Signature:From:Subject:Date:Message-Id:
	 MIME-Version:Content-Type:Content-Transfer-Encoding:X-B4-Tracking:
	 X-Change-ID:To:Cc:X-Mailer:X-Last-TLS-Session-Version;
	bh=V/1EGRN3Zbw/y5svgzjJMe2DRoUVizQ/2EpmfsXpXWg=;
	b=VdX/0QXzq7l2K06fg9D6/3taVN1VyqaMFlOfOl54RgUhumu6FCQvDwDFN5rkQS0eEYdY
	 6SXby601fsea767Y82+aHr+4Gd+oJnI4P+GIB2UUmGIdPH2bmuiZjhpHO2rrnOAZnLBCu
	 MvgYUVSnQ82qrt3KNbwPU94xyggoBv44sDlYQH5IZlVqS3TZyoVO/PCAhCsNB9C8GRAb4
	 1EhpEPdBv8R3kwvjyKraoMqe9D+wuT3bvgosRf0oj6sgILtGfqLRgQk4kIuc9UKo/RU44
	 grEeUpj9RpHb8HnvldC2BsObrHKNi8DQ+c3tutAzlI0SGhvcUFrC9yF3+vPnJ19kYgg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=none header.from=tipi-net.de;
	spf=pass smtp.mailfrom=tipi-net.de;
	dkim=pass header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=clA6fSWa;
	arc=none smtp.remote-ip=194.13.80.246
X-Received: from mail.tipi-net.de (mail.tipi-net.de [194.13.80.246])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id A17EC606A322;
	Sat,  5 Dec 2026 12:09:01 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A17EC606A322
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tipi-net.de
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tipi-net.de
X-Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id D830AA1BD7;
	Sat, 05 Dec 2026 13:08:55 +0100 (CET)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tipi-net.de; s=dkim;
	t=1796472538; h=from:subject:date:message-id:to:cc:mime-version:content-type:
	 content-transfer-encoding; bh=V/1EGRN3Zbw/y5svgzjJMe2DRoUVizQ/2EpmfsXpXWg=;
	b=clA6fSWaLuNbcMfxG+kF38YvEG9Wmb2oxi5aZ7ElnqPXI07+t1hmEbxq0W4VCLsG7e8iSa
	AiqgnzloXPOTOqgyH7npsVkVHt9etmF977EdeZ6HWXrl2ILFuk7N5ACS8uaGvM8/uAnOYI
	UGh3pm7bIprokl8cmmDazbXYbvEOSZBLnP5AW9zY0ITNNJ/Vp+NPGCYfLmozIxg0T6EQNI
	xgqn73BLKAb+hknmv+e+8eI/YtEbUnbsAjRK4D9VWW/6jm7lTDUh/tyVq6Fz7e8NXan5LP
	XnAzCfOchMj4XrAG8/eBGpcZVZtba+/zYLkKRXxF6Icuf4Vx7vm8TGgj1cSJMQ==
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-B4-Tracking: v=1; b=H4sIAAAAAAAC/33Ry27DIBAF0F+JWJeK4TGYrvofVRcGhoRFSWS7V
 qoo/17iTalMu+R1uFdzYzNNmWb2crixidY853OpC4CnAwunsRyJ51g3mBQSQQjJi+dHKrTwj+W
 Tl8JXybWQ3hAmJTCx+vAyUcrXTX1jj6uFrgt7ryenPC/n6Wv7boXt/D94BS64wxgwGh080euSL
 7lyy3OkDVxli2AXkRUJ2pMEMOBA7hHVIraLqIpYPVqHQYALnSS6QaBfR1dEkiTl05iGEPaIaRH
 VRUxFhEWPKUgtfCcJ/iAg+ghWBCEaVIAWyewR2yB/1LEV0Wo00QmvpME9MrTI0EWGR5IhWUNjT
 Io603ENIvt13CNJcipSBOe93yMgWqU/YxDbkF2wIejayv5m7vf7N7Z+3K4wAwAA
X-Change-ID: 20261002-nb-genet-mtu-nn-v2-402b5e6f306f
X-Cc: Florian Fainelli <f.fainelli@gmail.com>, 
 Willem de Bruijn <willemb@google.com>, netdev@vger.kernel.org, 
 linux-kernel@vger.kernel.org, 
 Pierre-Marin Leclercq <pierremarinleclercq88@gmail.com>, 
 Dave Stevenson <dave.stevenson@raspberrypi.com>, 
 Justin Chen <justin.chen@broadcom.com>
X-Mailer: b4 0.16.0
X-Last-TLS-Session-Version: TLSv1.3