Commit c84eacea authored by Ido Schimmel's avatar Ido Schimmel Committed by Kleber Sacilotto de Souza

mlxsw: spectrum: Don't forward packets when STP state is DISABLED

BugLink: https://bugs.launchpad.net/bugs/1878232

commit 9cb026eb upstream.

When STP state is set to DISABLED the port is assumed to be inactive, but
currently we forward packets ingressing through it.

Instead, set the port's STP state in hardware to DISCARDING, which means
it doesn't forward packets or perform any learning, but it does trap
control packets. However, these packets will be dropped by bridge code,
which results in the expected behavior.

Fixes: 56ade8fe ("mlxsw: spectrum: Add initial support for Spectrum ASIC")
Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarIan May <ian.may@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent d8ec74b6
...@@ -87,7 +87,6 @@ static int mlxsw_sp_port_stp_state_set(struct mlxsw_sp_port *mlxsw_sp_port, ...@@ -87,7 +87,6 @@ static int mlxsw_sp_port_stp_state_set(struct mlxsw_sp_port *mlxsw_sp_port,
int err; int err;
switch (state) { switch (state) {
case BR_STATE_DISABLED: /* fall-through */
case BR_STATE_FORWARDING: case BR_STATE_FORWARDING:
spms_state = MLXSW_REG_SPMS_STATE_FORWARDING; spms_state = MLXSW_REG_SPMS_STATE_FORWARDING;
break; break;
...@@ -95,6 +94,7 @@ static int mlxsw_sp_port_stp_state_set(struct mlxsw_sp_port *mlxsw_sp_port, ...@@ -95,6 +94,7 @@ static int mlxsw_sp_port_stp_state_set(struct mlxsw_sp_port *mlxsw_sp_port,
case BR_STATE_LEARNING: case BR_STATE_LEARNING:
spms_state = MLXSW_REG_SPMS_STATE_LEARNING; spms_state = MLXSW_REG_SPMS_STATE_LEARNING;
break; break;
case BR_STATE_DISABLED: /* fall-through */
case BR_STATE_BLOCKING: case BR_STATE_BLOCKING:
spms_state = MLXSW_REG_SPMS_STATE_DISCARDING; spms_state = MLXSW_REG_SPMS_STATE_DISCARDING;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment