Article View: linux.kernel.netdev
Article #23193Re: [PATCH net-next v8 1/3] net: macb: cache ENST config across link down/up
From: netdev-bot+sashiko
Date: Thu, 26 Nov 2026 16:45
Date: Thu, 26 Nov 2026 16:45
91 lines
11470 bytes
11470 bytes
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
Technical Details
Message-ID:
<179571152363.3135.15940503307792785015@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372248-linux-kernel-netdev=dewy.ruReferences:
<20261124-macb-set-channels-v8-1-770cf8e50e6d@bootlin.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372248-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev 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 Organization: Usenet Network Message-ID: <179571152363.3135.15940503307792785015@kernel.org> References: <20261124-macb-set-channels-v8-1-770cf8e50e6d@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="512049"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:mWjXKRxNC6C0cPErmOovmKS1Ydw= sha256:tDirrDnWh/d+kxEJq6J7ncauBrAvA2tKPO4YFjMSYyA= sha1:7fVP4LVZ9gQkeOLRGL5kt8ZjAjE= sha256:D97wEjarX2uh9di+sPNlzJepVZKDHmuYfPbZT/Y2QkY= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 23727125EEC; Thu, 26 Nov 2026 19:45:54 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.501 X-Spam-Status: No, score=-3.501 tagged_above=-9999 required=6.31 tests=[DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JWJBnhrj2vcM; Thu, 26 Nov 2026 19:45:50 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-372248-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 2420B125EEB; Thu, 26 Nov 2026 19:45:41 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 84BC02AB12; Thu, 26 Nov 2026 16:45:36 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795711531; b=DlscMFL16/dbYUsVrSKE1aiFm46Fe9696n9VhWY4Xh2/qFEam8GP1RYGnOIJEa3o9+Sx 0O/XH8UzURm9ge+UhKWLPoiA3TaPwlqXJQi36lOkY29nSNlWHmtEj5qGMKURQbaD39/f1 1+kIc1EDLANFWzdcXZ1YNBOg78yozv67vmQOx9TqgyqU+hirB4SF5tUgnhT2KqMa6YNdN ILFbHTzbftlOsr/OQDS1mdJn2HGv2E0FwtPq83UOEIpGEHyhBGHQXbRWp2Na+sTKslA6c MtbxkWpN1hYgIDm17Nu3QN1k+i8md1tMB/l/QsB/9p0sg4YVSITgvx+jru5ZJnQGJWw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795711531; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=UHhBZ5Uxp8/lUbBSy2xJRw/vE4j4zkIMEJqynNMt8sM=; b=uAq8UCt7DxA7Sbk0t1ag1CdWAZTWUhY++sYmEQP4pv4kABVbjlzqoD9Dlg4fF558Vfi4 9lAh9Yq4Z7F4Ls3Q7elnnaIyIO/XTHKOBOx1vNsJw/OEhooqprFlS7GO8p+KLBH4LYiYQ BQEL32bcW9V5Zr1Loo8/NP239CqbAfUoGS+lAvxZbftIR+FALgh3jveWZZJj/iUyDCeD4 5VFMrtVjO7INOjbWe61Oq2BFC6+99qxER7GJe7sLn31s/jk0GE9ep5iz6MBd12Q2m+hG6 uqqs6aik1A3Yw7gxvtBItyEFDkVIzMU/L1wu9kMic7N0LtEU+jZYwo8uQdm+G9qgA2Q== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=B19D+lQx; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BC9AC606A695; Thu, 26 Nov 2026 16:45:31 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=B19D+lQx X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795711525; b=S6WxdS5pCr21bGmkuMOigciIER2cWKuVfZCNXlbRkIZaBiLIOCyX9YJCdUQJhd174+dG psdAujgqf9PqiBZGDT+ZzCCVDH5iwStsLqJQRNZvDw4aSMHTBA34IOQ44W/y1mAi3oBTb 47hg3nyEuKe81PNdcaRioLa+aCHqoJKHKc3N7FCZazo4KqIwpzdootcByEaq4nH4zK6ez qI7wbtYumuZ8uv+gyalg5q1Op9oCnrDHYvC58yYot1E/li2e0jKTid0VKDhmmap6djyZl ph9V3iP9hstWwdt1QifSZXJSfRKvofQ6ZU6DYsfVauTsZHKI68k5aR0eEtF3Nq1/cJw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795711525; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=UHhBZ5Uxp8/lUbBSy2xJRw/vE4j4zkIMEJqynNMt8sM=; b=jOqjZXSt4uKiJJaoES0+shWlcP2j5pOyWkOxSBaqoxW/+0AGfr0IHVl+V/XvCY2oPdE9 VArNLeCDegzgriJlCPV2mH0XZSE2peMUHP73ZYh4sW0aVM96G1v39HJuv0vsTuDoEIzOK deRTdIa5TrhTjfzgykV5xFsX6FT8IQ9NoFUY0tj0BBOfOBzMA6El2NWAecaBUtuvL1jbV 6aIdTb7rFGgDo+1hgygRFKAe2wYYT5Rl8TtqxxJB4Q1UdZl8jvycp/3ITb8KZns95v2zQ 63TPSGy8Yi3A7tkoQIUu4dk8fzUV3mauyOQusq52UPI82t8yQnzwjHq2ZYAKoIW/C1w== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=B19D+lQx; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D9C46606A31C; Thu, 26 Nov 2026 16:45:25 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0F0191F000D0; Thu, 26 Nov 2026 16:45:24 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795711524; bh=UHhBZ5Uxp8/lUbBSy2xJRw/vE4j4zkIMEJqynNMt8sM=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=B19D+lQxF/1G68HXkUW5LKi6A9FfsicKZeuwVabLs/u9mJz1Z6Df/Mj44/mkYMHWS 0szjGrViOgksZnk0m0Y7/Pr7LQo0YqbPwL7q6/5pgCyuxXRX5Zr+OCArL6EqiDwDs4 VJ9W7eAwEve69wJbEG3c6+vVyqmKvxPh84aNVOlBGfUiIoeX3NpWOAz+TU39bUiF7B aTa8HKWXAkpZG8Mywftn3xgs/t48PmtlSUN8Ev9ea/h8GYZescFitZEt2lO6ZdbVFH 6lW1QwcevBw63MgcGKJ8MQWVDX31/4f7aPX3Twf9t/XkkxOzZpHJDA6y5jGtjVbTfn m2bv55b8DGo8Q== X-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 X-In-Reply-To: <20261124-macb-set-channels-v8-1-770cf8e50e6d@bootlin.com> X-sashiko-severity: Medium X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list