lkml.org 
[lkml]   [2020]   [May]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.4 106/312] mlxsw: spectrum: Disable learning according to STP state
    Date
    From: Ido Schimmel <idosch@mellanox.com>

    commit 454911333b1d86e1d58a557be271bc6b7e9e7f10 upstream.

    When port is put into LISTENING state it shouldn't populate the FDB, so
    set the port's STP state in hardware to DISCARDING instead of LEARNING.
    It will therefore keep listening to BPDU packets, but discard other
    non-control packets and won't perform any learning.

    Fixes: 56ade8fe3fe1 ("mlxsw: spectrum: Add initial support for Spectrum ASIC")
    Signed-off-by: Ido Schimmel <idosch@mellanox.com>
    Signed-off-by: Jiri Pirko <jiri@mellanox.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
    +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
    @@ -90,10 +90,10 @@ static int mlxsw_sp_port_stp_state_set(s
    case BR_STATE_FORWARDING:
    spms_state = MLXSW_REG_SPMS_STATE_FORWARDING;
    break;
    - case BR_STATE_LISTENING: /* fall-through */
    case BR_STATE_LEARNING:
    spms_state = MLXSW_REG_SPMS_STATE_LEARNING;
    break;
    + case BR_STATE_LISTENING: /* fall-through */
    case BR_STATE_DISABLED: /* fall-through */
    case BR_STATE_BLOCKING:
    spms_state = MLXSW_REG_SPMS_STATE_DISCARDING;

    \
     
     \ /
      Last update: 2020-05-08 14:43    [W:4.081 / U:0.180 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site