🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #16065

[PATCH net v3 0/7] net: bcm4908_enet: TX ring and DMA fixes

#16065
From: Kordian Chmielewski
Date: Fri, 13 Nov 2026 23:58
70 lines
14196 bytes
These fix the BCM4908 Ethernet driver. Patch 1 fixes a TX stall seen
on a TP-Link Archer AX6000 under sustained load. Patches 2 to 7 come
from reading the code and from review, and have no reproducer.

Tested on an Archer AX6000 with OpenWrt and Linux 6.18.55, whose driver
differs from net only in one tree-wide change, with the LAN going
through this driver: TX and RX at line rate (941 Mbit/s TCP), and four
ifdown/ifup cycles of the conduit while it was sending. I ran the same
again, plus a UDP stream at 1 Gbit/s (944 Mbit/s received), with the TX
ring shrunk to 16 descriptors for the test, so that the queue was
stopped and woken over and over (about a million qdisc requeues in a
minute, with the ring full or nearly full in a third of the one-second
samples). No stall, no errors in the counters, no DMA timeout warnings.

Sashiko's review of v2 also pointed at older problems that this series
doesn't fix: open() ignores a failure to fill the RX ring, and fills
it with napi_alloc_frag() from process context; a failed RX refill
loses the old buffer; and the driver does not work without its
optional TX interrupt. I'll send fixes for those after this series.
It also found that a TX completion reported before start_xmit()
publishes write_idx can be missed; patch 7 narrows that window, and
I'll look into closing it.

Changes in v3:
- patch 3: leave the TX ring empty after freeing it, so that a failed
  open() cannot lead to the same skbs being freed again; wait for the
  TX channel with read_poll_timeout(), as a 2 ms deadline in jiffies
  can expire after one poll; leave the skbs alone if the channel does
  not stop (Sashiko)
- new patch 7: order the TX ring index accesses between start_xmit()
  and poll_tx(), and publish write_idx before the DMA kick (Sashiko)
- add Florian's Reviewed-by to patches 1, 2 and 4 to 6, not to patch 3,
  which changed

Changes in v2:
- patch 1: stop and wake the queue with the netdev_queues.h helpers,
  also when start_xmit() finds the ring full on entry; the changelog
  also names the slot that poll_tx() completed without a frame
- patch 3: wait for the TX DMA channel to stop before freeing its
  buffers; free only between read_idx and write_idx instead of
  clearing slot->skb in poll_tx(); drop the OWN check that could stop
  the queue for good; fix the RX timeout warning; the changelog
  describes leaks and stale frames, not a use-after-free
- patch 6: the comment and changelog no longer say where the DMA waits
- patches 1 and 2: more exact changelogs (the measured rate and what
  stopped; what driver.rst says about NETDEV_TX_BUSY)
- drop v1 patch 7 (RX frames longer than the buffer): its trigger is
  not reachable with the driver's own settings
- wrap lines over 80 columns; author name without the nickname

v2: https://lore.kernel.org/netdev/20261112195051.597102-1-kudzo51@gmail.com/
v1: https://lore.kernel.org/netdev/20261109235700.2586821-1-kudzo51@gmail.com/

Kordian Chmielewski (7):
  net: bcm4908_enet: fix the TX ring wrap
  net: bcm4908_enet: drop a TX frame whose DMA mapping failed
  net: bcm4908_enet: release the TX ring on stop
  net: bcm4908_enet: unmap the buffer of a dropped RX frame
  net: bcm4908_enet: unmap RX buffers on stop with their mapped size
  net: bcm4908_enet: publish the buffer address before OWN
  net: bcm4908_enet: order the TX ring index accesses

 drivers/net/ethernet/broadcom/bcm4908_enet.c | 143 ++++++++++++++-----
 1 file changed, 107 insertions(+), 36 deletions(-)


