From: "Théo Lebrun" <theo.lebrun@bootlin.com>
To: "Nicolai Buchwitz" <nb@tipi-net.de>
Cc: "Conor Dooley" <conor.dooley@microchip.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>,
"Russell King" <linux@armlinux.org.uk>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
"Paolo Valerio" <pvalerio@redhat.com>,
"Vladimir Kondratiev" <vladimir.kondratiev@mobileye.com>,
"Gregory CLEMENT" <gregory.clement@bootlin.com>,
"Benoît Monin" <benoit.monin@bootlin.com>,
"Tawfik Bayouk" <tawfik.bayouk@mobileye.com>,
"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>
Subject: Re: [PATCH net-next v7 2/3] net: macb: implement ethtool_ops.get|set_channels()
Date: Thu, 19 Nov 2026 17:19:57 +0100 [thread overview]
Message-ID: <DMZBON30TWI8.1KLN28QJP6TNN@bootlin.com> (raw)
In-Reply-To: <cc50263bc4f161b2fff96e04306868cc@tipi-net.de>
On Thu Nov 19, 2026 at 12:54 PM CET, Nicolai Buchwitz wrote:
> On 18.11.2026 21:53, Théo Lebrun wrote:
>> + 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.
Good catch.
> Maybe just reset all max_num_queues here and in macb_close()?
That's the safe solution, agreed.
>> + 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?
Argh! I had missed (or forgotten) this implicit behavior when clearing
the TE bit of NCR. Yes gem_shuffle_tx_rings() is meant for that.
Thanks,
--
Théo Lebrun, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2026-11-19 16:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 20:53 [PATCH net-next v7 0/3] net: macb: implement ethtool set channels count operation Théo Lebrun
2026-11-18 20:53 ` [PATCH net-next v7 1/3] net: macb: cache ENST config across link down/up Théo Lebrun
2026-11-19 11:49 ` Nicolai Buchwitz
2026-11-19 12:36 ` Vineeth Karumanchi
2026-11-19 15:40 ` Théo Lebrun
2026-11-19 16:10 ` Théo Lebrun
2026-11-20 6:44 ` Vineeth Karumanchi
2026-11-18 20:53 ` [PATCH net-next v7 2/3] net: macb: implement ethtool_ops.get|set_channels() Théo Lebrun
2026-11-19 11:54 ` Nicolai Buchwitz
2026-11-19 16:19 ` Théo Lebrun [this message]
2026-11-18 20:53 ` [PATCH net-next v7 3/3] net: macb: distribute evenly Tx SRAM segments Théo Lebrun
2026-11-19 11:45 ` Nicolai Buchwitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DMZBON30TWI8.1KLN28QJP6TNN@bootlin.com \
--to=theo.lebrun@bootlin.com \
--cc=andrew+netdev@lunn.ch \
--cc=benoit.monin@bootlin.com \
--cc=conor.dooley@microchip.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=gregory.clement@bootlin.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=nb@tipi-net.de \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pvalerio@redhat.com \
--cc=tawfik.bayouk@mobileye.com \
--cc=thomas.petazzoni@bootlin.com \
--cc=vladimir.kondratiev@mobileye.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.