Skip to content

Commit 8332cf6

Browse files
arinc9davem330
authored andcommitted
net: dsa: mt7530: fix handling of LLDP frames
LLDP frames are link-local frames, therefore they must be trapped to the CPU port. Currently, the MT753X switches treat LLDP frames as regular multicast frames, therefore flooding them to user ports. To fix this, set LLDP 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 <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Reviewed-by: Russell King (Oracle) <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d7c6607 commit 8332cf6

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

drivers/net/dsa/mt7530.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -991,6 +991,10 @@ mt753x_trap_frames(struct mt7530_priv *priv)
991991
/* Trap BPDUs to the CPU port(s) */
992992
mt7530_rmw(priv, MT753X_BPC, MT753X_BPDU_PORT_FW_MASK,
993993
MT753X_BPDU_CPU_ONLY);
994+
995+
/* Trap LLDP frames with :0E MAC DA to the CPU port(s) */
996+
mt7530_rmw(priv, MT753X_RGAC2, MT753X_R0E_PORT_FW_MASK,
997+
MT753X_R0E_PORT_FW(MT753X_BPDU_CPU_ONLY));
994998
}
995999

9961000
static int

drivers/net/dsa/mt7530.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ enum mt753x_id {
6767
#define MT753X_BPC 0x24
6868
#define MT753X_BPDU_PORT_FW_MASK GENMASK(2, 0)
6969

70+
/* Register for :03 and :0E MAC DA frame control */
71+
#define MT753X_RGAC2 0x2c
72+
#define MT753X_R0E_PORT_FW_MASK GENMASK(18, 16)
73+
#define MT753X_R0E_PORT_FW(x) FIELD_PREP(MT753X_R0E_PORT_FW_MASK, x)
74+
7075
enum mt753x_bpdu_port_fw {
7176
MT753X_BPDU_FOLLOW_MFC,
7277
MT753X_BPDU_CPU_EXCLUDE = 4,

0 commit comments

Comments
 (0)