mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-10 16:42:21 +00:00
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>
This commit is contained in:
parent
3dc80afc50
commit
3f6e32f92a
3 changed files with 88 additions and 7 deletions
|
@ -348,6 +348,7 @@ static int dsa_port_setup(struct dsa_port *dp)
|
|||
if (dp->setup)
|
||||
return 0;
|
||||
|
||||
INIT_LIST_HEAD(&dp->fdbs);
|
||||
INIT_LIST_HEAD(&dp->mdbs);
|
||||
|
||||
switch (dp->type) {
|
||||
|
@ -471,6 +472,11 @@ static void dsa_port_teardown(struct dsa_port *dp)
|
|||
break;
|
||||
}
|
||||
|
||||
list_for_each_entry_safe(a, tmp, &dp->fdbs, list) {
|
||||
list_del(&a->list);
|
||||
kfree(a);
|
||||
}
|
||||
|
||||
list_for_each_entry_safe(a, tmp, &dp->mdbs, list) {
|
||||
list_del(&a->list);
|
||||
kfree(a);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue