Message ID | 20210214155326.1783266-4-olteanv@gmail.com |
---|---|
State | New |
Headers | show |
Series | Software fallback for bridging in DSA | expand |
On Sun, Feb 14, 2021 at 17:53, Vladimir Oltean <olteanv@gmail.com> wrote: > From: Vladimir Oltean <vladimir.oltean@nxp.com> > > There is currently some provisioning for DSA to use the software > fallback for link aggregation, but only if the .port_lag_join is > implemented but it fails (for example because there are more link > aggregation groups than the switch supports, or because the xmit hash > policy cannot be done in hardware, or ...). > > But when .port_lag_join is not implemented at all, the DSA switch > notifier returns zero and software fallback does not kick in. > Change that. > > Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> > --- Reviewed-by: Tobias Waldekranz <tobias@waldekranz.com>
diff --git a/net/dsa/switch.c b/net/dsa/switch.c index 4137716d0de5..15b0c936ba01 100644 --- a/net/dsa/switch.c +++ b/net/dsa/switch.c @@ -203,9 +203,13 @@ static int dsa_switch_lag_change(struct dsa_switch *ds, static int dsa_switch_lag_join(struct dsa_switch *ds, struct dsa_notifier_lag_info *info) { - if (ds->index == info->sw_index && ds->ops->port_lag_join) + if (ds->index == info->sw_index) { + if (!ds->ops->port_lag_join) + return -EOPNOTSUPP; + return ds->ops->port_lag_join(ds, info->port, info->lag, info->info); + } if (ds->index != info->sw_index && ds->ops->crosschip_lag_join) return ds->ops->crosschip_lag_join(ds, info->sw_index,