netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell King <rmk+kernel@armlinux.org.uk>
To: Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	Ido Schimmel <idosch@idosch.org>
Cc: "David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, Jiri Pirko <jiri@resnulli.us>,
	Ivan Vecera <ivecera@redhat.com>,
	Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net-next 1/3] net: switchdev: do not propagate bridge updates across bridges
Date: Tue, 18 Feb 2020 11:46:09 +0000	[thread overview]
Message-ID: <E1j41KL-0002ur-QH@rmk-PC.armlinux.org.uk> (raw)
In-Reply-To: <20200218114515.GL18808@shell.armlinux.org.uk>

When configuring a tree of independent bridges, propagating changes
from the upper bridge across a bridge master to the lower bridge
ports brings surprises.

For example, a lower bridge may have vlan filtering enabled.  It
may have a vlan interface attached to the bridge master, which may
then be incorporated into another bridge.  As soon as the lower
bridge vlan interface is attached to the upper bridge, the lower
bridge has vlan filtering disabled.

This occurs because switchdev recursively applies its changes to
all lower devices no matter what.

Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Tested-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
---
 net/switchdev/switchdev.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
index 60630762a748..f25604d68337 100644
--- a/net/switchdev/switchdev.c
+++ b/net/switchdev/switchdev.c
@@ -475,6 +475,9 @@ static int __switchdev_handle_port_obj_add(struct net_device *dev,
 	 * necessary to go through this helper.
 	 */
 	netdev_for_each_lower_dev(dev, lower_dev, iter) {
+		if (netif_is_bridge_master(lower_dev))
+			continue;
+
 		err = __switchdev_handle_port_obj_add(lower_dev, port_obj_info,
 						      check_cb, add_cb);
 		if (err && err != -EOPNOTSUPP)
@@ -526,6 +529,9 @@ static int __switchdev_handle_port_obj_del(struct net_device *dev,
 	 * necessary to go through this helper.
 	 */
 	netdev_for_each_lower_dev(dev, lower_dev, iter) {
+		if (netif_is_bridge_master(lower_dev))
+			continue;
+
 		err = __switchdev_handle_port_obj_del(lower_dev, port_obj_info,
 						      check_cb, del_cb);
 		if (err && err != -EOPNOTSUPP)
@@ -576,6 +582,9 @@ static int __switchdev_handle_port_attr_set(struct net_device *dev,
 	 * necessary to go through this helper.
 	 */
 	netdev_for_each_lower_dev(dev, lower_dev, iter) {
+		if (netif_is_bridge_master(lower_dev))
+			continue;
+
 		err = __switchdev_handle_port_attr_set(lower_dev, port_attr_info,
 						       check_cb, set_cb);
 		if (err && err != -EOPNOTSUPP)
-- 
2.20.1


  reply	other threads:[~2020-02-18 11:46 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-18 11:45 [PATCH net-next 0/3] VLANs, DSA switches and multiple bridges Russell King - ARM Linux admin
2020-02-18 11:46 ` Russell King [this message]
2020-02-18 11:46 ` [PATCH net-next 2/3] net: dsa: mv88e6xxx: fix duplicate vlan warning Russell King
2020-02-18 11:51   ` Russell King - ARM Linux admin
2020-02-18 16:27     ` Andrew Lunn
2020-02-18 16:31       ` Russell King - ARM Linux admin
2020-02-20 18:12       ` Russell King - ARM Linux admin
2020-02-18 11:46 ` [PATCH net-next 3/3] net: dsa: mv88e6xxx: fix vlan setup Russell King
2020-02-18 19:09   ` Vivien Didelot
2020-02-18 19:34     ` Florian Fainelli
2020-02-18 23:48       ` Russell King - ARM Linux admin
2020-02-19  0:52         ` Vivien Didelot
2020-02-18 19:26 ` [PATCH net-next 0/3] VLANs, DSA switches and multiple bridges Florian Fainelli
2020-02-19  0:00 ` Florian Fainelli
2020-02-19  0:17   ` Russell King - ARM Linux admin
2020-02-19  0:33     ` Florian Fainelli
2020-02-19  0:58     ` Vivien Didelot
2020-02-19  3:47     ` Andrew Lunn
2020-02-19  9:19       ` Russell King - ARM Linux admin
2020-02-19 18:07         ` Vivien Didelot
2020-02-19 18:20           ` Florian Fainelli
2020-02-20 11:35           ` Russell King - ARM Linux admin
2020-02-19 18:52   ` Vladimir Oltean
2020-02-19 19:18     ` Florian Fainelli
2020-02-19 23:15       ` Russell King - ARM Linux admin
2020-02-20 18:56         ` Florian Fainelli
2020-02-21  0:21           ` Russell King - ARM Linux admin
2020-03-16 11:15             ` Russell King - ARM Linux admin
2020-03-17 12:00               ` Russell King - ARM Linux admin
2020-03-17 14:21                 ` Vladimir Oltean
2020-03-17 15:12                   ` Russell King - ARM Linux admin
2020-03-17 18:49                     ` Vivien Didelot
2020-03-17 21:24                       ` Russell King - ARM Linux admin
2020-03-18  2:26                         ` Vivien Didelot

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=E1j41KL-0002ur-QH@rmk-PC.armlinux.org.uk \
    --to=rmk+kernel@armlinux.org.uk \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=idosch@idosch.org \
    --cc=ivecera@redhat.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=vivien.didelot@gmail.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;
as well as URLs for NNTP newsgroup(s).