Skip to content

Commit d7c6607

Browse files
arinc9davem330
authored andcommitted
net: dsa: mt7530: fix handling of BPDUs on MT7530 switch
BPDUs are link-local frames, therefore they must be trapped to the CPU port. Currently, the MT7530 switch treats BPDUs as regular multicast frames, therefore flooding them to user ports. To fix this, set BPDUs to be trapped to the CPU port. Group this on mt7530_setup() and mt7531_setup_common() into mt753x_trap_frames() and call that. 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 4ae90f9 commit d7c6607

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

drivers/net/dsa/mt7530.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -985,6 +985,14 @@ static void mt7530_setup_port5(struct dsa_switch *ds, phy_interface_t interface)
985985
mutex_unlock(&priv->reg_mutex);
986986
}
987987

988+
static void
989+
mt753x_trap_frames(struct mt7530_priv *priv)
990+
{
991+
/* Trap BPDUs to the CPU port(s) */
992+
mt7530_rmw(priv, MT753X_BPC, MT753X_BPDU_PORT_FW_MASK,
993+
MT753X_BPDU_CPU_ONLY);
994+
}
995+
988996
static int
989997
mt753x_cpu_port_enable(struct dsa_switch *ds, int port)
990998
{
@@ -2262,6 +2270,8 @@ mt7530_setup(struct dsa_switch *ds)
22622270

22632271
priv->p6_interface = PHY_INTERFACE_MODE_NA;
22642272

2273+
mt753x_trap_frames(priv);
2274+
22652275
/* Enable and reset MIB counters */
22662276
mt7530_mib_reset(ds);
22672277

@@ -2361,9 +2371,7 @@ mt7531_setup_common(struct dsa_switch *ds)
23612371
struct mt7530_priv *priv = ds->priv;
23622372
int ret, i;
23632373

2364-
/* Trap BPDUs to the CPU port(s) */
2365-
mt7530_rmw(priv, MT753X_BPC, MT753X_BPDU_PORT_FW_MASK,
2366-
MT753X_BPDU_CPU_ONLY);
2374+
mt753x_trap_frames(priv);
23672375

23682376
/* Enable and reset MIB counters */
23692377
mt7530_mib_reset(ds);

0 commit comments

Comments
 (0)