]> git.baikalelectronics.ru Git - kernel.git/commit
net: mscc: ocelot: Fix multicast to the CPU port
authorAlban Bedel <alban.bedel@aerq.com>
Tue, 19 Jan 2021 14:06:38 +0000 (15:06 +0100)
committerJakub Kicinski <kuba@kernel.org>
Wed, 20 Jan 2021 16:59:28 +0000 (08:59 -0800)
commita6bdad795aecc45e81fa61960218135b9a7dd1fc
treef9c92b4d87f1a2492cc0caaf6a656caa0582db40
parentcf5cd1313ad31a8a155f2a0b743997117e7b926b
net: mscc: ocelot: Fix multicast to the CPU port

Multicast entries in the MAC table use the high bits of the MAC
address to encode the ports that should get the packets. But this port
mask does not work for the CPU port, to receive these packets on the
CPU port the MAC_CPU_COPY flag must be set.

Because of this IPv6 was effectively not working because neighbor
solicitations were never received. This was not apparent before commit
6e0d2490 (net: mscc: ocelot: support IPv4, IPv6 and plain Ethernet mdb
entries) as the IPv6 entries were broken so all incoming IPv6
multicast was then treated as unknown and flooded on all ports.

To fix this problem rework the ocelot_mact_learn() to set the
MAC_CPU_COPY flag when a multicast entry that target the CPU port is
added. For this we have to read back the ports endcoded in the pseudo
MAC address by the caller. It is not a very nice design but that avoid
changing the callers and should make backporting easier.

Signed-off-by: Alban Bedel <alban.bedel@aerq.com>
Fixes: 6e0d2490a506 ("net: mscc: ocelot: support IPv4, IPv6 and plain Ethernet mdb entries")
Link: https://lore.kernel.org/r/20210119140638.203374-1-alban.bedel@aerq.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mscc/ocelot.c