Skip to content

Commit 945182d

Browse files
vladimirolteanjfvogel
authored andcommitted
net: mscc: ocelot: allow unregistered IP multicast flooding to CPU
Since commit 4cf35a2 ("net: mscc: ocelot: fix broken IP multicast flooding") from v5.12, unregistered IP multicast flooding is configurable in the ocelot driver for bridged ports. However, by writing 0 to the PGID_MCIPV4 and PGID_MCIPV6 port masks at initialization time, the CPU port module, for which ocelot_port_set_mcast_flood() is not called, will have unknown IP multicast flooding disabled. This makes it impossible for an application such as smcroute to work properly, since all IP multicast traffic received on a standalone port is treated as unregistered (and dropped). Starting with commit 7569459 ("net: dsa: manage flooding on the CPU ports"), the limitation above has been lifted, because when standalone ports become IFF_PROMISC or IFF_ALLMULTI, ocelot_port_set_mcast_flood() would be called on the CPU port module, so unregistered multicast is flooded to the CPU on an as-needed basis. But between v5.12 and v5.18, IP multicast flooding to the CPU has remained broken, promiscuous or not. Delete the inexplicable premature optimization of clearing PGID_MCIPV4 and PGID_MCIPV6 as part of the init sequence, and allow unregistered IP multicast to be flooded freely to the CPU port module. Fixes: a556c76 ("net: mscc: Add initial Ocelot switch support") Cc: [email protected] Signed-off-by: Vladimir Oltean <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 5696f7983d5d0dc070b4c0c07969d528aa553827) Signed-off-by: Jack Vogel <[email protected]>
1 parent bfa6ccf commit 945182d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/net/ethernet/mscc/ocelot.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2206,11 +2206,15 @@ int ocelot_init(struct ocelot *ocelot)
22062206
ocelot_rmw_rix(ocelot, ANA_PGID_PGID_PGID(BIT(ocelot->num_phys_ports)),
22072207
ANA_PGID_PGID_PGID(BIT(ocelot->num_phys_ports)),
22082208
ANA_PGID_PGID, PGID_MC);
2209+
ocelot_rmw_rix(ocelot, ANA_PGID_PGID_PGID(BIT(ocelot->num_phys_ports)),
2210+
ANA_PGID_PGID_PGID(BIT(ocelot->num_phys_ports)),
2211+
ANA_PGID_PGID, PGID_MCIPV4);
2212+
ocelot_rmw_rix(ocelot, ANA_PGID_PGID_PGID(BIT(ocelot->num_phys_ports)),
2213+
ANA_PGID_PGID_PGID(BIT(ocelot->num_phys_ports)),
2214+
ANA_PGID_PGID, PGID_MCIPV6);
22092215
ocelot_rmw_rix(ocelot, ANA_PGID_PGID_PGID(BIT(ocelot->num_phys_ports)),
22102216
ANA_PGID_PGID_PGID(BIT(ocelot->num_phys_ports)),
22112217
ANA_PGID_PGID, PGID_BC);
2212-
ocelot_write_rix(ocelot, 0, ANA_PGID_PGID, PGID_MCIPV4);
2213-
ocelot_write_rix(ocelot, 0, ANA_PGID_PGID, PGID_MCIPV6);
22142218

22152219
/* Allow manual injection via DEVCPU_QS registers, and byte swap these
22162220
* registers endianness.

0 commit comments

Comments
 (0)