mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-04-01 12:04:08 +00:00
switchdev: respect SKIP_EOPNOTSUPP flag in case there is no recursion
Caller passing down the SKIP_EOPNOTSUPP switchdev flag expects that
-EOPNOTSUPP cannot be returned. But in case of direct op call without
recurtion, this may happen. So fix this by checking it always on the
end of __switchdev_port_attr_set function.
Fixes: 464314ea6c
("switchdev: skip over ports returning -EOPNOTSUPP when recursing ports")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
2a4f417621
commit
0c63d80c3f
1 changed files with 4 additions and 5 deletions
|
@ -225,8 +225,10 @@ static int __switchdev_port_attr_set(struct net_device *dev,
|
||||||
struct list_head *iter;
|
struct list_head *iter;
|
||||||
int err = -EOPNOTSUPP;
|
int err = -EOPNOTSUPP;
|
||||||
|
|
||||||
if (ops && ops->switchdev_port_attr_set)
|
if (ops && ops->switchdev_port_attr_set) {
|
||||||
return ops->switchdev_port_attr_set(dev, attr, trans);
|
err = ops->switchdev_port_attr_set(dev, attr, trans);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
if (attr->flags & SWITCHDEV_F_NO_RECURSE)
|
if (attr->flags & SWITCHDEV_F_NO_RECURSE)
|
||||||
goto done;
|
goto done;
|
||||||
|
@ -238,9 +240,6 @@ static int __switchdev_port_attr_set(struct net_device *dev,
|
||||||
|
|
||||||
netdev_for_each_lower_dev(dev, lower_dev, iter) {
|
netdev_for_each_lower_dev(dev, lower_dev, iter) {
|
||||||
err = __switchdev_port_attr_set(lower_dev, attr, trans);
|
err = __switchdev_port_attr_set(lower_dev, attr, trans);
|
||||||
if (err == -EOPNOTSUPP &&
|
|
||||||
attr->flags & SWITCHDEV_F_SKIP_EOPNOTSUPP)
|
|
||||||
continue;
|
|
||||||
if (err)
|
if (err)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue