diff options
author | Vladimir Oltean <vladimir.oltean@nxp.com> | 2021-02-06 01:02:14 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-02-07 01:51:50 +0300 |
commit | b80af659699d212cf8cec6593f6551905c4ae86f (patch) | |
tree | 1b4d161fa1e1253cc2a4a80d505da8149ff91282 /include/soc | |
parent | f79c20c81723221b9c12d41d8d50c3fa93fbe791 (diff) | |
download | linux-b80af659699d212cf8cec6593f6551905c4ae86f.tar.xz |
net: mscc: ocelot: set up the bonding mask in a way that avoids a net_device
Since this code should be called from pure switchdev as well as from
DSA, we must find a way to determine the bonding mask not by looking
directly at the net_device lowers of the bonding interface, since those
could have different private structures.
We keep a pointer to the bonding upper interface, if present, in struct
ocelot_port. Then the bonding mask becomes the bitwise OR of all ports
that have the same bonding upper interface. This adds a duplication of
functionality with the current "lags" array, but the duplication will be
short-lived, since further patches will remove the latter completely.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/soc')
-rw-r--r-- | include/soc/mscc/ocelot.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/soc/mscc/ocelot.h b/include/soc/mscc/ocelot.h index 6a61c499a30d..e36a1ed29c01 100644 --- a/include/soc/mscc/ocelot.h +++ b/include/soc/mscc/ocelot.h @@ -611,6 +611,8 @@ struct ocelot_port { u8 *xmit_template; bool is_dsa_8021q_cpu; + + struct net_device *bond; }; struct ocelot { |