]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: felix: migrate host FDB and MDB entries when changing tag proto
authorVladimir Oltean <vladimir.oltean@nxp.com>
Wed, 2 Mar 2022 19:14:13 +0000 (21:14 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 3 Mar 2022 14:15:31 +0000 (14:15 +0000)
commit7b3dd4ce1f9a230c5d69ba7344faeab1f66e16a4
tree782023f61d4dd137c7242a1b92589c6bfc3be079
parentfc128f38e4619e5a16bd28726aa3fd035f95e2b7
net: dsa: felix: migrate host FDB and MDB entries when changing tag proto

The "ocelot" and "ocelot-8021q" tagging protocols make use of different
hardware resources, and host FDB entries have different destination
ports in the switch analyzer module, practically speaking.

So when the user requests a tagging protocol change, the driver must
migrate all host FDB and MDB entries from the NPI port (in fact CPU port
module) towards the same physical port, but this time used as a regular
port.

It is pointless for the felix driver to keep a copy of the host
addresses, when we can create and export DSA helpers for walking through
the addresses that it already needs to keep on the CPU port, for
refcounting purposes.

felix_classify_db() is moved up to avoid a forward declaration.

We pass "bool change" because dp->fdbs and dp->mdbs are uninitialized
lists when felix_setup() first calls felix_set_tag_protocol(), so we
need to avoid calling dsa_port_walk_fdbs() during probe time.

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