net: dsa: felix: support FDB entries on offloaded LAG interfaces
authorVladimir Oltean <vladimir.oltean@nxp.com>
Wed, 23 Feb 2022 14:00:54 +0000 (16:00 +0200)
committerJakub Kicinski <kuba@kernel.org>
Fri, 25 Feb 2022 05:31:44 +0000 (21:31 -0800)
commit961d8b699070070fb3a9639af61641a52c8e49ef
treee7a6c1b75d8e98e4dd2bec8022da9fd5b95a4115
parente212fa7c54184b7b1f88990bd328b23b567cbf41
net: dsa: felix: support FDB entries on offloaded LAG interfaces

This adds the logic in the Felix DSA driver and Ocelot switch library.
For Ocelot switches, the DEST_IDX that is the output of the MAC table
lookup is a logical port (equal to physical port, if no LAG is used, or
a dynamically allocated number otherwise). The allocation we have in
place for LAG IDs is different from DSA's, so we can't use that:
- DSA allocates a continuous range of LAG IDs starting from 1
- Ocelot appears to require that physical ports and LAG IDs are in the
  same space of [0, num_phys_ports), and additionally, ports that aren't
  in a LAG must have physical port id == logical port id

The implication is that an FDB entry towards a LAG might need to be
deleted and reinstalled when the LAG ID changes.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/ocelot/felix.c
drivers/net/ethernet/mscc/ocelot.c
include/soc/mscc/ocelot.h