Re: [RFC PATCH 0/4] net: dsa: link aggregation support

Vladimir Oltean
2020-11-19T18:13:03Z

On Thu, Nov 19, 2020 at 12:52:14PM +0100, Tobias Waldekranz wrote:
> > it appears that I don't need the .port_lag_change callback, and that the
>
> Ok, does ocelot automatically rebalance the LAG based on link state? I
> took a quick look through the datasheet for another switch from
> Vitesse, and it explicitly states that you need to update a table on
> link changes.
>
> I.e. in this situation:
>
> br0
> / |
> lag |
> /|\ |
> 1 2 3 4
> | | | \
> | | | B
> | | |
> 1 2 3
> A
>
> If you unplug cable 1, does the hardware rebalance all flows between
> A<->B to only use 2 and 3 without software assistance? If not, you
> will loose 1/3 of your flows.

Yes, you're right, the switch doesn't rebalance the aggregation codes
across the remaining ports automatically. In my mind I was subconsiously
hoping that would be the case, because I need to make use of the
information in struct dsa_lag in non-DSA code (long story, but the
drivers/net/dsa/ocelot code shares the implementation with
drivers/net/ethernet/mscc/ocelot* which is a switchdev-only driver).
It doesn't mean that keeping state in dp->lag is the wrong thing to do,
it's just that this is an extra challenge for an already odd driver,
that I will have to see how I deal with :D