Skip to content

Commit 4eab90d

Browse files
vladimirolteandavem330
authored andcommitted
net: dsa: don't fast age bridge ports with learning turned off
On topology changes, stations that were dynamically learned on ports that are no longer part of the active topology must be flushed - this is described by clause "17.11 Updating learned station location information" of IEEE 802.1D-2004. However, when address learning on the bridge port is turned off in the first place, there is nothing to flush, so skip a potentially expensive operation. We can finally do this now since DSA is aware of the learning state of its bridged ports. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 045c45d commit 4eab90d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/dsa/port.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ int dsa_port_set_state(struct dsa_port *dp, u8 state, bool do_fast_age)
5050

5151
ds->ops->port_stp_state_set(ds, port, state);
5252

53-
if (do_fast_age) {
53+
if (do_fast_age && dp->learning) {
5454
/* Fast age FDB entries or flush appropriate forwarding database
5555
* for the given port, if we are moving it from Learning or
5656
* Forwarding state, to Disabled or Blocking or Listening state.

0 commit comments

Comments
 (0)