[Bridge] [RFC PATCH v3 net-next 05/24] net: prestera: if the LAG that we're joining is under a bridge, join it

Vladimir Oltean vladimir.oltean at nxp.com
Mon Jul 12 15:21:23 UTC 2021

Some switchdev drivers, like mlxsw, 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

Signed-off-by: Vladimir Oltean <vladimir.oltean at nxp.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,
 	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;

More information about the Bridge mailing list