Commit 07c6f980 authored by Russell King's avatar Russell King Committed by David S. Miller

net: switchdev: do not propagate bridge updates across bridges

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: default avatarIdo Schimmel <idosch@mellanox.com>
Tested-by: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9baeea50
...@@ -475,6 +475,9 @@ static int __switchdev_handle_port_obj_add(struct net_device *dev, ...@@ -475,6 +475,9 @@ static int __switchdev_handle_port_obj_add(struct net_device *dev,
* necessary to go through this helper. * necessary to go through this helper.
*/ */
netdev_for_each_lower_dev(dev, lower_dev, iter) { 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, err = __switchdev_handle_port_obj_add(lower_dev, port_obj_info,
check_cb, add_cb); check_cb, add_cb);
if (err && err != -EOPNOTSUPP) if (err && err != -EOPNOTSUPP)
...@@ -526,6 +529,9 @@ static int __switchdev_handle_port_obj_del(struct net_device *dev, ...@@ -526,6 +529,9 @@ static int __switchdev_handle_port_obj_del(struct net_device *dev,
* necessary to go through this helper. * necessary to go through this helper.
*/ */
netdev_for_each_lower_dev(dev, lower_dev, iter) { 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, err = __switchdev_handle_port_obj_del(lower_dev, port_obj_info,
check_cb, del_cb); check_cb, del_cb);
if (err && err != -EOPNOTSUPP) if (err && err != -EOPNOTSUPP)
...@@ -576,6 +582,9 @@ static int __switchdev_handle_port_attr_set(struct net_device *dev, ...@@ -576,6 +582,9 @@ static int __switchdev_handle_port_attr_set(struct net_device *dev,
* necessary to go through this helper. * necessary to go through this helper.
*/ */
netdev_for_each_lower_dev(dev, lower_dev, iter) { 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, err = __switchdev_handle_port_attr_set(lower_dev, port_attr_info,
check_cb, set_cb); check_cb, set_cb);
if (err && err != -EOPNOTSUPP) if (err && err != -EOPNOTSUPP)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment