Skip to content

Commit e94b590

Browse files
arinc9davem330
authored andcommitted
net: dsa: mt7530: fix handling of 802.1X PAE frames
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: b8f126a ("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>
1 parent cfceccc commit e94b590

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

drivers/net/dsa/mt7530.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,6 +1006,10 @@ mt753x_trap_frames(struct mt7530_priv *priv)
10061006
mt7530_rmw(priv, MT753X_BPC, MT753X_BPDU_PORT_FW_MASK,
10071007
MT753X_BPDU_CPU_ONLY);
10081008

1009+
/* Trap 802.1X PAE frames to the CPU port(s) */
1010+
mt7530_rmw(priv, MT753X_BPC, MT753X_PAE_PORT_FW_MASK,
1011+
MT753X_PAE_PORT_FW(MT753X_BPDU_CPU_ONLY));
1012+
10091013
/* Trap LLDP frames with :0E MAC DA to the CPU port(s) */
10101014
mt7530_rmw(priv, MT753X_RGAC2, MT753X_R0E_PORT_FW_MASK,
10111015
MT753X_R0E_PORT_FW(MT753X_BPDU_CPU_ONLY));

drivers/net/dsa/mt7530.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ enum mt753x_id {
6666
/* Registers for BPDU and PAE frame control*/
6767
#define MT753X_BPC 0x24
6868
#define MT753X_BPDU_PORT_FW_MASK GENMASK(2, 0)
69+
#define MT753X_PAE_PORT_FW_MASK GENMASK(18, 16)
70+
#define MT753X_PAE_PORT_FW(x) FIELD_PREP(MT753X_PAE_PORT_FW_MASK, x)
6971

7072
/* Register for :03 and :0E MAC DA frame control */
7173
#define MT753X_RGAC2 0x2c

0 commit comments

Comments
 (0)