]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Jun 2022 13:29:38 +0000 (15:29 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Jun 2022 13:29:38 +0000 (15:29 +0200)
added patches:
net-mscc-ocelot-allow-unregistered-ip-multicast-flooding.patch

queue-5.10/net-mscc-ocelot-allow-unregistered-ip-multicast-flooding.patch [new file with mode: 0644]
queue-5.10/series

diff --git a/queue-5.10/net-mscc-ocelot-allow-unregistered-ip-multicast-flooding.patch b/queue-5.10/net-mscc-ocelot-allow-unregistered-ip-multicast-flooding.patch
new file mode 100644 (file)
index 0000000..66082a2
--- /dev/null
@@ -0,0 +1,64 @@
+From foo@baz Thu Jun 30 03:22:13 PM CEST 2022
+From: Vladimir Oltean <vladimir.oltean@nxp.com>
+Date: Tue, 28 Jun 2022 20:20:14 +0300
+Subject: net: mscc: ocelot: allow unregistered IP multicast flooding
+To: stable <stable@vger.kernel.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Sasha Levin <sashal@kernel.org>
+Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Xiaoliang Yang <xiaoliang.yang_1@nxp.com>, Claudiu Manoil <claudiu.manoil@nxp.com>, Alexandre Belloni <alexandre.belloni@bootlin.com>, UNGLinuxDriver@microchip.com, Andrew Lunn <andrew@lunn.ch>, Vivien Didelot <vivien.didelot@gmail.com>, Florian Fainelli <f.fainelli@gmail.com>, Maxim Kochetkov <fido_max@inbox.ru>, Colin Foster <colin.foster@in-advantage.com>, stable@kernel.org
+Message-ID: <20220628172016.3373243-3-vladimir.oltean@nxp.com>
+
+From: Vladimir Oltean <vladimir.oltean@nxp.com>
+
+Flooding of unregistered IP multicast has been broken (both to other
+switch ports and to the CPU) since the ocelot driver introduction, and
+up until commit 4cf35a2b627a ("net: mscc: ocelot: fix broken IP
+multicast flooding"), a bug fix for commit 421741ea5672 ("net: mscc:
+ocelot: offload bridge port flags to device") from v5.12.
+
+The driver used to set PGID_MCIPV4 and PGID_MCIPV6 to the empty port
+mask (0), which made unregistered IPv4/IPv6 multicast go nowhere, and
+without ever modifying that port mask at runtime.
+
+The expectation is that such packets are treated as broadcast, and
+flooded according to the forwarding domain (to the CPU if the port is
+standalone, or to the CPU and other bridged ports, if under a bridge).
+
+Since the aforementioned commit, the limitation has been lifted by
+responding to SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS events emitted by the
+bridge. As for host flooding, DSA synthesizes another call to
+ocelot_port_bridge_flags() on the NPI port which ensures that the CPU
+gets the unregistered multicast traffic it might need, for example for
+smcroute to work between standalone ports.
+
+But between v4.18 and v5.12, IP multicast flooding has remained unfixed.
+
+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 according to the forwarding domain
+established by PGID_SRC, by explicitly programming PGID_MCIPV4 and
+PGID_MCIPV6 towards all physical ports plus the CPU port module.
+
+Fixes: a556c76adc05 ("net: mscc: Add initial Ocelot switch support")
+Cc: stable@kernel.org
+Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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
+@@ -1593,8 +1593,12 @@ int ocelot_init(struct ocelot *ocelot)
+       ocelot_write_rix(ocelot,
+                        ANA_PGID_PGID_PGID(GENMASK(ocelot->num_phys_ports, 0)),
+                        ANA_PGID_PGID, PGID_MC);
+-      ocelot_write_rix(ocelot, 0, ANA_PGID_PGID, PGID_MCIPV4);
+-      ocelot_write_rix(ocelot, 0, ANA_PGID_PGID, PGID_MCIPV6);
++      ocelot_write_rix(ocelot,
++                       ANA_PGID_PGID_PGID(GENMASK(ocelot->num_phys_ports, 0)),
++                       ANA_PGID_PGID, PGID_MCIPV4);
++      ocelot_write_rix(ocelot,
++                       ANA_PGID_PGID_PGID(GENMASK(ocelot->num_phys_ports, 0)),
++                       ANA_PGID_PGID, PGID_MCIPV6);
+       /* Allow manual injection via DEVCPU_QS registers, and byte swap these
+        * registers endianness.
index 321bf03ae0890de2762828663cc4696385f037a8..935793ee1f64eae8f07f02d82de2df3c31e781ba 100644 (file)
@@ -10,3 +10,4 @@ xfs-remove-all-cow-fork-extents-when-remounting-readonly.patch
 xfs-check-sb_meta_uuid-for-dabuf-buffer-recovery.patch
 powerpc-ftrace-remove-ftrace-init-tramp-once-kernel-init-is-complete.patch
 xen-gntdev-avoid-blocking-in-unmap_grant_pages.patch
+net-mscc-ocelot-allow-unregistered-ip-multicast-flooding.patch