[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20210713092804.938365-1-vladimir.oltean@nxp.com>
Date: Tue, 13 Jul 2021 12:28:04 +0300
From: Vladimir Oltean <vladimir.oltean@....com>
To: "David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org
Cc: Vadym Kochan <vkochan@...vell.com>,
Taras Chornyi <tchornyi@...vell.com>,
Andrii Savka <andrii.savka@...ision.eu>,
Serhiy Boiko <serhiy.boiko@...ision.eu>,
Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
Ido Schimmel <idosch@...sch.org>
Subject: [PATCH net] net: marvell: prestera: if the LAG that we're joining is under a bridge, join it
Some switchdev drivers, like mlxsw since commit 25cc72a33835 ("mlxsw:
spectrum: Forbid linking to devices that have uppers"), refuse to join a
LAG that already is under a bridge, while others, like DSA since commit
185c9a760a61 ("net: dsa: call dsa_port_bridge_join when joining a LAG
that is already in a bridge"), prefer to handle that case and join the
bridge that is an upper of the LAG, if that exists.
The prestera driver does none of those, so let's replicate what DSA
does.
Fixes: 255213ca6887 ("net: marvell: prestera: add LAG support")
Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
---
drivers/net/ethernet/marvell/prestera/prestera_main.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/net/ethernet/marvell/prestera/prestera_main.c b/drivers/net/ethernet/marvell/prestera/prestera_main.c
index 226f4ff29f6e..979214ce1952 100644
--- a/drivers/net/ethernet/marvell/prestera/prestera_main.c
+++ b/drivers/net/ethernet/marvell/prestera/prestera_main.c
@@ -567,6 +567,14 @@ static int prestera_lag_port_add(struct prestera_port *port,
lag->member_count++;
port->lag = lag;
+ if (netif_is_bridge_port(lag_dev)) {
+ struct net_device *br_dev;
+
+ br_dev = netdev_master_upper_dev_get(lag_dev);
+
+ return prestera_bridge_port_join(br_dev, port);
+ }
+
return 0;
}
--
2.25.1
Powered by blists - more mailing lists