1 From 07c6f9805f12f1bb538ef165a092b300350384aa Mon Sep 17 00:00:00 2001
2 From: Russell King <rmk+kernel@armlinux.org.uk>
3 Date: Wed, 26 Feb 2020 17:14:21 +0000
4 Subject: [PATCH] net: switchdev: do not propagate bridge updates across
7 When configuring a tree of independent bridges, propagating changes
8 from the upper bridge across a bridge master to the lower bridge
9 ports brings surprises.
11 For example, a lower bridge may have vlan filtering enabled. It
12 may have a vlan interface attached to the bridge master, which may
13 then be incorporated into another bridge. As soon as the lower
14 bridge vlan interface is attached to the upper bridge, the lower
15 bridge has vlan filtering disabled.
17 This occurs because switchdev recursively applies its changes to
18 all lower devices no matter what.
20 Reviewed-by: Ido Schimmel <idosch@mellanox.com>
21 Tested-by: Ido Schimmel <idosch@mellanox.com>
22 Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
23 Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
24 Signed-off-by: David S. Miller <davem@davemloft.net>
26 net/switchdev/switchdev.c | 9 +++++++++
27 1 file changed, 9 insertions(+)
29 --- a/net/switchdev/switchdev.c
30 +++ b/net/switchdev/switchdev.c
31 @@ -476,6 +476,9 @@ static int __switchdev_handle_port_obj_a
32 * necessary to go through this helper.
34 netdev_for_each_lower_dev(dev, lower_dev, iter) {
35 + if (netif_is_bridge_master(lower_dev))
38 err = __switchdev_handle_port_obj_add(lower_dev, port_obj_info,
40 if (err && err != -EOPNOTSUPP)
41 @@ -528,6 +531,9 @@ static int __switchdev_handle_port_obj_d
42 * necessary to go through this helper.
44 netdev_for_each_lower_dev(dev, lower_dev, iter) {
45 + if (netif_is_bridge_master(lower_dev))
48 err = __switchdev_handle_port_obj_del(lower_dev, port_obj_info,
50 if (err && err != -EOPNOTSUPP)
51 @@ -579,6 +585,9 @@ static int __switchdev_handle_port_attr_
52 * necessary to go through this helper.
54 netdev_for_each_lower_dev(dev, lower_dev, iter) {
55 + if (netif_is_bridge_master(lower_dev))
58 err = __switchdev_handle_port_attr_set(lower_dev, port_attr_info,
60 if (err && err != -EOPNOTSUPP)