]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: reference count the FDB addresses at the cross-chip notifier level
authorVladimir Oltean <vladimir.oltean@nxp.com>
Tue, 29 Jun 2021 14:06:52 +0000 (17:06 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 29 Jun 2021 17:46:23 +0000 (10:46 -0700)
commit0520575a26cdad7e3380ded33c8281edcacf5eb8
tree7a7af9971a1c263d0939722e2f60485aa29e7d86
parent8bf0bf28f6188459e58135e54a88142d3401e95c
net: dsa: reference count the FDB addresses at the cross-chip notifier level

The same concerns expressed for host MDB entries are valid for host FDBs
just as well:

- in the case of multiple bridges spanning the same switch chip, deleting
  a host FDB entry that belongs to one bridge will result in breakage to
  the other bridge
- not deleting FDB entries across DSA links means that the switch's
  hardware tables will eventually run out, given enough wear&tear

So do the same thing and introduce reference counting for CPU ports and
DSA links using the same data structures as we have for MDB entries.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/dsa.h
net/dsa/dsa2.c
net/dsa/switch.c