]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: felix: actually disable flooding towards NPI port
authorVladimir Oltean <vladimir.oltean@nxp.com>
Tue, 8 Mar 2022 09:15:14 +0000 (11:15 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Mar 2022 11:12:10 +0000 (11:12 +0000)
commit4a6954836da13d6ec990d619b7b890da42a1276b
tree20911cde337a234667dde9a64412da4ee77c0315
parent573baf532cc37d2480db9bd9a91412f9253d2dae
net: dsa: felix: actually disable flooding towards NPI port

The two blamed commits were written/tested individually but not
together.

When put together, commit e8304b88e8d2 ("net: dsa: felix: start off with
flooding disabled on the CPU port"), which deletes a reinitialization of
PGID_UC/PGID_MC/PGID_BC, is no longer sufficient to ensure that these
port masks don't contain the CPU port module.

This is because commit 89d507436665 ("net: dsa: felix: migrate flood
settings from NPI to tag_8021q CPU port") overwrites the hardware
default settings towards the CPU port module with the settings that used
to be present on the NPI port treated as a regular port. There, flooding
is enabled, so flooding would get enabled on the CPU port module too.

Adding conditional logic somewhere within felix_setup_tag_npi() to
configure either the default no-flood policy or the flood policy
inherited from the tag_8021q CPU port from a previous call to
dsa_port_manage_cpu_flood() is getting complicated. So just let the
migration logic do its thing during initial setup (which will
temporarily turn on flooding), then turn flooding off for the NPI port
after felix_set_tag_protocol() finishes. Here we are in felix_setup(),
so the DSA slave interfaces are not yet created, and this doesn't affect
traffic in any way.

Fixes: e8304b88e8d2 ("net: dsa: felix: start off with flooding disabled on the CPU port")
Fixes: 89d507436665 ("net: dsa: felix: migrate flood settings from NPI to tag_8021q CPU port")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/ocelot/felix.c