Skip to content

Commit d59cf04

Browse files
arinc9davem330
authored andcommitted
net: dsa: mt7530: fix mirroring frames received on local port
This switch intellectual property provides a bit on the ARL global control register which controls allowing mirroring frames which are received on the local port (monitor port). This bit is unset after reset. This ability must be enabled to fully support the port mirroring feature on this switch intellectual property. Therefore, this patch fixes the traffic not being reflected on a port, which would be configured like below: tc qdisc add dev swp0 clsact tc filter add dev swp0 ingress matchall skip_sw \ action mirred egress mirror dev swp0 As a side note, this configuration provides the hairpinning feature for a single port. Fixes: 37feab6 ("net: dsa: mt7530: add support for port mirroring") Signed-off-by: Arınç ÜNAL <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f8bbc07 commit d59cf04

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

drivers/net/dsa/mt7530.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2480,6 +2480,9 @@ mt7530_setup(struct dsa_switch *ds)
24802480
PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT));
24812481
}
24822482

2483+
/* Allow mirroring frames received on the local port (monitor port). */
2484+
mt7530_set(priv, MT753X_AGC, LOCAL_EN);
2485+
24832486
/* Setup VLAN ID 0 for VLAN-unaware bridges */
24842487
ret = mt7530_setup_vlan0(priv);
24852488
if (ret)
@@ -2591,6 +2594,9 @@ mt7531_setup_common(struct dsa_switch *ds)
25912594
PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT));
25922595
}
25932596

2597+
/* Allow mirroring frames received on the local port (monitor port). */
2598+
mt7530_set(priv, MT753X_AGC, LOCAL_EN);
2599+
25942600
/* Flush the FDB table */
25952601
ret = mt7530_fdb_cmd(priv, MT7530_FDB_FLUSH, NULL);
25962602
if (ret < 0)

drivers/net/dsa/mt7530.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ enum mt753x_id {
3232
#define SYSC_REG_RSTCTRL 0x34
3333
#define RESET_MCM BIT(2)
3434

35+
/* Register for ARL global control */
36+
#define MT753X_AGC 0xc
37+
#define LOCAL_EN BIT(7)
38+
3539
/* Registers to mac forward control for unknown frames */
3640
#define MT7530_MFC 0x10
3741
#define BC_FFP(x) (((x) & 0xff) << 24)

0 commit comments

Comments
 (0)