This is a note to let you know that I've just added the patch titled net: mscc: ocelot: allow unregistered IP multicast flooding to CPU to the 5.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: net-mscc-ocelot-allow-unregistered-ip-multicast-flooding-to-cpu.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From foo@baz Thu Jun 30 03:21:45 PM CEST 2022 From: Vladimir Oltean <vladimir.oltean@xxxxxxx> Date: Tue, 28 Jun 2022 20:20:15 +0300 Subject: net: mscc: ocelot: allow unregistered IP multicast flooding to CPU To: stable <stable@xxxxxxxxxxxxxxx>, Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>, Sasha Levin <sashal@xxxxxxxxxx> Cc: netdev@xxxxxxxxxxxxxxx, "David S. Miller" <davem@xxxxxxxxxxxxx>, Eric Dumazet <edumazet@xxxxxxxxxx>, Jakub Kicinski <kuba@xxxxxxxxxx>, Paolo Abeni <pabeni@xxxxxxxxxx>, Xiaoliang Yang <xiaoliang.yang_1@xxxxxxx>, Claudiu Manoil <claudiu.manoil@xxxxxxx>, Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx>, UNGLinuxDriver@xxxxxxxxxxxxx, Andrew Lunn <andrew@xxxxxxx>, Vivien Didelot <vivien.didelot@xxxxxxxxx>, Florian Fainelli <f.fainelli@xxxxxxxxx>, Maxim Kochetkov <fido_max@xxxxxxxx>, Colin Foster <colin.foster@xxxxxxxxxxxxxxxx>, stable@xxxxxxxxxx Message-ID: <20220628172016.3373243-4-vladimir.oltean@xxxxxxx> From: Vladimir Oltean <vladimir.oltean@xxxxxxx> Since commit 4cf35a2b627a ("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 7569459a52c9 ("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: a556c76adc05 ("net: mscc: Add initial Ocelot switch support") Cc: stable@xxxxxxxxxx Signed-off-by: Vladimir Oltean <vladimir.oltean@xxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/net/ethernet/mscc/ocelot.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/mscc/ocelot.c +++ b/drivers/net/ethernet/mscc/ocelot.c @@ -2208,9 +2208,13 @@ int ocelot_init(struct ocelot *ocelot) ANA_PGID_PGID, PGID_MC); ocelot_rmw_rix(ocelot, ANA_PGID_PGID_PGID(BIT(ocelot->num_phys_ports)), ANA_PGID_PGID_PGID(BIT(ocelot->num_phys_ports)), + ANA_PGID_PGID, PGID_MCIPV4); + ocelot_rmw_rix(ocelot, ANA_PGID_PGID_PGID(BIT(ocelot->num_phys_ports)), + ANA_PGID_PGID_PGID(BIT(ocelot->num_phys_ports)), + ANA_PGID_PGID, PGID_MCIPV6); + ocelot_rmw_rix(ocelot, ANA_PGID_PGID_PGID(BIT(ocelot->num_phys_ports)), + ANA_PGID_PGID_PGID(BIT(ocelot->num_phys_ports)), ANA_PGID_PGID, PGID_BC); - ocelot_write_rix(ocelot, 0, ANA_PGID_PGID, PGID_MCIPV4); - ocelot_write_rix(ocelot, 0, ANA_PGID_PGID, PGID_MCIPV6); /* Allow manual injection via DEVCPU_QS registers, and byte swap these * registers endianness. Patches currently in stable-queue which might be from vladimir.oltean@xxxxxxx are queue-5.15/net-mscc-ocelot-allow-unregistered-ip-multicast-flooding-to-cpu.patch