Netdev List
 help / color / mirror / Atom feed
From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org
Cc: Vadym Kochan <vkochan@marvell.com>,
	Taras Chornyi <tchornyi@marvell.com>,
	Andrii Savka <andrii.savka@plvision.eu>,
	Serhiy Boiko <serhiy.boiko@plvision.eu>,
	Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Ido Schimmel <idosch@idosch.org>
Subject: [PATCH net] net: marvell: prestera: if the LAG that we're joining is under a bridge, join it
Date: Tue, 13 Jul 2021 12:28:04 +0300	[thread overview]
Message-ID: <20210713092804.938365-1-vladimir.oltean@nxp.com> (raw)

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


             reply	other threads:[~2021-07-13  9:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-13  9:28 Vladimir Oltean [this message]
     [not found] ` <bace67fc-2904-1903-71bb-684eb73d1f41@marvell.com>
2021-07-13 14:35   ` [EXT] [PATCH net] net: marvell: prestera: if the LAG that we're joining is under a bridge, join it Vladimir Oltean

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210713092804.938365-1-vladimir.oltean@nxp.com \
    --to=vladimir.oltean@nxp.com \
    --cc=andrew@lunn.ch \
    --cc=andrii.savka@plvision.eu \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=idosch@idosch.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=serhiy.boiko@plvision.eu \
    --cc=tchornyi@marvell.com \
    --cc=vkochan@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox