diff options
author | Vladimir Oltean <vladimir.oltean@nxp.com> | 2021-03-19 02:36:36 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-03-19 05:13:42 +0300 |
commit | df291e54ccca0ef357f07a7b89263f7918d6ed7a (patch) | |
tree | 77686b1c5d1b263488120b918892a4eeeb6657ef /include/soc/mscc/ocelot.h | |
parent | d25fde64d1c271277b801c57a954037f80babbd1 (diff) | |
download | linux-df291e54ccca0ef357f07a7b89263f7918d6ed7a.tar.xz |
net: ocelot: support multiple bridges
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: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/soc/mscc/ocelot.h')
-rw-r--r-- | include/soc/mscc/ocelot.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/include/soc/mscc/ocelot.h b/include/soc/mscc/ocelot.h index 0a0751bf97dd..ce7e5c1bd90d 100644 --- a/include/soc/mscc/ocelot.h +++ b/include/soc/mscc/ocelot.h @@ -615,6 +615,9 @@ struct ocelot_port { bool lag_tx_active; u16 mrp_ring_id; + + struct net_device *bridge; + u8 stp_state; }; struct ocelot { @@ -634,10 +637,6 @@ struct ocelot { int num_frame_refs; int num_mact_rows; - struct net_device *hw_bridge_dev; - u16 bridge_mask; - u16 bridge_fwd_mask; - struct ocelot_port **ports; u8 base_mac[ETH_ALEN]; |