From: Vineeth Karumanchi <vineeth.karumanchi@amd.com>
To: "Théo Lebrun" <theo.lebrun@bootlin.com>,
"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>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
"Nicolai Buchwitz" <nb@tipi-net.de>,
"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 1/3] net: macb: cache ENST config across link down/up
Date: Fri, 20 Nov 2026 12:14:18 +0530 [thread overview]
Message-ID: <0933f10c-8d74-4d98-afdd-1a83409c2402@amd.com> (raw)
In-Reply-To: <DMZAUI64FXCL.13646UPPGKGTC@bootlin.com>
Hi Théo,
On 11/19/2026 9:10 PM, Théo Lebrun wrote:
<...>
>>> @@ -972,6 +1010,7 @@ static void macb_mac_link_up(struct phylink_config *config,
>>> spin_lock_irqsave(&bp->lock, flags);
>>>
>>> bp->link_up = true;
>>> + bp->speed_mbps = speed > 0 ? speed : 0;
>>>
>>> ctrl = macb_or_gem_readl(bp, NCFGR);
>>>
>>> @@ -1009,6 +1048,15 @@ static void macb_mac_link_up(struct phylink_config *config,
>>>
>>> spin_unlock_irqrestore(&bp->lock, flags);
>>>
>>> + if (bp->enst.speed_mbps && speed != bp->enst.speed_mbps) {
>> Why drop the schedule on a speed change? The taprio qdisc stays
>> installed, so the user's configuration is still valid;
>> Could we instead recompute the ON/OFF times for the new speed on
>> link-up, and only disable (with a warning) the queues whose intervals no
>> longer fit the hardware range at that speed?
> See explanation above. It felt like a good local maximum: simple code
> that probably doesn't introduce rounding bugs and solves it for most
> usecases.
>
> In any case, we will sometimes have to drop the qdisc and warn about it.
>
yes agreed!.
I also looked at a few usage scenarios and at how other implementations
handle this (with some AI assistance). They lean towards recalculating
on link-up:
- taprio core: keeps the schedule on a speed change and recalculates its
speed dependent values (picos_per_byte, max frame durations) from its
NETDEV_UP/NETDEV_CHANGE notifier.
- felix / VSC9959 TAS: gates are in ns; on a speed change,
vsc9959_sched_speed_set() updates the TAS link speed and calls
vsc9959_tas_guard_bands_update() to recalculate the speed dependent parts.
Typical scenario:
- Autoneg downshift 1G -> 100M (damaged cable, 2-pair or M12 cabling,
PHY downshift): fairly common in the field. Users expect best-effort
traffic to keep flowing, a clear warning, and recovery once the cable is
fixed.
That said, I am fine with either approach.
>>> + netdev_warn(bp->netdev,
>>> + "TAPRIO dropped because link speed changed\n");
>>> +
>>> + memset(&bp->enst, 0, sizeof(bp->enst));
>>> + }
>>> +
>>> + macb_apply_enst_config(bp);
>>> +
>> Could this be a single macb_apply_tc_config() (or similar) that
>> reprograms every enabled tc offload? CBS needs exactly the same
>> handling, since idleslope is also relative to the link rate.
> Yes sure!
>
> Do you want to take over and handle this? You seem to be interested in
> those TC features. You can either copy the patch as-is or modify it
> under your own authorship, I don't mind.
>
> Or if you prefer, I keep it here and iterate. But if I keep it, I'll
> continue with ENST and then at a later stage we'll add CBS & co onto
> it. This patch looks like a good starting point to add more onto it.
>
Your changes look good to me (after generic struct/api), and I am happy
with either option. I can take over the patch and make any necessary
adjustments alongside the CBS changes, or add CBS support after this
series is merged.
Please let me know which you prefer.
Thanks,
--
🙏 Vineeth
next prev parent reply other threads:[~2026-11-20 6:44 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 [this message]
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
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=0933f10c-8d74-4d98-afdd-1a83409c2402@amd.com \
--to=vineeth.karumanchi@amd.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=theo.lebrun@bootlin.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox