Skip to content

Commit 73c447c

Browse files
LGA1150davem330
authored andcommitted
net: dsa: mt7530: always install FDB entries with IVL and FID 1
This reverts commit 7e77702 ("mt7530 mt7530_fdb_write only set ivl bit vid larger than 1"). Before this series, the default value of all ports' PVID is 1, which is copied into the FDB entry, even if the ports are VLAN unaware. So `bridge fdb show` will show entries like `dev swp0 vlan 1 self` even on a VLAN-unaware bridge. The blamed commit does not solve that issue completely, instead it may cause a new issue that FDB is inaccessible in a VLAN-aware bridge with PVID 1. This series sets PVID to 0 on VLAN-unaware ports, so `bridge fdb show` will no longer print `vlan 1` on VLAN-unaware bridges, and that special case in fdb_write is not required anymore. Set FDB entries' filter ID to 1 to match the VLAN table. Signed-off-by: DENG Qingfang <dqfext@gmail.com> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent a9e3f62 commit 73c447c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

drivers/net/dsa/mt7530.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,8 @@ mt7530_fdb_write(struct mt7530_priv *priv, u16 vid,
366366
int i;
367367

368368
reg[1] |= vid & CVID_MASK;
369-
if (vid > 1)
370-
reg[1] |= ATA2_IVL;
369+
reg[1] |= ATA2_IVL;
370+
reg[1] |= ATA2_FID(FID_BRIDGED);
371371
reg[2] |= (aging & AGE_TIMER_MASK) << AGE_TIMER;
372372
reg[2] |= (port_mask & PORT_MAP_MASK) << PORT_MAP;
373373
/* STATIC_ENT indicate that entry is static wouldn't

drivers/net/dsa/mt7530.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ enum mt753x_bpdu_port_fw {
8080
#define STATIC_ENT 3
8181
#define MT7530_ATA2 0x78
8282
#define ATA2_IVL BIT(15)
83+
#define ATA2_FID(x) (((x) & 0x7) << 12)
8384

8485
/* Register for address table write data */
8586
#define MT7530_ATWD 0x7c

0 commit comments

Comments
 (0)