base-commit: 86706ffa990ecd46a4326f8eecbccbbd60a6cb8d
-- 
2.56.1
Technical Details
Message-ID: <20261113235847.517308-1-kudzo51@gmail.com>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-362992-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-362992-linux-kernel-netdev=dewy.ru
From: kudzo51@gmail.com (Kordian Chmielewski)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net v3 0/7] net: bcm4908_enet: TX ring and DMA fixes
Date: Sat, 14 Nov 2026 00:58:40 +0100
Organization: Usenet Network
Message-ID: <20261113235847.517308-1-kudzo51@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1470904"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:IcDzeEp/2fmrwjep+mKdLevvPDc= sha256:XCTXBSkQlY/VcnsUObUSajmD6jlXo0qQ55uUUKQk4cs=
	sha1:Qmorq1HNFWufHYO/3w4l4lXOlNA= sha256:5C8dJoO4RZKhm7hL4kMFil/9JUQdeEifpK6Xqk8rl7U=
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 18CA41146F3; Sat, 14 Nov 2026 02:59:18 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.149
X-Spam-Status: No, score=-3.149 tagged_above=-9999 required=6.31
	tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
	FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001,
	HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=gmail.com
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 OCn2RJB7yTNn;
	Sat, 14 Nov 2026 02:59:14 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-362992-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 496F911460C; Sat, 14 Nov 2026 02:59:06 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id CA31D61E135; Fri, 13 Nov 2026 23:59:02 +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=1794614340;
	b=viTI/2IR0cFllzrGDAIc9QCks9aFEmkQTaTr3AGJW3j71e9Mx3+v6pMl7jwJNmCttx/6
	 Z+phrHX9U5UfuVxBeLZ2OyNNq5PZxknRlBkWbdpmB2TuQzUZeo29x7ULhNlH87Tu4vn8X
	 hQH+qxXzrfpFf1hkE2FskZpUGDENWNfJMJcJNi7mgukOt73tRHcKt3F5OQBUocPhA6hCg
	 P4WD7cBKksdy9Oam1TPsSBAHrZq7mwJ+doaD2Rkypww2wmocxN/AIQl+/zLoKdmReRTR0
	 Yhfa04lYvOAQkPTkhMRPJKx7weN6N96EYQmA5gKRv9vWCrzC0VmLt4jeRj6tQZaTbeQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794614340;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
	 Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:X-Mailing-List:
	 List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
	 List-Owner:Precedence:MIME-Version:Content-Transfer-Encoding;
	bh=P94FGP68ZZgSuMQ+raENon5xMjnwilC1ilibSCmAWWY=;
	b=IHrU5pUQcNpEkIbdf0IMhARHQFKTtUsDzvlxOEatsfrdDmAUdk1v4eGOqhj/ecLw5zRm
	 ybhZ51iK/whYeQocE7ALFo52FHaID1Ve3kpPmRTo8LsCtYWUUIqQXldCrq9A/e+PjkWtv
	 +zP5rYXieleLe7COPuBAvU6mIn8NqrhWbRAgWhEv0puqgu9H2TQxITzWpPgw5fjqEN4yf
	 CbDEH+2xyhzB91Pv9ooj3RLH24WL2yhKdOBeWvAvUoy1+pSO3YPMvtk2lQQRLhdDXbHEU
	 hF0ZjHIJkRU+zbnbhernFUETT5gmSa8+FkaSVl6a8hNHP2UenhqDknzgQqJYOl3bEHw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=QDCi725j;
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	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 0A23560A2601;
	Fri, 13 Nov 2026 23:59:00 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=QDCi725j
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.218.43
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794614339;
	b=B4g/jHJETkYWNCGM4URtME/UyFWWX2Q4FLRTBR9wdz8LUVI+8d4jGnGpq6HU0O0PYmEf
	 EoJ0PT2JdypKID/6tEqjWhc8jf5zZRNR6nGEHi+Vqi2xYheu9gGvRz/Wg5+x1nAnWPRM9
	 wBZQrT525UhJ8xr0tRWo0Uv8ybpn1G0ojJxRMKpsDQqMWDqlpqo0RTn3gnWdq70M3QgFS
	 D/6R0sGZuw+df6P+mcjdVL1cmz1/kWgY/+C79MaORc0WQsffc3890mi51cWhvauAL8u+y
	 uHqnybEGT7Oxx5xMNjLU4vDV1F5LQKgM+MmOW6QIr9mJ+IDgPVVRnbMEcOQcj1Fm59w==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794614339;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:
	 Date:Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding;
	bh=P94FGP68ZZgSuMQ+raENon5xMjnwilC1ilibSCmAWWY=;
	b=R1y0kylproXlV284Jo6Z8JXqr4xBCsYFOE36hV9d91hNUENv6MrvqHj/yngNDNsQnKa0
	 YQl5qJXmB+TDQ7PQAlJbj6uEOlS3Sf6mnYSh69qUw51DLuG0KDuQDD1zmQNBwVZ2Z2nNM
	 eLfd2KCXbnfoSwRCauTjhTT1xEFpY4aZghVDp10YgkVjKRS/A/zzA9DScI/URAYIwQLDn
	 XsmO1PSroB7tyeROAM0D3OYWO2gxVKhnbgi0pWJErAYYcEkSoml4ZbP6Me/XyFEjAnM55
	 IdMELEf98grrvi43961HGYIDi2iDInN8wgvoDvBmwsbt+St5/E7IgylJLywHHmtVgyQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=QDCi725j;
	arc=none smtp.remote-ip=209.85.218.43
