mbox series

[net-next,0/5] L2 multicast forwarding for Ocelot switch

Message ID 20201029022738.722794-1-vladimir.oltean@nxp.com
Headers show
Series L2 multicast forwarding for Ocelot switch | expand

Message

Vladimir Oltean Oct. 29, 2020, 2:27 a.m. UTC
This series enables the mscc_ocelot switch to forward raw L2 (non-IP)
mdb entries as configured by the bridge driver after this patch:

https://patchwork.ozlabs.org/project/netdev/patch/20201028233831.610076-1-vladimir.oltean@nxp.com/

Vladimir Oltean (5):
  net: mscc: ocelot: classify L2 mdb entries as LOCKED
  net: mscc: ocelot: use ether_addr_copy
  net: mscc: ocelot: remove the "new" variable in ocelot_port_mdb_add
  net: mscc: ocelot: make entry_type a member of struct ocelot_multicast
  net: mscc: ocelot: support L2 multicast entries

 drivers/net/ethernet/mscc/ocelot.c | 147 ++++++++++++++++++++---------
 drivers/net/ethernet/mscc/ocelot.h |  31 ++++--
 include/soc/mscc/ocelot.h          |   1 +
 3 files changed, 125 insertions(+), 54 deletions(-)

Comments

Florian Fainelli Oct. 29, 2020, 2:31 a.m. UTC | #1
On 10/28/2020 7:27 PM, Vladimir Oltean wrote:
> ocelot.h says:
> 
> /* MAC table entry types.
>  * ENTRYTYPE_NORMAL is subject to aging.
>  * ENTRYTYPE_LOCKED is not subject to aging.
>  * ENTRYTYPE_MACv4 is not subject to aging. For IPv4 multicast.
>  * ENTRYTYPE_MACv6 is not subject to aging. For IPv6 multicast.
>  */
> 
> We don't want the permanent entries added with 'bridge mdb' to be
> subject to aging.
> 
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Florian Fainelli Oct. 29, 2020, 2:41 a.m. UTC | #2
On 10/28/2020 7:27 PM, Vladimir Oltean wrote:
> There is one main difference in mscc_ocelot between IP multicast and L2
> multicast. With IP multicast, destination ports are encoded into the
> upper bytes of the multicast MAC address. Example: to deliver the
> address 01:00:5E:11:22:33 to ports 3, 8, and 9, one would need to
> program the address of 00:03:08:11:22:33 into hardware. Whereas for L2
> multicast, the MAC table entry points to a Port Group ID (PGID), and
> that PGID contains the port mask that the packet will be forwarded to.
> As to why it is this way, no clue. My guess is that not all port
> combinations can be supported simultaneously with the limited number of
> PGIDs, and this was somehow an issue for IP multicast but not for L2
> multicast. Anyway.
> 
> Prior to this change, the raw L2 multicast code was bogus, due to the
> fact that there wasn't really any way to test it using the bridge code.
> There were 2 issues:
> - A multicast PGID was allocated for each MDB entry, but it wasn't in
>   fact programmed to hardware. It was dummy.
> - In fact we don't want to reserve a multicast PGID for every single MDB
>   entry. That would be odd because we can only have ~60 PGIDs, but
>   thousands of MDB entries. So instead, we want to reserve a multicast
>   PGID for every single port combination for multicast traffic. And
>   since we can have 2 (or more) MDB entries delivered to the same port
>   group (and therefore PGID), we need to reference-count the PGIDs.
> 
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>

I believe you have the same gfp_t comment applicable here as in patch #4.
Jakub Kicinski Oct. 31, 2020, 1:27 a.m. UTC | #3
On Thu, 29 Oct 2020 04:27:33 +0200 Vladimir Oltean wrote:
> This series enables the mscc_ocelot switch to forward raw L2 (non-IP)
> mdb entries as configured by the bridge driver after this patch:
> 
> https://patchwork.ozlabs.org/project/netdev/patch/20201028233831.610076-1-vladimir.oltean@nxp.com/

Applied, thanks!