* [PATCH net 0/2] Fix port mirroring on MT7530 DSA subdriver
@ 2024-04-13 13:01 Arınç ÜNAL via B4 Relay
2024-04-13 13:01 ` [PATCH net 1/2] net: dsa: mt7530: fix mirroring frames received on local port Arınç ÜNAL via B4 Relay
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Arınç ÜNAL via B4 Relay @ 2024-04-13 13:01 UTC (permalink / raw)
To: Daniel Golle, DENG Qingfang, Sean Wang, Andrew Lunn,
Florian Fainelli, Vladimir Oltean, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Matthias Brugger,
AngeloGioacchino Del Regno
Cc: Holger Stadali, Bartel Eerdekens, mithat.guner, erkin.bozoglu,
netdev, linux-kernel, linux-arm-kernel, linux-mediatek,
Arınç ÜNAL
Hi.
This patch series fixes the frames received on the local port (monitor
port) not being mirrored, and port mirroring for the MT7988 SoC switch.
Arınç
Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
---
Arınç ÜNAL (2):
net: dsa: mt7530: fix mirroring frames received on local port
net: dsa: mt7530: fix port mirroring for MT7988 SoC switch
drivers/net/dsa/mt7530.c | 16 ++++++++++++----
drivers/net/dsa/mt7530.h | 4 ++++
2 files changed, 16 insertions(+), 4 deletions(-)
---
base-commit: 4e1ad31ce3205d9400816e08cf14b7c96295d22e
change-id: 20240413-b4-for-net-mt7530-fix-mirroring-to-local-port-and-mt7988-37a582c6697a
Best regards,
--
Arınç ÜNAL <arinc.unal@arinc9.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH net 1/2] net: dsa: mt7530: fix mirroring frames received on local port
2024-04-13 13:01 [PATCH net 0/2] Fix port mirroring on MT7530 DSA subdriver Arınç ÜNAL via B4 Relay
@ 2024-04-13 13:01 ` Arınç ÜNAL via B4 Relay
2024-04-13 13:01 ` [PATCH net 2/2] net: dsa: mt7530: fix port mirroring for MT7988 SoC switch Arınç ÜNAL via B4 Relay
2024-04-17 8:00 ` [PATCH net 0/2] Fix port mirroring on MT7530 DSA subdriver patchwork-bot+netdevbpf
2 siblings, 0 replies; 5+ messages in thread
From: Arınç ÜNAL via B4 Relay @ 2024-04-13 13:01 UTC (permalink / raw)
To: Daniel Golle, DENG Qingfang, Sean Wang, Andrew Lunn,
Florian Fainelli, Vladimir Oltean, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Matthias Brugger,
AngeloGioacchino Del Regno
Cc: Holger Stadali, Bartel Eerdekens, mithat.guner, erkin.bozoglu,
netdev, linux-kernel, linux-arm-kernel, linux-mediatek,
Arınç ÜNAL
From: Arınç ÜNAL <arinc.unal@arinc9.com>
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: 37feab6076aa ("net: dsa: mt7530: add support for port mirroring")
Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
---
drivers/net/dsa/mt7530.c | 6 ++++++
drivers/net/dsa/mt7530.h | 4 ++++
2 files changed, 10 insertions(+)
diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
index c0d0bce0b594..b84e1845fa02 100644
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -2480,6 +2480,9 @@ mt7530_setup(struct dsa_switch *ds)
PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT));
}
+ /* Allow mirroring frames received on the local port (monitor port). */
+ mt7530_set(priv, MT753X_AGC, LOCAL_EN);
+
/* Setup VLAN ID 0 for VLAN-unaware bridges */
ret = mt7530_setup_vlan0(priv);
if (ret)
@@ -2591,6 +2594,9 @@ mt7531_setup_common(struct dsa_switch *ds)
PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT));
}
+ /* Allow mirroring frames received on the local port (monitor port). */
+ mt7530_set(priv, MT753X_AGC, LOCAL_EN);
+
/* Flush the FDB table */
ret = mt7530_fdb_cmd(priv, MT7530_FDB_FLUSH, NULL);
if (ret < 0)
diff --git a/drivers/net/dsa/mt7530.h b/drivers/net/dsa/mt7530.h
index 585db03c0548..a08053390b28 100644
--- a/drivers/net/dsa/mt7530.h
+++ b/drivers/net/dsa/mt7530.h
@@ -32,6 +32,10 @@ enum mt753x_id {
#define SYSC_REG_RSTCTRL 0x34
#define RESET_MCM BIT(2)
+/* Register for ARL global control */
+#define MT753X_AGC 0xc
+#define LOCAL_EN BIT(7)
+
/* Registers to mac forward control for unknown frames */
#define MT7530_MFC 0x10
#define BC_FFP(x) (((x) & 0xff) << 24)
--
2.40.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH net 2/2] net: dsa: mt7530: fix port mirroring for MT7988 SoC switch
2024-04-13 13:01 [PATCH net 0/2] Fix port mirroring on MT7530 DSA subdriver Arınç ÜNAL via B4 Relay
2024-04-13 13:01 ` [PATCH net 1/2] net: dsa: mt7530: fix mirroring frames received on local port Arınç ÜNAL via B4 Relay
@ 2024-04-13 13:01 ` Arınç ÜNAL via B4 Relay
2024-04-14 3:41 ` Daniel Golle
2024-04-17 8:00 ` [PATCH net 0/2] Fix port mirroring on MT7530 DSA subdriver patchwork-bot+netdevbpf
2 siblings, 1 reply; 5+ messages in thread
From: Arınç ÜNAL via B4 Relay @ 2024-04-13 13:01 UTC (permalink / raw)
To: Daniel Golle, DENG Qingfang, Sean Wang, Andrew Lunn,
Florian Fainelli, Vladimir Oltean, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Matthias Brugger,
AngeloGioacchino Del Regno
Cc: Holger Stadali, Bartel Eerdekens, mithat.guner, erkin.bozoglu,
netdev, linux-kernel, linux-arm-kernel, linux-mediatek,
Arınç ÜNAL
From: Arınç ÜNAL <arinc.unal@arinc9.com>
The "MT7988A Wi-Fi 7 Generation Router Platform: Datasheet (Open Version)
v0.1" document shows bits 16 to 18 as the MIRROR_PORT field of the CPU
forward control register. Currently, the MT7530 DSA subdriver configures
bits 0 to 2 of the CPU forward control register which breaks the port
mirroring feature for the MT7988 SoC switch.
Fix this by using the MT7531_MIRROR_PORT_GET() and MT7531_MIRROR_PORT_SET()
macros which utilise the correct bits.
Fixes: 110c18bfed41 ("net: dsa: mt7530: introduce driver for MT7988 built-in switch")
Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
---
drivers/net/dsa/mt7530.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
index b84e1845fa02..8090390edaf9 100644
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -1883,14 +1883,16 @@ mt7530_port_vlan_del(struct dsa_switch *ds, int port,
static int mt753x_mirror_port_get(unsigned int id, u32 val)
{
- return (id == ID_MT7531) ? MT7531_MIRROR_PORT_GET(val) :
- MIRROR_PORT(val);
+ return (id == ID_MT7531 || id == ID_MT7988) ?
+ MT7531_MIRROR_PORT_GET(val) :
+ MIRROR_PORT(val);
}
static int mt753x_mirror_port_set(unsigned int id, u32 val)
{
- return (id == ID_MT7531) ? MT7531_MIRROR_PORT_SET(val) :
- MIRROR_PORT(val);
+ return (id == ID_MT7531 || id == ID_MT7988) ?
+ MT7531_MIRROR_PORT_SET(val) :
+ MIRROR_PORT(val);
}
static int mt753x_port_mirror_add(struct dsa_switch *ds, int port,
--
2.40.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net 2/2] net: dsa: mt7530: fix port mirroring for MT7988 SoC switch
2024-04-13 13:01 ` [PATCH net 2/2] net: dsa: mt7530: fix port mirroring for MT7988 SoC switch Arınç ÜNAL via B4 Relay
@ 2024-04-14 3:41 ` Daniel Golle
0 siblings, 0 replies; 5+ messages in thread
From: Daniel Golle @ 2024-04-14 3:41 UTC (permalink / raw)
To: arinc.unal
Cc: DENG Qingfang, Sean Wang, Andrew Lunn, Florian Fainelli,
Vladimir Oltean, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Matthias Brugger, AngeloGioacchino Del Regno,
Holger Stadali, Bartel Eerdekens, mithat.guner, erkin.bozoglu,
netdev, linux-kernel, linux-arm-kernel, linux-mediatek
On Sat, Apr 13, 2024 at 04:01:40PM +0300, Arınç ÜNAL via B4 Relay wrote:
> From: Arınç ÜNAL <arinc.unal@arinc9.com>
>
> The "MT7988A Wi-Fi 7 Generation Router Platform: Datasheet (Open Version)
> v0.1" document shows bits 16 to 18 as the MIRROR_PORT field of the CPU
> forward control register. Currently, the MT7530 DSA subdriver configures
> bits 0 to 2 of the CPU forward control register which breaks the port
> mirroring feature for the MT7988 SoC switch.
>
> Fix this by using the MT7531_MIRROR_PORT_GET() and MT7531_MIRROR_PORT_SET()
> macros which utilise the correct bits.
>
> Fixes: 110c18bfed41 ("net: dsa: mt7530: introduce driver for MT7988 built-in switch")
> Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Acked-by: Daniel Golle <daniel@makrotopia.org>
> ---
> drivers/net/dsa/mt7530.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
> index b84e1845fa02..8090390edaf9 100644
> --- a/drivers/net/dsa/mt7530.c
> +++ b/drivers/net/dsa/mt7530.c
> @@ -1883,14 +1883,16 @@ mt7530_port_vlan_del(struct dsa_switch *ds, int port,
>
> static int mt753x_mirror_port_get(unsigned int id, u32 val)
> {
> - return (id == ID_MT7531) ? MT7531_MIRROR_PORT_GET(val) :
> - MIRROR_PORT(val);
> + return (id == ID_MT7531 || id == ID_MT7988) ?
> + MT7531_MIRROR_PORT_GET(val) :
> + MIRROR_PORT(val);
> }
>
> static int mt753x_mirror_port_set(unsigned int id, u32 val)
> {
> - return (id == ID_MT7531) ? MT7531_MIRROR_PORT_SET(val) :
> - MIRROR_PORT(val);
> + return (id == ID_MT7531 || id == ID_MT7988) ?
> + MT7531_MIRROR_PORT_SET(val) :
> + MIRROR_PORT(val);
> }
>
> static int mt753x_port_mirror_add(struct dsa_switch *ds, int port,
>
> --
> 2.40.1
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net 0/2] Fix port mirroring on MT7530 DSA subdriver
2024-04-13 13:01 [PATCH net 0/2] Fix port mirroring on MT7530 DSA subdriver Arınç ÜNAL via B4 Relay
2024-04-13 13:01 ` [PATCH net 1/2] net: dsa: mt7530: fix mirroring frames received on local port Arınç ÜNAL via B4 Relay
2024-04-13 13:01 ` [PATCH net 2/2] net: dsa: mt7530: fix port mirroring for MT7988 SoC switch Arınç ÜNAL via B4 Relay
@ 2024-04-17 8:00 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-04-17 8:00 UTC (permalink / raw)
To: =?utf-8?b?QXLEsW7DpyDDnE5BTCB2aWEgQjQgUmVsYXkgPGRldm51bGwrYXJpbmMudW5hbC5h?=,
=?utf-8?b?cmluYzkuY29tQGtlcm5lbC5vcmc+?=
Cc: daniel, dqfext, sean.wang, andrew, f.fainelli, olteanv, davem,
edumazet, kuba, pabeni, matthias.bgg, angelogioacchino.delregno,
hs, bartel.eerdekens, mithat.guner, erkin.bozoglu, netdev,
linux-kernel, linux-arm-kernel, linux-mediatek, arinc.unal
Hello:
This series was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:
On Sat, 13 Apr 2024 16:01:38 +0300 you wrote:
> Hi.
>
> This patch series fixes the frames received on the local port (monitor
> port) not being mirrored, and port mirroring for the MT7988 SoC switch.
>
> Arınç
>
> [...]
Here is the summary with links:
- [net,1/2] net: dsa: mt7530: fix mirroring frames received on local port
https://git.kernel.org/netdev/net/c/d59cf049c837
- [net,2/2] net: dsa: mt7530: fix port mirroring for MT7988 SoC switch
https://git.kernel.org/netdev/net/c/2c606d138518
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-04-17 8:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-13 13:01 [PATCH net 0/2] Fix port mirroring on MT7530 DSA subdriver Arınç ÜNAL via B4 Relay
2024-04-13 13:01 ` [PATCH net 1/2] net: dsa: mt7530: fix mirroring frames received on local port Arınç ÜNAL via B4 Relay
2024-04-13 13:01 ` [PATCH net 2/2] net: dsa: mt7530: fix port mirroring for MT7988 SoC switch Arınç ÜNAL via B4 Relay
2024-04-14 3:41 ` Daniel Golle
2024-04-17 8:00 ` [PATCH net 0/2] Fix port mirroring on MT7530 DSA subdriver patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).