X-Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 52C26606A89D
	for <netdev@vger.kernel.org>; Fri, 13 Nov 2026 23:58:57 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 52C26606A89D
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-c4cac7a7d3cso251221466b.3
        for <netdev@vger.kernel.org>; Fri, 13 Nov 2026 15:58:57 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1794614335; x=1795219135; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=P94FGP68ZZgSuMQ+raENon5xMjnwilC1ilibSCmAWWY=;
        b=QDCi725jAY8cUue0RnUbX3KnWcAY3EZb1Nom1G9NjTRENmxjOL8Oomd7F8M2P/T8jN
         KoP+vT5zGC8VZJSHeiTdB3gK4rxTHih+R9D947GTbBXkZnFzUnfjWrDZWQVz+ZHStQH3
         UCQnyGpFWRZpWiW+GBkrHzF/M7WdDyQirkObeQJR5ekS7ZwjMz8qi/N21xe6Se6hGHl5
         X0NyVtTPaXTv9DL+Uh1go1EezC04K/AdJjGVp6Vmt4M6ghskrEx/gMJyTJotVxhf9Oey
         AZx5H1CfA9X0KJzivbSR7UH6PO92f2y/y9VArCotuWL1Gm50gA2RBWaqJrjeC6+IwOqk
         h/vw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1794614335; x=1795219135;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=P94FGP68ZZgSuMQ+raENon5xMjnwilC1ilibSCmAWWY=;
        b=C2HdYjUndL1YBM1XqV7NvXP7hh9OwyuBxjJx0pGZ9G7yUTV0oaX2JRDeuyyZzvSNPx
         zsI4hXpvyquXC8OF6CiGLq6du+CEMbB3JAh1ibt6w3qTSn48P7S36T1yeFJC5cMCoLuD
         e0XBuNPRcHsEHrfp0YbHpPKGEPOFBmr1fQUAAPu93WbyM3D4uMDmiF9iMFebDbHdpO/9
         FKBElOTCZKagtbxA5sItx+oZhYisASOTGh152EDF3uyREJTrsywPLoHmB1hrZXkeBiSV
         ZnOWWsea6iSApbG3aeIPucNhJpbQaBV+41X8sCuvzlQFTaytrhuzBYYApA4t0CSih9qO
         v6og==
X-Gm-Message-State: APuU4Z9nBGW9Qd1TbSIYKhiecDOCslb7FWz78bmyYXRBz8Tb09iUqkG5
	JxqTk1oHnDUmCheRjf3/U1zLMXbi9sbXW+mUX3O5eaLKJhM2yYLz5HUs4gqmd7Jd
X-Gm-Gg: AYBFou13PFnSr9b97z61z2JOsVukytGTNQw0plDMmBORDUXlbZza2830YEz3RvQFBnw
	XKa8KReTXs5JXo2lfS77d9H18uslDn0p7UircmTIp6QXL4+m4L4NLZsOMwiY9Q2gwM01Qv3vByr
	AJJzJyqivS2Gq0mtk43kguEuuu0BNoRs1YZbBfy1NUpcsKPmLLf4rUIj+r/Q13eWYCZRtkH+g5e
	uua/sOZEzvWLlZ9C6D9DMMwRnSPIcvqeXa5lI81WcxDC9P57HJ9NO3PYuEQtYt20rSNAcLuWo6z
	0/YvD/UyJIzlVs6LBAjfgwNCp9Jljs1URgAXvFO6V1N4CvfoaL/KalNRS1DgSpC1Oj4Fdu9ez+n
	doP28bT3G1nJIo/5Med1oeIVOjZ1xiXpWkQ8CEAbbVeor+lCGn+YGk7uLyY5+B7yyyzH4q64kBR
	zhDemwN7kgeGLokN505rAZkgFAF0j27b3FY/N3WkvLHv/NsBYQMVnhylhXVQkNOKOE4UUAghXeq
	bavtEwo5ATtdi1WLMfJDxfaMbG8w7NUQcJN71hogB3oNmYcA4mKWvxxSRpJ3oDqb6rFYLQEQvko
	YcKTqgiHJRRCIse7KcXpRj1uy+sjwtEuA5W5eyAH
X-Received: by 2002:a17:906:4fc5:b0:c2d:c739:30e1 with SMTP id a640c23a62f3a-c509643c050mr381566766b.32.1794614335551;
        Fri, 13 Nov 2026 15:58:55 -0800 (PST)
X-Received: from kordpc.lan ([2a13:e746:396c:c600::8f9])
        by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c5095b3dbaesm153454266b.32.2026.11.13.15.58.54
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Fri, 13 Nov 2026 15:58:55 -0800 (PST)
X-Cc: Florian Fainelli <f.fainelli@gmail.com>,
	Florian Fainelli <florian.fainelli@broadcom.com>,
	Rafał Miłecki <rafal@milecki.pl>,
	bcm-kernel-feedback-list@broadcom.com,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	linux-kernel@vger.kernel.org
X-Mailer: git-send-email 2.56.1
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