mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net v2 0/2] net: bcmgenet: fix tx stalls on 32 descriptor rings
@ 2026-11-09 21:53 Nicolai Buchwitz
  2026-11-09 21:53 ` [PATCH net v2 1/2] net: bcmgenet: cap the Tx queue threshold at the ring size Nicolai Buchwitz
  2026-11-09 21:53 ` [PATCH net v2 2/2] net: bcmgenet: flatten frames that cannot fit the ring Nicolai Buchwitz
  0 siblings, 2 replies; 4+ messages in thread
From: Nicolai Buchwitz @ 2026-11-09 21:53 UTC (permalink / raw)
  To: Doug Berger, Florian Fainelli, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: Justin Chen, Broadcom internal kernel review list,
	Nikolay Aleksandrov, Jason Xing, netdev, linux-kernel,
	Nicolai Buchwitz

Found this while fixing the clashiko findings on v6 of my MTU series. After
those fixes this bug would be easier to hit. At the moment it needs a larger
CONFIG_MAX_SKB_FRAGS than the default.

Queues 1 to 4 hold 32 descriptors, which is less than the Tx path assumes
in two places with CONFIG_MAX_SKB_FRAGS >= 31.

The wake threshold wants MAX_SKB_FRAGS + 1 free descriptors, which is not
possible on these rings. Therefore the queue stops on the first packet
without any recovery.

Same situation for the admission check, which wants one descriptor more than
the frame needs. As a result a 31 fragment frame is refused, even if the
ring is empty.

Patch 1 caps the threshold, patch 2 flattens those frames.

Patch 1 was tested on a Raspberry Pi CM4 (BCM2711, genet v5). The 31 fragment
case was flagged by Clashiko in v1 and seems reasonable.

Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
---
Changes in v2:
- New patch 2 for the admission check (clashiko)
- Link to v1: https://patch.msgid.link/20261106-nb-genet-txq-thld-net-v1-1-53bbac647b71@tipi-net.de

Patch 2 could also clear NETIF_F_SG in ndo_features_check like bnge does. I
kept it in xmit because the limit is the ring size.

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>
To: Nikolay Aleksandrov <razor@blackwall.org>
To: Jason Xing <kerneljasonxing@gmail.com>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org

---
Nicolai Buchwitz (2):
      net: bcmgenet: cap the Tx queue threshold at the ring size
      net: bcmgenet: flatten frames that cannot fit the ring

 drivers/net/ethernet/broadcom/genet/bcmgenet.c | 22 ++++++++++++++++++++--
 drivers/net/ethernet/broadcom/genet/bcmgenet.h |  1 +
 2 files changed, 21 insertions(+), 2 deletions(-)
---
base-commit: 1d5e2c57e9ffc134e14b3f837c8d7c53b508bd22
change-id: 20261106-nb-genet-txq-thld-net-e0864f235d22

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


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

end of thread, other threads:[~2026-11-09 22:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-09 21:53 [PATCH net v2 0/2] net: bcmgenet: fix tx stalls on 32 descriptor rings Nicolai Buchwitz
2026-11-09 21:53 ` [PATCH net v2 1/2] net: bcmgenet: cap the Tx queue threshold at the ring size Nicolai Buchwitz
2026-11-09 21:53 ` [PATCH net v2 2/2] net: bcmgenet: flatten frames that cannot fit the ring Nicolai Buchwitz
2026-11-09 22:14   ` Florian Fainelli

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

all inboxes | Powered by JetHome®