@@ -587,7 +587,7 @@ static int prestera_port_attr_br_flags_set(struct prestera_port *port,
int err;
if (val.mask & ~(BR_LEARNING | BR_FLOOD | BR_MCAST_FLOOD))
- err = -EINVAL;
+ err = -EOPNOTSUPP;
br_port = prestera_bridge_port_by_dev(port->sw->swdev, dev);
if (!br_port)
@@ -661,7 +661,7 @@ static int mlxsw_sp_port_attr_br_flags_set(struct mlxsw_sp_port *mlxsw_sp_port,
int err;
if (val.mask & ~(BR_LEARNING | BR_FLOOD | BR_MCAST_FLOOD))
- return -EINVAL;
+ return -EOPNOTSUPP;
bridge_port = mlxsw_sp_bridge_port_find(mlxsw_sp_port->mlxsw_sp->bridge,
orig_dev);
@@ -1591,7 +1591,7 @@ rocker_world_port_attr_bridge_flags_set(struct rocker_port *rocker_port,
return err;
if (val.mask & ~brport_flags_s)
- return -EINVAL;
+ return -EOPNOTSUPP;
return wops->port_attr_bridge_flags_set(rocker_port, val.flags);
}
@@ -63,7 +63,7 @@ static int cpsw_port_attr_br_flags_set(struct cpsw_priv *priv,
bool unreg_mcast_add = false;
if (val.mask & ~(BR_LEARNING | BR_MCAST_FLOOD))
- return -EINVAL;
+ return -EOPNOTSUPP;
if (val.flags & BR_MCAST_FLOOD)
unreg_mcast_add = true;
@@ -915,7 +915,7 @@ static int dpaa2_switch_port_attr_br_flags_set(struct net_device *netdev,
int err = 0;
if (val.mask & ~(BR_LEARNING | BR_FLOOD))
- return -EINVAL;
+ return -EOPNOTSUPP;
/* Learning is enabled per switch */
err = dpaa2_switch_set_learning(port_priv->ethsw_data,
@@ -82,16 +82,7 @@ int br_switchdev_set_port_flag(struct net_bridge_port *p,
/* We run from atomic context here */
err = call_switchdev_notifiers(SWITCHDEV_PORT_ATTR_SET, p->dev,
&info.info, extack);
- err = notifier_to_errno(err);
- if (err == -EOPNOTSUPP)
- return 0;
-
- if (err) {
- NL_SET_ERR_MSG_MOD(extack, "bridge flag offload is not supported");
- return -EOPNOTSUPP;
- }
-
- return 0;
+ return notifier_to_errno(err);
}
static void
@@ -388,7 +388,7 @@ int dsa_port_bridge_flags(const struct dsa_port *dp,
struct dsa_switch *ds = dp->ds;
if (!ds->ops->port_bridge_flags)
- return -EINVAL;
+ return -EOPNOTSUPP;
return ds->ops->port_bridge_flags(ds, dp->index, val);
}