Message ID | 20210113084255.22675-1-tobias@waldekranz.com |
---|---|
Headers | show |
Series | net: dsa: Link aggregation support | expand |
On Wed, Jan 13, 2021 at 09:42:52AM +0100, Tobias Waldekranz wrote: > In a situation where a standalone port is indirectly attached to a > bridge (e.g. via a LAG) which is not offloaded, do not offload any > port attributes either. The port should behave as a standard NIC. > > Previously, on mv88e6xxx, this meant that in the following setup: > > br0 > / > team0 > / \ > swp0 swp1 > > If vlan filtering was enabled on br0, swp0's and swp1's QMode was set > to "secure". This caused all untagged packets to be dropped, as their > default VID (0) was not loaded into the VTU. > > Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com> > --- Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
On Wed, Jan 13, 2021 at 09:42:54AM +0100, Tobias Waldekranz wrote: > Support offloading of LAGs to hardware. LAGs may be attached to a > bridge in which case VLANs, multicast groups, etc. are also offloaded > as usual. > > Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com> > --- Reviewed-by: Vladimir Oltean <olteanv@gmail.com> > +static bool mv88e6xxx_lag_can_offload(struct dsa_switch *ds, > + struct net_device *lag, > + struct netdev_lag_upper_info *info) > +{ > + struct dsa_port *dp; > + int id, members = 0; > + > + id = dsa_lag_id(ds->dst, lag); > + if (id < 0 || id >= ds->num_lag_ids) This "id >= ds->num_lag_ids" condition is there just in the off chance that the mv88e6xxx could be bridged in the same DSA tree with another device that reports a higher ds->num_lag_ids such that dst->lags_len picks up that larger maximum, but otherwise the two switches have the same understanding of the LAG ID, and are compatible with one another? That sounds... plausible?
On Thu, Jan 14, 2021 at 02:50, Vladimir Oltean <olteanv@gmail.com> wrote: > On Wed, Jan 13, 2021 at 09:42:54AM +0100, Tobias Waldekranz wrote: >> Support offloading of LAGs to hardware. LAGs may be attached to a >> bridge in which case VLANs, multicast groups, etc. are also offloaded >> as usual. >> >> Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com> >> --- > > Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Thanks! >> +static bool mv88e6xxx_lag_can_offload(struct dsa_switch *ds, >> + struct net_device *lag, >> + struct netdev_lag_upper_info *info) >> +{ >> + struct dsa_port *dp; >> + int id, members = 0; >> + >> + id = dsa_lag_id(ds->dst, lag); >> + if (id < 0 || id >= ds->num_lag_ids) > > This "id >= ds->num_lag_ids" condition is there just in the off chance > that the mv88e6xxx could be bridged in the same DSA tree with another > device that reports a higher ds->num_lag_ids such that dst->lags_len > picks up that larger maximum, but otherwise the two switches have the > same understanding of the LAG ID, and are compatible with one another? Exactly so. > That sounds... plausible? While improbable, it is possible. Older 6xxx chips can only handle 16 LAGs, newer chips can handle up to 32. This is not supported by the driver at the moment - still it felt easier to add the check now, rather than having the future developer chase down the resulting bug in five years when they add that support.
Hello: This series was applied to netdev/net-next.git (refs/heads/master): On Wed, 13 Jan 2021 09:42:50 +0100 you wrote: > Start of by adding an extra notification when adding a port to a bond, > this allows static LAGs to be offloaded using the bonding driver. > > Then add the generic support required to offload link aggregates to > drivers built on top of the DSA subsystem. > > Finally, implement offloading for the mv88e6xxx driver, i.e. Marvell's > LinkStreet family. > > [...] Here is the summary with links: - [v5,net-next,1/5] net: bonding: Notify ports about their initial state https://git.kernel.org/netdev/net-next/c/32d4c5647aad - [v5,net-next,2/5] net: dsa: Don't offload port attributes on standalone ports https://git.kernel.org/netdev/net-next/c/5696c8aedfcc - [v5,net-next,3/5] net: dsa: Link aggregation support https://git.kernel.org/netdev/net-next/c/058102a6e9eb - [v5,net-next,4/5] net: dsa: mv88e6xxx: Link aggregation support https://git.kernel.org/netdev/net-next/c/57e661aae6a8 - [v5,net-next,5/5] net: dsa: tag_dsa: Support reception of packets from LAG devices https://git.kernel.org/netdev/net-next/c/5b60dadb71db You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html