Re: [PATCH net-next] net: dsa: mt7530: add support for changing DSA master
From: Vladimir Oltean
Date: Fri Feb 10 2023 - 17:27:31 EST
On Fri, Feb 10, 2023 at 09:41:06PM +0000, Richard van Schagen wrote:
> > I believe you need to reject LAG DSA masters.
>
> Not sure what you mean: how is this different from the change_master in the Felix driver when using 8021q tags?
> But. Can add a check if you prefer. It might be a good idea anyway to be future proof. The MT7531 has support for LAG in hw.
I mean, like Documentation/networking/dsa/configuration.rst says, that the user can attempt
to put the DSA masters in a LAG and create a larger DSA master which is that bonding device.
The difference from the Felix driver is that Felix supports LAG DSA masters and this driver doesn't.
I don't believe there is any other restriction in the code which would prevent a driver which
implements port_change_master() from accepting that as a valid configuration, so it's going to
be the mt7530 driver who acts as the final frontier in this case.
An "if (netif_is_lag_master(master)) return -EOPNOTSUPP" will do. But it would always be good
to check if it's really needed :)