]> git.baikalelectronics.ru Git - kernel.git/commit
net: mscc: ocelot: fix forwarding from BLOCKING ports remaining enabled
authorVladimir Oltean <vladimir.oltean@nxp.com>
Thu, 23 Sep 2021 02:03:38 +0000 (19:03 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 23 Sep 2021 12:15:31 +0000 (13:15 +0100)
commit733b9ffcf524a94a5cc16ae319c329dffe6a9973
tree945666954ee9f3393b5dc006cbe57335cce9d426
parent172e2ac6f4fa012d7fa2ae8384b4e7a47882aee2
net: mscc: ocelot: fix forwarding from BLOCKING ports remaining enabled

The blamed commit made the fatally incorrect assumption that ports which
aren't in the FORWARDING STP state should not have packets forwarded
towards them, and that is all that needs to be done.

However, that logic alone permits BLOCKING ports to forward to
FORWARDING ports, which of course allows packet storms to occur when
there is an L2 loop.

The ocelot_get_bridge_fwd_mask should not only ask "what can the bridge
do for you", but "what can you do for the bridge". This way, only
FORWARDING ports forward to the other FORWARDING ports from the same
bridging domain, and we are still compatible with the idea of multiple
bridges.

Fixes: 4b0c7c054d34 ("net: ocelot: support multiple bridges")
Suggested-by: Colin Foster <colin.foster@in-advantage.com>
Reported-by: Colin Foster <colin.foster@in-advantage.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mscc/ocelot.c