diff options
| -rw-r--r-- | include/net/switchdev.h | 1 | ||||
| -rw-r--r-- | net/switchdev/switchdev.c | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/include/net/switchdev.h b/include/net/switchdev.h index 61f129bd74b2..1ce70830357d 100644 --- a/include/net/switchdev.h +++ b/include/net/switchdev.h | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include <linux/list.h> | 16 | #include <linux/list.h> |
| 17 | 17 | ||
| 18 | #define SWITCHDEV_F_NO_RECURSE BIT(0) | 18 | #define SWITCHDEV_F_NO_RECURSE BIT(0) |
| 19 | #define SWITCHDEV_F_SKIP_EOPNOTSUPP BIT(1) | ||
| 19 | 20 | ||
| 20 | struct switchdev_trans_item { | 21 | struct switchdev_trans_item { |
| 21 | struct list_head list; | 22 | struct list_head list; |
diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c index 6e4a4f9ad927..7a9ab90363be 100644 --- a/net/switchdev/switchdev.c +++ b/net/switchdev/switchdev.c | |||
| @@ -147,7 +147,7 @@ static int __switchdev_port_attr_set(struct net_device *dev, | |||
| 147 | return ops->switchdev_port_attr_set(dev, attr, trans); | 147 | return ops->switchdev_port_attr_set(dev, attr, trans); |
| 148 | 148 | ||
| 149 | if (attr->flags & SWITCHDEV_F_NO_RECURSE) | 149 | if (attr->flags & SWITCHDEV_F_NO_RECURSE) |
| 150 | return err; | 150 | goto done; |
| 151 | 151 | ||
| 152 | /* Switch device port(s) may be stacked under | 152 | /* Switch device port(s) may be stacked under |
| 153 | * bond/team/vlan dev, so recurse down to set attr on | 153 | * bond/team/vlan dev, so recurse down to set attr on |
| @@ -156,10 +156,17 @@ static int __switchdev_port_attr_set(struct net_device *dev, | |||
| 156 | 156 | ||
| 157 | netdev_for_each_lower_dev(dev, lower_dev, iter) { | 157 | netdev_for_each_lower_dev(dev, lower_dev, iter) { |
| 158 | err = __switchdev_port_attr_set(lower_dev, attr, trans); | 158 | err = __switchdev_port_attr_set(lower_dev, attr, trans); |
| 159 | if (err == -EOPNOTSUPP && | ||
| 160 | attr->flags & SWITCHDEV_F_SKIP_EOPNOTSUPP) | ||
| 161 | continue; | ||
| 159 | if (err) | 162 | if (err) |
| 160 | break; | 163 | break; |
| 161 | } | 164 | } |
| 162 | 165 | ||
| 166 | done: | ||
| 167 | if (err == -EOPNOTSUPP && attr->flags & SWITCHDEV_F_SKIP_EOPNOTSUPP) | ||
| 168 | err = 0; | ||
| 169 | |||
| 163 | return err; | 170 | return err; |
| 164 | } | 171 | } |
| 165 | 172 | ||
