Article View: linux.kernel.netdev
Article #10938[PATCH net-next 0/3] net: dsa: make a shorter bridge ageing time take effect
From: Oleksij Rempel
Date: Wed, 04 Nov 2026 11:48
Date: Wed, 04 Nov 2026 11:48
109 lines
15461 bytes
15461 bytes
With kernel STP, the bridge sets a shorter ageing time during a
topology change. When the topology change ends, the bridge restores
the configured ageing time. Without this series, two things go wrong:
- On a KSZ9893, a shorter ageing time does not take effect at once.
The new Age Period starts only after the running period ends.
Entries already in the table keep their old Age Count (patch 1).
- On any DSA switch with .set_ageing_time, the restore has no effect.
DSA writes the short value to the switch instead of the configured
value (patch 2).
A port can also leave the bridge during the topology change (patch 3):
- Before this series, DSA kept the short ageing time of that port. DSA
uses the smallest ageing time of all ports. While the port stayed out
of the bridge, later changes to a longer ageing time still wrote the
short value to the switch.
- With this series, DSA clears the ageing time of the port when the
port leaves. As before this series, DSA does not write the ageing
time to the switch at that moment. The switch keeps its current value
until the next write. The next write comes with the next ageing time
change, or when a port in the same DSA tree joins a bridge. Usually,
the next ageing time change is the restore at the end of the topology
change.
In a lab test on a KSZ9893 with a redundant path, I cut one path while
one station sent one-way traffic to another. I ran six setups. With the
series, the traffic stopped for 12 to 15 s in all six. That is about
the time STP needed to converge. Without the series, the traffic
stopped for 24 to 56 s in three setups. The other three failed before
the cut (see below).
Without the series, the switch kept the old FDB entry of the receiver.
The entry pointed to the port on which the traffic came in, so the
switch dropped the traffic. During the topology change, the switch still
ran its old, long Age Period. The entry therefore did not age out in
time (patch 1). The outage ends when the entry ages out or when the
receiver sends a frame. In one of the three measured setups, the sender
used normal ARP, so the receiver could answer ARP requests. There, the
outage was 24 to 46 s. Where the receiver sent no frame that the switch
could learn from, it was 51 to 56 s. Stations that receive much and send
little are affected most, for example receivers of a UDP stream or of
telemetry. I did not test traffic in both directions, such as TCP.
Without the series, the switch also stayed at the short ageing time
after a topology change ended (patch 2). In this test, the topology
change when the bridge came up already left the switch at 8 s instead
of 300 s, before the cut. The short value is twice the forward delay,
which was 4 s. Entries of stations that send little then
aged out after a few seconds. In three setups, the switch lost the
entry of the receiver this way before the cut.
Patches 2 and 3 change the DSA core. They affect every driver that
implements .set_ageing_time. For this reason, the series targets
net-next and has no Fixes tags.
To reproduce the restore case (patch 2):
ip link add br0 type bridge stp_state 0
ip link set lan1 master br0
ip link set lan2 master br0
ip link set br0 up
ip link set br0 type bridge ageing_time 1000
ip link set br0 type bridge ageing_time 30000
ip link takes centiseconds, so 1000 is 10 s and 30000 is 300 s. Then
read the ageing time from the switch, for example from the 32-bit
regmap in debugfs:
grep -E '^0*310:' /sys/kernel/debug/regmap/<device>-32/registers
The line shows the bytes of registers 0x0310 to 0x0313. Bits 5:3 of
the first byte are the Age Count. The last byte is the Age Period in
seconds. The ageing time is Age Count times Age Period. Without the
series, it is 1 x 10 s = 10 s. With the series, it is 2 x 150 s =
300 s, so the last byte reads 96.
To test a port that leaves the bridge (patch 3), run "ip link set lan2
nomaster" between the two ageing_time commands. Without the series,
and with only patches 1 and 2, the register readback shows 10 s. With
the whole series, it shows 300 s.
To test patch 1 on a fresh bridge, set the ageing time to 300 s and let
the switch learn an address on lan1. Then set the ageing time to 10 s
and watch the "self" entry of that address in "bridge fdb show dev
lan1". Without the series, the entry stayed in the table for 57 s to
more than 120 s in my tests on a KSZ9893. With patch 1, the switch
removes the dynamic entries at once. The switch learns the address
again from new traffic.
Tested on a KSZ9893. I did not run the forwarding selftests.
---
Oleksij Rempel (3):
net: dsa: microchip: ksz9477: apply a shorter ageing time at once
net: dsa: store the port ageing time before programming it
net: dsa: forget the port ageing time when the port leaves the bridge
drivers/net/dsa/microchip/ksz9477.c | 36 ++++++++++++++++++++++++++++++++----
net/dsa/port.c | 15 +++++++++++----
2 files changed, 43 insertions(+), 8 deletions(-)
---
base-commit: 4dd16e31135ea8437a720222df34e8745f385d6d
change-id: 20261103-ksz-stp-ageing-705aa69829e5
Best regards,
--
Oleksij Rempel <o.rempel@pengutronix.de>
Technical Details
Message-ID:
<20261104-ksz-stp-ageing-v1-0-2c2bc7217dea@pengutronix.de>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-356393-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-356393-linux-kernel-netdev=dewy.ru From: o.rempel@pengutronix.de (Oleksij Rempel) Newsgroups: linux.kernel.netdev Subject: [PATCH net-next 0/3] net: dsa: make a shorter bridge ageing time take effect Date: Wed, 04 Nov 2026 12:48:27 +0100 Organization: Usenet Network Message-ID: <20261104-ksz-stp-ageing-v1-0-2c2bc7217dea@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="3383960"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:4S17kq80l+BfmVZYaebVdmv4JDY= sha256:zx7ZrYlYTGr7WQXosjLTA8uaUSPmpYb2nq4ZDfHC1yU= sha1:4glVqxyjoIeP7l6jBn7qiJ+8Dss= sha256:RCyMG0AM9sUKYOrm83TcjhJE+JRlsSVa5KMb/qijT6o= 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 08CFD112BA5; Wed, 4 Nov 2026 14:57:06 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.051 X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, 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=pengutronix.de 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 vEQg7kkLJXmQ; Wed, 4 Nov 2026 14:57:02 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-356393-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=pengutronix.de X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mail.dewy.ru (Postfix) with ESMTPS id CB751112BA2; Wed, 4 Nov 2026 14:56:53 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sin.lore.kernel.org (Postfix) with ESMTP id 8867827733; Wed, 4 Nov 2026 11:48:51 +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=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1793792927; b=D5BDHCyECSwUOrw5UPAsFUA1rMwvdJf5Qr6MGZhY3acBYSViV+YwAAGWhtZYuRfg/kIe gskZ3e/ZmvJysvqnFDOcpdtFWz2OenfDP0nIOmaDiGnUiW7tHpykbZS5/h5dtrN2zGcfT M9XKiK2LFN1hRFqMfaGpapHjRuCoLxgRH+pJ6H6BOmKCJ6ptKxKAlKooYzP+Vs6x4SjOE yf1zST+vc+9TUSqVGJxpG/M/xmYPM6TzJqcJl2pAqPkCwhD8gYqIo2zVsmZYk5T52UAE1 uXQglhPfvGblWr7PX8OcfTGOAUsAFUX4yUALmMLcDaubfwfw5ptqchYgMXuYdjrseNA== X-ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793792927; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:Received: From:Subject:Date:Message-Id:X-Mailing-List:List-Id:List-Post: List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence: MIME-Version:Content-Type:Content-Transfer-Encoding:X-B4-Tracking: X-Change-ID:To:Cc:X-Mailer; bh=Bz0nqTsX+SVe2yv12UIFCrkUsWFsu0k6BjSN4MdGI4s=; b=E6n+LeTmPYgmN/7zls+iPJh3HbJi0dnpH8HGW8kdt8hQjoVnne0eFTdWPlwYpQ9zMfuq h2c/EzdFUCTzl0g0SJeof7bxkBDA7+PTI+ofBw1UzUGQy8QN3GkmZgXLM1h/d/KpzG6h/ 5z5gMU4I7jz1ObsH98kGfLLcPDlzBQSXqrO46ebxNBonZixXGxdU0BZp1gVG10NI0Sp4i rdnTwS5FslGkAR73yopvXaaXxaZUES2K61bP40IdFZxe1wD5i2tg72CoIEE6MbgzR9GAX p2g6V9pUD86AvaKxTKO7SXpKGq9No0N1Hki0lBklD4UcEJmL8zjqn/GERWAFRBRee4g== X-ARC-Authentication-Results: i=3; smtp.subspace.kernel.org; dkim=pass header.d=pengutronix.de header.i=@pengutronix.de header.a=rsa-sha256 header.s=20260414 header.b=GkWVOTo8; dmarc=none header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; 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 24010606D80E; Wed, 4 Nov 2026 11:48:47 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=pengutronix.de header.i=@pengutronix.de header.a=rsa-sha256 header.s=20260414 header.b=GkWVOTo8 X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=185.203.200.13 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1793792926; b=2O9MKtjHMQRpSbP/5lTCrkYbeEjDYxixg0/qNiANxobsfra0plm86FwshKu8Lw5F2X77 uOp9zM7DkH6nJg26UirjdADpQEezJQARg7BmCovqFLZjd4TqP0RF4FBidJO2m8/eiJyRL qGpzGhTFYh5eYJPD47iGV8GeCnIR/ADHy5MJLFuQ3Clf0NzlqIBUU8ukfR1tjx2WHrPT+ w+WhfHkuYeTs3ltxn7bZOTmvnBeFG8Ifssr71vYR3K/3hw4hDz1BxAGNtZ/fsHkbNjeT1 iTqju/O9BXeRW15R/2Vw2T+c9hQvgmWpD4Ug+/jqIbF23/8y8gLz97zZwZiXeCTCDgQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793792926; h=DMARC-Filter:Received:DKIM-Signature:Received:From:Subject:Date: Message-Id:MIME-Version:Content-Type:Content-Transfer-Encoding: X-B4-Tracking:X-Change-ID:To:Cc:X-Mailer; bh=Bz0nqTsX+SVe2yv12UIFCrkUsWFsu0k6BjSN4MdGI4s=; b=TAM20SzpTCvq+Xnt151wZ+Xp5Xo2j0CsGhdmGjWmes/XkpMzL4bXiIw2Au0IzzpL6ant +K6NbI8HQTUthFycEZEflgBJsrT4SVyHlta7YMIQwYTt2OMnbqRM27TN+kbWWfnc/9zSf QZ6hRMLzo+D2u0mFX0k6vFnI+QLr55IOHdle8/prMvCabjkikcEO9NaLi01dSMnerUZMr CpiegBg95RR3LoXh5QZSEDlb8crW2UXBUb3MJ8PYlPJqUzBskz4uOfuNN9tWQHvCMh1iE dHr8vNl8STLxhJPbQCHk9kjQtSraGs7U1odSprL+WieaSAyc8fjFP9hrTR001jE3UCA== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; dkim=pass header.d=pengutronix.de header.i=@pengutronix.de header.a=rsa-sha256 header.s=20260414 header.b=GkWVOTo8; arc=pass header.oldest-pass=0 smtp.remote-ip=185.203.200.13 X-Received: from mx1.white.stw.pengutronix.de (mx1.white.stw.pengutronix.de [185.203.200.13]) (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 4C247606A32F; Wed, 4 Nov 2026 11:48:43 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4C247606A32F X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de X-Received: from dude04.red.stw.pengutronix.de (dude04.red.stw.4.pengutronix.de [10.17.1.12]) (Authenticated sender: relay-from-dude04.red.stw.pengutronix.de) by mx1.white.stw.pengutronix.de (Postfix) with ESMTPSA id 6A08E200AD7; Wed, 04 Nov 2026 12:48:42 +0100 (CET) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pengutronix.de; s=20260414; t=1793792922; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bz0nqTsX+SVe2yv12UIFCrkUsWFsu0k6BjSN4MdGI4s=; b=GkWVOTo8OA5rO7xbcyNMH/qWLLuB4VwdDDOgj01j1RQkODfmbpDWoTYdAL1A/SmPOycKAe AXdPQC3SjW6SOUyo8NdXYkFJDiHQHFUfMQjziN6Q3W4wC/4gFnnktLZ5so6e3EJvcajXSW SSbhrfjgIc3nskbdHX0Ww1YVTFSP2Oog+zudFGvoKq0RkxrkqgFZ5AiARdTuhfBFyyWCkH Aec60GFra1Va+SshfE2J58w4lQ8uj9PpZcHkAI8/sidE8EwDDefXLGp2HAG5I5F/7LsYYg EbyqmG8RgwvwornTus60kMVLLxsuN5NVgTRjXtoul2Qv8lg1zAgg0PVbBI4b5A== X-ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=pengutronix.de; s=20260414; t=1793792922; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bz0nqTsX+SVe2yv12UIFCrkUsWFsu0k6BjSN4MdGI4s=; b=ZDgosKSMs6WZGfTTbKVBwsRlIjEPQAXcbzuE/73mTFoKQqi5DTe7W+gX7IoVkkgkhxKN9l qDO6Ci5957J2Mo1ceftxRnzGR+u0qWM/N5OJKS/5dKcflmOShlljKZdhkvg6KHD2apO2LI ixFHeAgkEvG6rOpHyStCRLiLYTBlJAKvIktBYMAqrjVi8jmOxF9ydGl5XdpSeEhozV/Pma woDAK3l5kWFYdm4/tp1sjMUDkm5y7YIn6r+OzEUMrss5pMq8GIVkQ1E7NAf3zefKCvdpSq PGRC+ijpoR27flwGuaE9YW7NbVEYueoqlbQsb1vwZvjgdnRCNQiaRLv6KkhCMw== X-ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=relay-from-dude04.red.stw.pengutronix.de smtp.mailfrom=ore@pengutronix.de X-ARC-Seal: i=1; s=20260414; d=pengutronix.de; t=1793792922; a=rsa-sha256; cv=none; b=MJUDHjRo/STTGox1rBRvqHDg7ia9CbZ44TbLReP5w5cGzT2Vuc5zTCabxzbxlwJQEvC1wx kDx3bOA6ZxESlIkH45vNk2fHa5KIplqS+SWlsoTCl7snofO2kCVRAOd8y0OUtNKhPrqCTd IE023M8eDmwDuAjBS2biP/1PhGQNdAEPn20ZmDOxfo22Tua6C5VSoeDXFTky62pxE35TyU VeRFHJcfXxn2lumy+2XetxbA94dW7BPBy3VwHW/CkzWJhk9KOx/NxHoa/+Zf9OS+qE5yqr aT5LOludc68RK5gs9JjhDRCufRIbnF9unSUxLSTj0r0DmRwOnGN/cY9kRu1YVw== X-Received: by dude04.red.stw.pengutronix.de (Postfix, from userid 1058) id 5DD70380600; Wed, 04 Nov 2026 12:48:42 +0100 (CET) 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 X-B4-Tracking: v=1; b=H4sIAIsb62oC/zWM0Q6CMAxFf4X02cZtBhR/xfhQoI7GUMm6ECLh3 50mPp7ce84GxknY4FptkHgRk5cW8IcK+pE0MspQGIILjffuhE97o+UZKbJoxLOriZr2ElquoUh z4oesv+ANlDMqrxnuZenIGLtE2o/f4EALT/h/HCcShX3/ACoFvTmQAAAA X-Change-ID: 20261103-ksz-stp-ageing-705aa69829e5 X-Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, Jens Emil Schulz Østergaard <jensemil.schulzostergaard@microchip.com>, Oleksij Rempel <o.rempel@pengutronix.de> X-Mailer: b4 0.14.2