Re: [PATCH net-next v2 3/3] net: dsa: forget the port ageing time when the port leaves the bridge

From: Andrew Lunn

Date: Sun Nov 15 2026 - 10:40:44 EST


On Sun, Nov 15, 2026 at 11:59:53AM +0100, Oleksij Rempel wrote:
> Clear the cached dp->ageing_time when the port leaves the bridge.
> Otherwise dsa_switch_fastest_ageing_time() still uses the ageing time
> of the port that left. If the port leaves with a shorter ageing time,
> for example during an STP topology change, the switch stays at the
> short value until that port joins a bridge again. With this change the
> switch goes back to the long value when the bridge restores it at the
> end of the topology change. The switch gets the restored value only if
> another port of the same bridge is still in this DSA tree.
>
> Found by code inspection. Tested on a KSZ9893 with lan1 and lan2 in a
> bridge, ageing time 300 s:
> - kernel STP, forward delay 4 s, lan2 removed during a topology change:
> without this patch the switch stayed at 8 s (2 x 4 s). With it, the
> switch went back to 300 s at the end of the topology change.
> - no STP: I set the ageing time to 10 s, removed lan2, then set 300 s.
> The switch stayed at 10 s without this patch and went to 300 s with
> it.
>
> Fixes: 34a79f63bbe4 ("net: dsa: support switchdev ageing time attr")
> Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>

Reviewed-by: Andrew Lunn <andrew@xxxxxxx>

Andrew