• V
    net: ocelot: support multiple bridges · df291e54
    Vladimir Oltean 提交于
    The ocelot switches are a bit odd in that they do not have an STP state
    to put the ports into. Instead, the forwarding configuration is delayed
    from the typical port_bridge_join into stp_state_set, when the port enters
    the BR_STATE_FORWARDING state.
    
    I can only guess that the implementation of this quirk is the reason that
    led to the simplification of the driver such that only one bridge could
    be offloaded at a time.
    
    We can simplify the data structures somewhat, and introduce a per-port
    bridge device pointer and STP state, similar to how the LAG offload
    works now (there we have a per-port bonding device pointer and TX
    enabled state). This allows offloading multiple bridges with relative
    ease, while still keeping in place the quirk to delay the programming of
    the PGIDs.
    
    We actually need this change now because we need to remove the bogus
    restriction from ocelot_bridge_stp_state_set that ocelot->bridge_mask
    needs to contain BIT(port), otherwise that function is a no-op.
    Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
    Signed-off-by: NDavid S. Miller <davem@davemloft.net>
    df291e54
ocelot.h 26.6 KB