πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
3 messages
3 total messages Started by Nicolai Buchwitz Mon, 09 Nov 2026 12:57
[PATCH 6.18.y] net: macb: wait for a running xmit before resetting BQL on close
#13183
Author: Nicolai Buchwitz
Date: Mon, 09 Nov 2026 12:57
57 lines
10759 bytes
macb_close() stops the queues without waiting for an xmit still
running on another CPU. That frame charges BQL after the reset and
never completes, so after the reopen the queue stays stopped with an
empty ring and the watchdog fires until the next close.

Seen on a Raspberry Pi CM5 with ethtool -G under load.

Upstream fixed this as part of the context swap rework in commit
dcc3288b9433a ("net: macb: use context swapping in .set_ringparam()"),
which is too large for stable.

Fixes: e6a532185daa ("net: cadence: macb: Implement BQL")
Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
---
Fixes a close race in 6.18.y and 7.3.y. Older LTS kernels have no BQL
in macb and 7.4 has the fix through ThΓ©o's context swap series, so let's
keep the fix small instead of pulling that whole series in.

The stall was observed on a Raspberry Pi CM5 (2/30 close/open cycles under
load stalled), so it is worth fixing.
---
 drivers/net/ethernet/cadence/macb_main.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index 1eaf9be483153..422dd167187da 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -3156,14 +3156,16 @@ static int macb_close(struct net_device *dev)
 	unsigned long flags;
 	unsigned int q;
 
-	netif_tx_stop_all_queues(dev);
-
 	for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue) {
 		napi_disable(&queue->napi_rx);
 		napi_disable(&queue->napi_tx);
-		netdev_tx_reset_queue(netdev_get_tx_queue(dev, q));
 	}
 
+	netif_tx_disable(dev);
+
+	for (q = 0; q < bp->num_queues; ++q)
+		netdev_tx_reset_queue(netdev_get_tx_queue(dev, q));
+
 	phylink_stop(bp->phylink);
 	phylink_disconnect_phy(bp->phylink);
 

---
base-commit: c3f63d70f236bb7685e6d11d1d9b5b351552e600
change-id: 20261109-nb-macb-close-6-18-y-126903425567

Best regards,
--  
Nicolai Buchwitz <nb@tipi-net.de>
Re: [PATCH 6.18.y] net: macb: wait for a running xmit before resetting BQL on close
#13246
Author: Greg Kroah-Hartman
Date: Mon, 09 Nov 2026 14:10
18 lines
8519 bytes
On Mon, Nov 09, 2026 at 01:57:09PM +0100, Nicolai Buchwitz wrote:
> macb_close() stops the queues without waiting for an xmit still
> running on another CPU. That frame charges BQL after the reset and
> never completes, so after the reopen the queue stays stopped with an
> empty ring and the watchdog fires until the next close.
> 
> Seen on a Raspberry Pi CM5 with ethtool -G under load.
> 
> Upstream fixed this as part of the context swap rework in commit
> dcc3288b9433a ("net: macb: use context swapping in .set_ringparam()"),
> which is too large for stable.

Why is that too large?  Please backport that instead.

thanks,

greg k-h
Re: [PATCH 6.18.y] net: macb: wait for a running xmit before resetting BQL on close
#13247
Author: Nicolai Buchwitz
Date: Mon, 09 Nov 2026 14:24
15 lines
8968 bytes
Hi Greg

On 9.11.2026 15:10, Greg Kroah-Hartman wrote:
> 
> Why is that too large?  Please backport that instead.

Context swapping was a rather large change (+822 / -439 LOC) - if this 
is
considered ok for stable backport, I will send the patches.

> [...]

Thanks,
Nicolai
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads