Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH net] net: marvell: prestera: if the LAG that we're joining is under a bridge, join it
@ 2021-07-13 9:28 Vladimir Oltean
[not found] ` <bace67fc-2904-1903-71bb-684eb73d1f41@marvell.com>
0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Oltean @ 2021-07-13 9:28 UTC (permalink / raw)
To: David S. Miller, Jakub Kicinski, netdev
Cc: Vadym Kochan, Taras Chornyi, Andrii Savka, Serhiy Boiko,
Andrew Lunn, Florian Fainelli, Ido Schimmel
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@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,
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [EXT] [PATCH net] net: marvell: prestera: if the LAG that we're joining is under a bridge, join it
[not found] ` <bace67fc-2904-1903-71bb-684eb73d1f41@marvell.com>
@ 2021-07-13 14:35 ` Vladimir Oltean
0 siblings, 0 replies; 2+ messages in thread
From: Vladimir Oltean @ 2021-07-13 14:35 UTC (permalink / raw)
To: Taras Chornyi
Cc: David S. Miller, Jakub Kicinski, netdev, Vadym Kochan,
Andrii Savka, Serhiy Boiko, Andrew Lunn, Florian Fainelli,
Ido Schimmel
Hi Taras,
On Tue, Jul 13, 2021 at 05:07:49PM +0300, Taras Chornyi wrote:
> Driver will not allow to enslave port to a bound if bond has any upper
>
> There is a check for this in prestera_netdev_port_event
>
> if (netdev_has_any_upper_dev(upper)) {
> NL_SET_ERR_MSG_MOD(extack, "Upper device is already enslaved");
> return -EINVAL;
> }
>
> > return 0;
> > }
I didn't notice that, let me drop this patch in that case then.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-07-13 14:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-13 9:28 [PATCH net] net: marvell: prestera: if the LAG that we're joining is under a bridge, join it Vladimir Oltean
[not found] ` <bace67fc-2904-1903-71bb-684eb73d1f41@marvell.com>
2021-07-13 14:35 ` [EXT] " Vladimir Oltean
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).