diff options
-rw-r--r-- | net/switchdev/switchdev.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c index c9bfa004abed..46568b85c333 100644 --- a/net/switchdev/switchdev.c +++ b/net/switchdev/switchdev.c | |||
@@ -47,11 +47,20 @@ EXPORT_SYMBOL_GPL(netdev_switch_parent_id_get); | |||
47 | int netdev_switch_port_stp_update(struct net_device *dev, u8 state) | 47 | int netdev_switch_port_stp_update(struct net_device *dev, u8 state) |
48 | { | 48 | { |
49 | const struct swdev_ops *ops = dev->swdev_ops; | 49 | const struct swdev_ops *ops = dev->swdev_ops; |
50 | struct net_device *lower_dev; | ||
51 | struct list_head *iter; | ||
52 | int err = -EOPNOTSUPP; | ||
50 | 53 | ||
51 | if (!ops || !ops->swdev_port_stp_update) | 54 | if (ops && ops->swdev_port_stp_update) |
52 | return -EOPNOTSUPP; | 55 | return ops->swdev_port_stp_update(dev, state); |
53 | WARN_ON(!ops->swdev_parent_id_get); | 56 | |
54 | return ops->swdev_port_stp_update(dev, state); | 57 | netdev_for_each_lower_dev(dev, lower_dev, iter) { |
58 | err = netdev_switch_port_stp_update(lower_dev, state); | ||
59 | if (err && err != -EOPNOTSUPP) | ||
60 | return err; | ||
61 | } | ||
62 | |||
63 | return err; | ||
55 | } | 64 | } |
56 | EXPORT_SYMBOL_GPL(netdev_switch_port_stp_update); | 65 | EXPORT_SYMBOL_GPL(netdev_switch_port_stp_update); |
57 | 66 | ||