From: netdev-bot+sashiko@kernel.org
To: theo.lebrun@bootlin.com
Cc: conor.dooley@microchip.com, andrew+netdev@lunn.ch,
davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
pabeni@redhat.com, linux@armlinux.org.uk, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, nb@tipi-net.de,
pvalerio@redhat.com, vladimir.kondratiev@mobileye.com,
gregory.clement@bootlin.com, benoit.monin@bootlin.com,
tawfik.bayouk@mobileye.com, thomas.petazzoni@bootlin.com,
vineeth.karumanchi@amd.com
Subject: Re: [PATCH net-next v8 1/3] net: macb: cache ENST config across link down/up
Date: Thu, 26 Nov 2026 16:45:23 +0000 [thread overview]
Message-ID: <179571152363.3135.15940503307792785015@kernel.org> (raw)
In-Reply-To: <20261124-macb-set-channels-v8-1-770cf8e50e6d@bootlin.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] In macb_mac_link_up()
(drivers/net/ethernet/cadence/macb_main.c), when the link comes back…
--
net: macb: cache ENST config across link down/up
The macb driver now keeps the ENST (taprio offload) config in bp->enst
and writes it again on every link-up. If the link speed has changed, the
cached config is dropped with a warning. The commit also caches the link
speed in bp->speed_mbps, serialises the taprio paths with
bp->mac_cfg_lock, and removes the pm_runtime_suspended() check.
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index 9f6111661b40d..1e06666921160 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
[ ... ]
> @@ -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) {
> + netdev_warn(bp->netdev,
> + "TAPRIO dropped because link speed changed\n");
> +
> + memset(&bp->enst, 0, sizeof(bp->enst));
> + }
> +
> + macb_apply_enst_config(bp);
> +
[Severity: Medium]
After the link comes back at a different speed, the cache is zeroed.
macb_apply_enst_config() then sets the disable bits for every queue and
writes 0 to the per-queue timing registers. ENST_CONTROL is not enabled
again, because of this check:
if (bp->enst.queue_mask)
gem_writel(bp, ENST_CONTROL, bp->enst.queue_mask);
>From then on the MAC applies no gate control at all. Only a netdev_warn()
reports this.
Does the taprio qdisc still report a fully offloaded schedule in this
state? netdev->num_tc and tc_to_txq are left as they were, since only
macb_taprio_destroy() calls netdev_reset_tc(). In offload mode the taprio
core does not call ndo_setup_tc again on link changes, so nothing
reprograms the hardware.
Can the schedule ever come back without the user reinstalling the qdisc?
struct macb_enst stores only on/off times already converted to bytes for
one speed:
config.queues[queue_id].on_time_bytes =
enst_ns_to_hw_units(entry->interval, bp->speed_mbps);
config.queues[queue_id].off_time_bytes =
enst_ns_to_hw_units(off, bp->speed_mbps);
macb_taprio_setup_replace() discards the nanosecond intervals from
tc_taprio_qopt_offload. Because of that, macb_mac_link_up() cannot
recompute or re-check the schedule for the new speed. It also cannot
restore it if the link later comes back at the original speed, for
example after a temporary PHY downshift or a cable swap.
Would it work to keep the ns intervals in bp->enst, then re-validate and
recompute the byte values on each link-up? The schedule would then
survive whenever it still fits the new speed.
> if (!(bp->caps & MACB_CAPS_MACB_IS_EMAC)) {
> macb_set_tx_clk(bp, speed);
> gem_shuffle_tx_rings(bp);
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261124-macb-set-channels-v8-0-770cf8e50e6d%40bootlin.com
next prev parent reply other threads:[~2026-11-26 16:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 16:45 [PATCH net-next v8 0/3] net: macb: implement ethtool set channels count operation Théo Lebrun
2026-11-24 16:45 ` [PATCH net-next v8 1/3] net: macb: cache ENST config across link down/up Théo Lebrun
2026-11-26 16:45 ` netdev-bot+sashiko [this message]
2026-11-24 16:45 ` [PATCH net-next v8 2/3] net: macb: implement ethtool_ops.get|set_channels() Théo Lebrun
2026-11-26 16:45 ` netdev-bot+sashiko
2026-11-24 16:45 ` [PATCH net-next v8 3/3] net: macb: distribute evenly Tx SRAM segments Théo Lebrun
2026-11-26 16:45 ` netdev-bot+sashiko
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=179571152363.3135.15940503307792785015@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--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=vineeth.karumanchi@amd.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