Skip to content

Commit

Permalink
net: dsa: return -EOPNOTSUPP when driver does not implement .port_lag…
Browse files Browse the repository at this point in the history
…_join

The DSA core has a layered structure, and even though we end up
returning 0 (success) to user space when setting a bonding/team upper
that can't be offloaded, some parts of the framework actually need to
know that we couldn't offload that.

For example, if dsa_switch_lag_join returns 0 as it currently does,
dsa_port_lag_join has no way to tell a successful offload from a
software fallback, and it will call dsa_port_bridge_join afterwards.
Then we'll think we're offloading the bridge master of the LAG, when in
fact we're not even offloading the LAG. In turn, this will make us set
skb->offload_fwd_mark = true, which is incorrect and the bridge doesn't
like it.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Vladimir Oltean authored and David S. Miller committed Jul 1, 2021
1 parent e6a1604 commit b71d098
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/dsa/switch.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ static int dsa_switch_lag_join(struct dsa_switch *ds,
info->port, info->lag,
info->info);

return 0;
return -EOPNOTSUPP;
}

static int dsa_switch_lag_leave(struct dsa_switch *ds,
Expand All @@ -440,7 +440,7 @@ static int dsa_switch_lag_leave(struct dsa_switch *ds,
return ds->ops->crosschip_lag_leave(ds, info->sw_index,
info->port, info->lag);

return 0;
return -EOPNOTSUPP;
}

static int dsa_switch_mdb_add(struct dsa_switch *ds,
Expand Down

0 comments on commit b71d098

Please sign in to comment.