Re: [PATCH net-next v7 2/3] net: macb: implement ethtool_ops.get|set_channels()
From: Nicolai Buchwitz
Date: Thu Nov 19 2026 - 06:54:25 EST
Hi Théo
On 18.11.2026 21:53, Théo Lebrun wrote:
[...]
@@ -3376,7 +3398,7 @@ static void macb_context_swap_start(struct macb *bp)
[...]
+ if (new_ctx) {
+ old_ctx = bp->ctx;
+ WRITE_ONCE(bp->ctx, new_ctx);
+ wmb(); /* ensure IRQ enabled below read the new context */
+
+ macb_init_buffers(bp);
+
+ /* Clear DQL (only on successful context swap). */
+ for (q = 0; q < bp->ctx->num_queues; ++q)
+ netdev_tx_reset_queue(netdev_get_tx_queue(bp->netdev,
+ q));
+ }
The queues we just dropped never get their BQL reset, not on close or
open either. So after shrinking and growing again they can stay stuck.
Maybe just reset all max_num_queues here and in macb_close()?
[...]
+static int macb_set_channels(struct net_device *netdev,
[...]
+ ret = netif_set_real_num_queues(bp->netdev, num_queues, num_queues);
+ if (ret) {
+ if (running) {
+ macb_free(new_ctx);
+ kfree(new_ctx);
+ macb_context_swap_end(bp, NULL);
swap_start() cleared TE, so HW is back at the ring start. Doesn't this
needs a gem_shuffle_tx_rings() like link_up does, otherwise Tx stalls?
[...]
Regards,
Nicolai