提交 2ee94014 编写于 作者: V Vivien Didelot 提交者: David S. Miller

net: switchdev: don't abort unsupported operations

There is no need to abort attribute setting or object addition, if the
prepare phase returned operation not supported.

Thus, abort these two transactions only if the error is not -EOPNOTSUPP.
Signed-off-by: NVivien Didelot <vivien.didelot@savoirfairelinux.com>
Acked-by: NJiri Pirko <jiri@resnulli.us>
Acked-by: NScott Feldman <sfeldma@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 c590032f
...@@ -171,8 +171,10 @@ int switchdev_port_attr_set(struct net_device *dev, struct switchdev_attr *attr) ...@@ -171,8 +171,10 @@ int switchdev_port_attr_set(struct net_device *dev, struct switchdev_attr *attr)
* released. * released.
*/ */
if (err != -EOPNOTSUPP) {
attr->trans = SWITCHDEV_TRANS_ABORT; attr->trans = SWITCHDEV_TRANS_ABORT;
__switchdev_port_attr_set(dev, attr); __switchdev_port_attr_set(dev, attr);
}
return err; return err;
} }
...@@ -249,8 +251,10 @@ int switchdev_port_obj_add(struct net_device *dev, struct switchdev_obj *obj) ...@@ -249,8 +251,10 @@ int switchdev_port_obj_add(struct net_device *dev, struct switchdev_obj *obj)
* released. * released.
*/ */
if (err != -EOPNOTSUPP) {
obj->trans = SWITCHDEV_TRANS_ABORT; obj->trans = SWITCHDEV_TRANS_ABORT;
__switchdev_port_obj_add(dev, obj); __switchdev_port_obj_add(dev, obj);
}
return err; return err;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册