diff options
| author | Jakub Kicinski <[email protected]> | 2021-02-06 14:51:53 -0800 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2021-02-06 14:51:53 -0800 |
| commit | bfc213f15918a991b1aefbb3cf0c2cb618559efd (patch) | |
| tree | 6ab5fc32ec80cc2b113d606a6f021c1d9611df06 /include | |
| parent | 8d9dbce4e8c4a270c05eac48798d44e5676520f9 (diff) | |
| parent | 8fe6832e96acbf9d5777fc0b13e3e680ff46ba11 (diff) | |
Merge branch 'lag-offload-for-ocelot-dsa-switches'
Vladimir Oltean says:
====================
LAG offload for Ocelot DSA switches
This patch series reworks the ocelot switchdev driver such that it could
share the same implementation for LAG offload as the felix DSA driver.
Testing has been done in the following topology:
+----------------------------------+
| Board 1 br0 |
| +---------+ |
| / \ |
| | | |
| | bond0 |
| | +-----+ |
| | / \ |
| eno0 swp0 swp1 swp2 |
+---|--------|-------|-------|-----+
| | | |
+--------+ | |
Cable | |
Cable| |Cable
Cable | |
+--------+ | |
| | | |
+---|--------|-------|-------|-----+
| eno0 swp0 swp1 swp2 |
| | \ / |
| | +-----+ |
| | bond0 |
| | | |
| \ / |
| +---------+ |
| Board 2 br0 |
+----------------------------------+
The same script can be run on both Board 1 and Board 2 to set this up:
ip link del bond0
ip link add bond0 type bond mode balance-xor miimon 1
OR
ip link add bond0 type bond mode 802.3ad
ip link set swp1 down && ip link set swp1 master bond0 && ip link set swp1 up
ip link set swp2 down && ip link set swp2 master bond0 && ip link set swp2 up
ip link del br0
ip link add br0 type bridge
ip link set bond0 master br0
ip link set swp0 master br0
Then traffic can be tested between eno0 of Board 1 and eno0 of Board 2.
====================
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/soc/mscc/ocelot.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/soc/mscc/ocelot.h b/include/soc/mscc/ocelot.h index 6a61c499a30d..d0d48e9620fb 100644 --- a/include/soc/mscc/ocelot.h +++ b/include/soc/mscc/ocelot.h @@ -611,6 +611,9 @@ struct ocelot_port { u8 *xmit_template; bool is_dsa_8021q_cpu; + + struct net_device *bond; + bool lag_tx_active; }; struct ocelot { @@ -655,8 +658,6 @@ struct ocelot { enum ocelot_tag_prefix npi_inj_prefix; enum ocelot_tag_prefix npi_xtr_prefix; - u32 *lags; - struct list_head multicast; struct list_head pgids; @@ -797,6 +798,12 @@ int ocelot_port_mdb_add(struct ocelot *ocelot, int port, const struct switchdev_obj_port_mdb *mdb); int ocelot_port_mdb_del(struct ocelot *ocelot, int port, const struct switchdev_obj_port_mdb *mdb); +int ocelot_port_lag_join(struct ocelot *ocelot, int port, + struct net_device *bond, + struct netdev_lag_upper_info *info); +void ocelot_port_lag_leave(struct ocelot *ocelot, int port, + struct net_device *bond); +void ocelot_port_lag_change(struct ocelot *ocelot, int port, bool lag_tx_active); int ocelot_devlink_sb_register(struct ocelot *ocelot); void ocelot_devlink_sb_unregister(struct ocelot *ocelot); |