Article View: linux.kernel.netdev
Article #18879Re: [PATCH net-next v3 3/3] net: dsa: forget the port ageing time when the port leaves the bridge
From: netdev-bot+sashiko
Date: Thu, 19 Nov 2026 01:03
Date: Thu, 19 Nov 2026 01:03
104 lines
12128 bytes
12128 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] The fix is incomplete because nothing reprograms the switch
when the port leaves.
--
net: dsa: forget the port ageing time when the port leaves the bridge
This patch clears the cached dp->ageing_time in
dsa_port_switchdev_unsync_attrs() when a port leaves a bridge. After that,
dsa_switch_fastest_ageing_time() no longer counts the departed port's
value when it computes the minimum. The aim is to keep the switch from
staying at a short ageing time (for example one set during an STP
topology change) after the port that requested it has left.
> diff --git a/net/dsa/port.c b/net/dsa/port.c
> index 15e7da20b0e2f..54c9709840952 100644
> --- a/net/dsa/port.c
> +++ b/net/dsa/port.c
> @@ -415,6 +415,12 @@ static void dsa_port_switchdev_unsync_attrs(struct dsa_port *dp,
> /* Ageing time may be global to the switch chip, so don't change it
> * here because we have no good reason (or value) to change it to.
> */
> +
> + /* Forget the ageing time cached for this port.
> + * dsa_switch_fastest_ageing_time() skips 0, so this port no longer
> + * counts towards the minimum.
> + */
> + dp->ageing_time = 0;
> }
[Severity: Medium]
Can the switch still stay at the departed port's short ageing time after
this change?
This only clears the cache. Nothing on the leave path reprograms the
hardware. dsa_port_bridge_leave() ends right after
dsa_port_switchdev_unsync_attrs(). The only code that writes the ageing
register is dsa_switch_ageing_time() in net/dsa/switch.c:
net/dsa/switch.c:dsa_switch_ageing_time() {
...
ageing_time = dsa_switch_fastest_ageing_time(ds, info);
if (ds->ops->set_ageing_time)
return ds->ops->set_ageing_time(ds, ageing_time);
...
}
That function runs only for DSA_NOTIFIER_AGEING_TIME. The only sender is
dsa_port_ageing_time(). It is called from the sync_attrs path at bridge
join, and from the SWITCHDEV_ATTR_ID_BRIDGE_AGEING_TIME handler, which
needs a port that still offloads the bridge.
Here is a sequence on a single chip, with br0={lan1} at 300 s and
br1={lan2} with STP enabled:
topology change on br1
__set_ageing_time(br1, 2 * fwd_delay)
dsa_port_ageing_time(lan2, 8 s)
programs min(8, lan1=300) = 8 s for the whole chip
ip link set lan2 nomaster
dsa_port_bridge_leave()
dsa_port_switchdev_unsync_attrs()
dp->ageing_time = 0; /* no reprogram */
end of the topology change on br1
br1 restores 300 s, but br1 has no DSA lower port left,
so no notifier is sent
lan1 in br0 would keep ageing at 8 s until br0's ageing time changes or
some port joins a bridge again. Would it make sense to recompute the
minimum of the remaining non-zero dp->ageing_time values on dp->ds and
program it here when the port leaves?
The existing comment just above the new code says there is "no good
reason (or value) to change it to". Once the cache is cleared, the
minimum of the remaining cached values is a usable value, so that
comment no longer seems accurate. The new comment also doesn't mention
that the hardware value stays unchanged until the next notification.
The commit message does cover part of this:
"The switch gets the restored value only if another port of the same
bridge is still in this DSA tree."
However, the problem the commit message describes, a switch stuck at the
departed port's short ageing time, can still happen through this leave
path when ports of a different bridge remain on the same chip.
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261117-ksz-stp-ageing-v3-0-135de6b9f8ad%40pengutronix.de
Technical Details
Message-ID:
<179505020217.3136.6917391809574658393@kernel.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366608-linux-kernel-netdev=dewy.ruReferences:
<20261117-ksz-stp-ageing-v3-3-135de6b9f8ad@pengutronix.de>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366608-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v3 3/3] net: dsa: forget the port ageing time when the port leaves the bridge Date: Thu, 19 Nov 2026 01:03:22 +0000 Organization: Usenet Network Message-ID: <179505020217.3136.6917391809574658393@kernel.org> References: <20261117-ksz-stp-ageing-v3-3-135de6b9f8ad@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2747948"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:B74S2oa8HG6tEKL3qYfLkoSvbS8= sha256:Y9nfiIYqH2vKZ2yBKkF62omqTuJ5UoVwlLylU6AHIqI= sha1:jBrF07P9HFtc/OyH5dBmLWK9UD0= sha256:0pZkwtLjgmtmJwg3g3Hr3PymbMQbRs1qRT6WfdIO49A= 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 BAB7A115476; Thu, 19 Nov 2026 04:03:50 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.4 X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, 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, URIBL_BLOCKED=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 N7l9DUBMkjAk; Thu, 19 Nov 2026 04:03:46 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-366608-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 9942E1153C6; Thu, 19 Nov 2026 04:03:38 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 77FE21074B6; Thu, 19 Nov 2026 01:03:31 +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=1795050209; b=xATB9iyBXt3DsQC5N3B3OsVBgnrUKmi+XhH+Lus+vi+bz+WEcPbAOqUpf3dLOnyjfEq8 QqAPqOedVb5PaqZ6hfoBsm1AR7m/D72Mko2Zq6I7MWHKJqwwOiHUKNs3tJl/i1LtOOfMl 8ETsix+r++HqNl9eAVJz5EcWWX3R+ScQ5KogQ4vVEqXljyIP+TceENdwHKlSH2Xz2wWe9 to15KcDg12cwEUjQwAi7wLSKjM9r4Aws90Cmh+0pdla1osgiPj26tFWTyuyUNVkGwbTW8 2776E2uRKvwcAwzpNG2YWINdrHOj5NZz+hge1xQWzp9FC3V3LdbRD0oOKxM4dS6Z9uA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795050209; 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=1R80DB8vNXXSBxqgpip9NisgaUs3vCCTC7Eim9o0R9A=; b=SA22TlqphuJMRkK0MP4J7nWeZ4Lj8Ud2YMhWDP+K4huNsAQ5sWO+WZ6qtjAzSRSH75bR Ryb+Xibxc0xVh9PcavikM9p1ynwdKwJIX5CLEADYgn0s2RngLmQ+HmeDbw62AiFOYMMKc fEjYP2c83kRbKD0TWxDZli2VMhwEe/VtXFkY/pQnXTaPbYyUBTgW71hZJGB8e8Tla8sIf AwIeJt5+D60+pW0Uw0L0LD+mHWfM44G77ZcMPGQ0RMekW8+Tzq4VNnqg/UREdjtcSV2mb LnUl0k+xnhwVE3zWOW2kHVGbCrvLK44nFL+Bm5xYg2rJdGTjptVNcO5LkqKUSEFlNiQ== 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=mZExSz2Y; 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 8B03060A2602; Thu, 19 Nov 2026 01:03:29 +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=mZExSz2Y 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=1795050203; b=bOxnLuflL2+bsQSfYsYNJgLmDGwj0XO3zF7qIBZfPTjdojEjMfolO7T2zjwbzGIYmXHI PYt6YgXZRy/3Wetkn7zfepidTp0ENJjWPIosejVE4TaZTesTQsx+RYsvrf898g/bu9Ysz HYuJ1MaZV0ewzvzk7hrvM6EoyPo4vvacqHTdQiCFIw0M1jpn8VpX7CiCB1MKGdgGYOcUW Qi5CdOqGbMxAVSyOCZngiq1XvIE5sZAfG/mFZ8PWKsXuePw54cikho/kq1TOuatIkNgW2 9K6+D//q6wauM4BUQ+uxGA7a4CZPhzsbBRQr7CcP3K5uzpthtdA6J4sOF/QnSeGIIhQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795050203; 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=1R80DB8vNXXSBxqgpip9NisgaUs3vCCTC7Eim9o0R9A=; b=3YEKNRT3WNbbDisVXdNlQrGOCicac4cVTL/tiU78YqgsQb5t2tgRAxjPuw3xztQAebfr smicU7F4zcLokltePZLcnH6rnSq0R9IuRdWnce56eY6bhoSUsF/vrhJX5oVH12suWmYj4 Fid4r5BAMmXzt7X+woeZdm/QXTMzxrupTE1mwpCWt6hpSJHe4JIjgFVIfVyXMfwYRWTkP 9Z5y2gcg7fY9BkuBxgFarAT1z1MPqPDpwFGZzUdwoi7+gd83S1y9nv1P0FeGXVS4xEYgw 3YTA0DpNVajoG8Ny8CDzefW4Nwmg6peAwubJ5JLpjc2nY9SVvBjURL8+6SEhbvGFyRg== 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=mZExSz2Y; 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)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AC82E606A32A; Thu, 19 Nov 2026 01:03:23 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 908A61F000C4; Thu, 19 Nov 2026 01:03:22 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795050203; bh=1R80DB8vNXXSBxqgpip9NisgaUs3vCCTC7Eim9o0R9A=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=mZExSz2YWjwWp4w5eHni/X8lNP0Ppgik7DYvbEkR7SEYhRnPGiF5RkKTOKYA4Hqzw z0fIkRGCu+ltiR8L16gOh1T1avqJJsArQutURwKHTHkdskJp0WkdJ2WqDSc5Ot4yq4 pIIMY1fP4LSMIPTXDNLPhQT9N8VrT7jy/JY5kcMSB3eiKL0vuYZx6Q+uzO7gNnb2Xt myiALa7s9eZs1DdhhSS12LxxaD7k9+Nkd/HdWC+nRfn9WFa9Kner/nvfSyttspASge oIKLF7JY/b3Jyj3l4cz5JkTwuIGtHoMfi2sm9mDNWQmIHyFc+KaJIcR+Jde9ojNB+Z bWZhNHWAti1Uw== X-Cc: woojung.huh@microchip.com, UNGLinuxDriver@microchip.com, andrew@lunn.ch, olteanv@gmail.com, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, arun.ramadoss@microchip.com, jiri@resnulli.us, linusw@kernel.org, f.fainelli@gmail.com, vivien.didelot@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, jensemil.schulzostergaard@microchip.com X-In-Reply-To: <20261117-ksz-stp-ageing-v3-3-135de6b9f8ad@pengutronix.de> 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