]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: dsa: mt7530: fix handling of 802.1X PAE frames
authorArınç ÜNAL <arinc.unal@arinc9.com>
Sun, 13 Aug 2023 10:59:17 +0000 (13:59 +0300)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:21:37 +0000 (18:21 -0400)
[ Upstream commit e94b590abfff2cdbf0bdaa7d9904364c8d480af5 ]

802.1X PAE frames are link-local frames, therefore they must be trapped to
the CPU port. Currently, the MT753X switches treat 802.1X PAE frames as
regular multicast frames, therefore flooding them to user ports. To fix
this, set 802.1X PAE frames to be trapped to the CPU port(s).

Fixes: b8f126a8d543 ("net-next: dsa: add dsa support for Mediatek MT7530 switch")
Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Stable-dep-of: e8bf353577f3 ("net: dsa: mt7530: fix link-local frames that ingress vlan filtering ports")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/dsa/mt7530.c
drivers/net/dsa/mt7530.h

index a35a000460d1b3549a91bcddc1184be43ae892da..d03354cff57f15c4233bc02bb6846fa8516f8471 100644 (file)
@@ -1001,6 +1001,10 @@ mt753x_trap_frames(struct mt7530_priv *priv)
        mt7530_rmw(priv, MT753X_BPC, MT753X_BPDU_PORT_FW_MASK,
                   MT753X_BPDU_CPU_ONLY);
 
+       /* Trap 802.1X PAE frames to the CPU port(s) */
+       mt7530_rmw(priv, MT753X_BPC, MT753X_PAE_PORT_FW_MASK,
+                  MT753X_PAE_PORT_FW(MT753X_BPDU_CPU_ONLY));
+
        /* Trap LLDP frames with :0E MAC DA to the CPU port(s) */
        mt7530_rmw(priv, MT753X_RGAC2, MT753X_R0E_PORT_FW_MASK,
                   MT753X_R0E_PORT_FW(MT753X_BPDU_CPU_ONLY));
index 8cee462d5f1cb3c80e648f39e70a37045bf0c574..2c895f35383e2c0629e804288292cd0dc895668f 100644 (file)
@@ -65,6 +65,8 @@ enum mt753x_id {
 /* Registers for BPDU and PAE frame control*/
 #define MT753X_BPC                     0x24
 #define  MT753X_BPDU_PORT_FW_MASK      GENMASK(2, 0)
+#define  MT753X_PAE_PORT_FW_MASK       GENMASK(18, 16)
+#define  MT753X_PAE_PORT_FW(x)         FIELD_PREP(MT753X_PAE_PORT_FW_MASK, x)
 
 /* Register for :03 and :0E MAC DA frame control */
 #define MT753X_RGAC2                   0x2c