The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Oleksij Rempel <o.rempel@pengutronix.de>
To: netdev-bot+sashiko@kernel.org
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
Subject: Re: [PATCH net-next v3 1/3] net: dsa: microchip: ksz9477: apply a shorter ageing time at once
Date: Thu, 19 Nov 2026 08:19:44 +0100	[thread overview]
Message-ID: <av6jEDrNaCwejcft@pengutronix.de> (raw)
In-Reply-To: <179505020064.3136.4475163541276513628@kernel.org>

On Thu, Nov 19, 2026 at 01:03:20AM +0000, netdev-bot+sashiko@kernel.org wrote:
> Is a fixed 2 ms pulse enough on every chip in this family and for every
> stored Age Count?

I do not know. I tested only on a KSZ9893. 2 ms worked there, and I
did not try other lengths. The datasheet only says that the bit
enables fast aging. It gives no pulse length and does not say what the
bit removes. The
800 us figure in ksz8.c is for the KSZ8995XA. I have no such figure for
the KSZ9477 family.

I tested Age Counts 2 and 4. I write Age Count x Age Period, so
2 x 150 s is Age Count 2 and Age Period 150 s.

- From 2 x 150 s to 2 x 5 s, I read the FDB after the pulse. The
  entries were gone within 2 s. On an earlier build with the same
  code, an entry learned about 2 s after the change aged out after 5
  to 10 s, so the new period applied at once.
- From 4 x 75 s to 4 x 2 s, in the kernel STP tests, a monitor read the
  entries of lan1 every 1 to 3 s. The entries of stations that had
  stopped sending were gone at the first read after the change. That
  run used an earlier version of this patch with the same pulse code.

The tests do not show how the pulse works. It may remove all dynamic
entries at once. Or it may run a fast ageing pass, and entries with a
higher Age Count could survive it. I did not test Age Counts 5 to 7.
The driver does not check that the entries are gone after the pulse.

Starting from the reset value of 4 x 75 s, the driver picks Age Count
5 or more only for ageing times above 1020 s. I keep 2 ms for now. If
someone can test a higher Age Count on another chip of the family, I
can extend the pulse or check the table.

> Can an ageing time change in one bridge now flush the dynamic FDB entries
> of every other bridge on the same switch?

Yes. On the KSZ9893 the pulse removed the entries of both user ports.
Fast Aging, the Age Count and the Age Period are switch-wide, and
.set_ageing_time() gets no port or bridge argument. So the pulse also
hits other bridges on the switch. The commit message and the comment
say that the pulse removes the entries of all ports. They do not name
other bridges. IMO the cost is acceptable, see the next answer.

> For example, 300 s (4 x 75) -> 30 s pulses. Going back to 300 s
> (2 x 150) does not. The next TC (30 s = 2 x 15) pulses again, so every
> TC on/off cycle causes one switch-wide flush.

Yes. There is no rate limit. The pulse comes only when the programmed
ageing time or the Age Count gets smaller.

The cost is unicast flooding until the switch learns the addresses
again. The switch learns an address from the next frame that the
station sends through it.

The pulse also helps after a station moved. Without it, traffic to
that station goes to the old port and is lost until the station sends
a frame through the switch or the stale entry ages out. In my
worst-case test without this series, one-way UDP with static ARP
stopped for up to 56 s, 43 s of that after STP had converged. Such
fully one-way traffic is rare. Once its entry ages out, the switch
floods that traffic anyway.

On a topology change, kernel STP only shortens the ageing time. With the
pulse, the switch also removes the entries, as RSTP does. For RSTP and
MSTP, IEEE 802.1Q-2022, 13.19, NOTE 2 lets a bridge remove all Dynamic
Filtering Entries, not only those of the given ports: "This does not
result in incorrect operation, but will result in more flooding of
frames with unknown destination addresses." The note speaks of a single
bridge, not of several bridges on one switch. For other bridges on the
switch, I think the cost is the same: extra flooding.

> A CAP_NET_ADMIN holder in another netns that owns a bridged switch port
> could toggle IFLA_BR_AGEING_TIME.

Without this patch, that user can already lower the ageing time of the
whole switch. With this patch, that user can also cause a flush. A
flush happens when the programmed ageing time or the Age Count gets
smaller. It can also happen on a raise, for example from 8 s (2 x 4)
to 31 s (1 x 31). It also happens when a port joins a bridge with a
shorter ageing time than the switch has now. Other bridges then flood
unicast until they learn the addresses again.

Oleksij

  reply	other threads:[~2026-11-19  7:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 13:02 [PATCH net-next v3 0/3] net: dsa: make a shorter bridge ageing time take effect Oleksij Rempel
2026-11-17 13:02 ` [PATCH net-next v3 1/3] net: dsa: microchip: ksz9477: apply a shorter ageing time at once Oleksij Rempel
2026-11-19  1:03   ` netdev-bot+sashiko
2026-11-19  7:19     ` Oleksij Rempel [this message]
2026-11-17 13:02 ` [PATCH net-next v3 2/3] net: dsa: ignore the old ageing time of the port being changed Oleksij Rempel
2026-11-17 21:37   ` Linus Walleij
2026-11-17 13:02 ` [PATCH net-next v3 3/3] net: dsa: forget the port ageing time when the port leaves the bridge Oleksij Rempel
2026-11-19  1:03   ` netdev-bot+sashiko
2026-11-19  7:23     ` Oleksij Rempel

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=av6jEDrNaCwejcft@pengutronix.de \
    --to=o.rempel@pengutronix.de \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=arun.ramadoss@microchip.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=horms@kernel.org \
    --cc=jensemil.schulzostergaard@microchip.com \
    --cc=jiri@resnulli.us \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev-bot+sashiko@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=vivien.didelot@gmail.com \
    --cc=woojung.huh@microchip.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