🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #2205

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

#2205
From: Nicolai Buchwitz
Date: Mon, 12 Oct 2026 09:00
89 lines
10296 bytes
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>
Technical Details
Message-ID: <20261012-nb-genet-mtu-nn-v2-v4-0-2e2e3bfaf8cc@tipi-net.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-344830-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-344830-linux-kernel-netdev=dewy.ru
From: nb@tipi-net.de (Nicolai Buchwitz)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next v4 0/8] net: bcmgenet: support larger MTUs
Date: Mon, 12 Oct 2026 11:00:36 +0200
Organization: Usenet Network
Message-ID: <20261012-nb-genet-mtu-nn-v2-v4-0-2e2e3bfaf8cc@tipi-net.de>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="1725456"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:Ni/9GL7+0WDlj8arayTVaK7FvYY= sha256:1Vl9QBVqrbtYf2FPnqML7WqE+DjaGHTUzYh0X/fDdEI=
	sha1:MNzkHVdZ3O/7OFQMJmyeacSIWnk= sha256:1jvfE2z8oo8NVUNwxgy5J4SK1c3KdmRBbqIUV0AUqKY=
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 4114710FB50; Mon, 12 Oct 2026 12:03:15 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -0.75
X-Spam-Status: No, score=-0.75 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, 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 s-SpyQhDlSP1;
	Mon, 12 Oct 2026 12:03:11 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-344830-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 775A710FB4C; Mon, 12 Oct 2026 12:03:03 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by tor.lore.kernel.org (Postfix) with ESMTP id 9792F25E7D; Mon, 12 Oct 2026 09:01:16 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 1BF614718FF;
	Mon, 12 Oct 2026 09:01:00 +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.b="mePL8F1C"
X-Received: from mail.tipi-net.de (mail.tipi-net.de [194.13.80.246])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id EE48832B9B5;
	Mon, 12 Oct 2026 09:00:54 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=194.13.80.246
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1791795660; cv=none; b=lwqHVkdGe4E3EfFQjpSFGoyu8kvCxSLdICg3pAGtqo4iSw18XmTu+TzKOQJcEh3gQpfG2fYwcIId8Iagi+8FZpgqMC2vi7U+NRXNiACSTwvAi0oROPdvdRvKoK3Oe5OB+a3jQmH7VVKSbw8PnjUgmX0/WKhO9RXjjbit3//PVZY=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1791795660; c=relaxed/simple;
	bh=KwApZnptsQ3SXL8oofq9r5DsuWIJ6Ywj4PYB6mA9RMY=;
	h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=b0EJ0L+8qcwniYePtLD1c7MndQoLOJJYRRGSg6Q55bruqsYMq+DYA1bRVa/J/VQY6pkP8r9mLVOaJXDx2HEOJu2ahGt6cDFEQ3ymm40RfnHsV+sTo3hlVNen2NH5bVzxzVrKxBlsAbvFeOVyGopAOAPj7s4GBybsZDXXvXbzEcg=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tipi-net.de; spf=pass smtp.mailfrom=tipi-net.de; dkim=pass (2048-bit key) header.d=tipi-net.de header.i=@tipi-net.de header.b=mePL8F1C; arc=none smtp.client-ip=194.13.80.246
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 456F8A0E33;
	Mon, 12 Oct 2026 11:00:46 +0200 (CEST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tipi-net.de; s=dkim;
	t=1791795651; h=from:subject:date:message-id:to:cc:mime-version:content-type:
	 content-transfer-encoding; bh=gfXxUCrcFGKlWkjsjE/A84ByGDsS1C5NauM3gkTg+7c=;
	b=mePL8F1CMltRrHFcTI0R7uugohgKukbPnxqNqKG1iSAMLi4L5gDfjpgUO5eM4F9tXN8VTZ
	RJACB+7ijoJSsH7zw0kho1Y8wtWFAQLuy8Xv4w3L5SLstybasTlCPFKoiNI80CAzSse+p1
	DmgdSX78SRpk9UkUtTzhcf1i0yOOmk5FP62BmGr5J/bBRaqWHNkEpaiBbB7cgI2VCTE4EM
	4FFNGBcVu6Q9AX4IWZ2HZUDgtKsi1MPV74o5BMyOMMTByH9BzHJZO/9votK2vveiNHmPKJ
	0AQedZbdyBjWvhiLyJkvpPXPTvMdLdF5GL9tu4rlaXEozaiJ/tvPLI4Toys82g==
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-B4-Tracking: v=1; b=H4sIAAAAAAAC/33OwQ6CMAwG4FchO1uzlTEyT76H8cBGgR0cBOaCI
 by7kxNR4vHP337twiYaHU3ski1spOgm1/sU5Cljtqt8S+DqlBlyVIJzBG+gJU8BHuEJ3kNEkBx
 NQarJuWpYWhxGaty8oTf2GfU0B3ZPTeem0I+v7VoUW/8PjgI4aFVbVRfSGqJrcINLXDjXtIER9
 4g6RDAhVhpCIQqhBf4i+R4pD5E8IaWsSq0sF9p+fbKu6xtc/GoySgEAAA==
X-Change-ID: 20261002-nb-genet-mtu-nn-v2-402b5e6f306f
X-Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, 
 Dave Stevenson <dave.stevenson@raspberrypi.com>, 
 Justin Chen <justin.chen@broadcom.com>, 
 Pierre-Marin Leclercq <pierremarinleclercq88@gmail.com>, 
 Nicolai Buchwitz <nb@tipi-net.de>, Florian Fainelli <f.fainelli@gmail.com>
X-Mailer: b4 0.16.0
X-Last-TLS-Session-Version: TLSv1.3