• Russell King's avatar
    net: dsa: fix unintended change of bridge interface STP state · 9c2054a5
    Russell King authored
    When a DSA port is added to a bridge and brought up, the resulting STP
    state programmed into the hardware depends on the order that these
    operations are performed.  However, the Linux bridge code believes that
    the port is in disabled mode.
    
    If the DSA port is first added to a bridge and then brought up, it will
    be in blocking mode.  If it is brought up and then added to the bridge,
    it will be in disabled mode.
    
    This difference is caused by DSA always setting the STP mode in
    dsa_port_enable() whether or not this port is part of a bridge.  Since
    bridge always sets the STP state when the port is added, brought up or
    taken down, it is unnecessary for us to manipulate the STP state.
    
    Apparently, this code was copied from Rocker, and the very next day a
    similar fix for Rocker was merged but was not propagated to DSA.  See
    e47172ab ("rocker: put port in FORWADING state after leaving bridge")
    
    Fixes: b73adef6 ("net: dsa: integrate with SWITCHDEV for HW bridging")
    Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
    Reviewed-by: default avatarVivien Didelot <vivien.didelot@gmail.com>
    Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    9c2054a5
port.c 9.79 KB