kernel: backport b53/bcm_sf2 changes from v5.7
[openwrt/staging/hauke.git] / target / linux / generic / backport-5.4 / 707-v5.7-0008-net-dsa-bcm_sf2-Disable-learning-for-ASP-port.patch
1 From 8b6b208b69917d88bb3e087f8c9e61c6b05ed571 Mon Sep 17 00:00:00 2001
2 From: Florian Fainelli <f.fainelli@gmail.com>
3 Date: Mon, 30 Mar 2020 14:38:50 -0700
4 Subject: [PATCH] net: dsa: bcm_sf2: Disable learning for ASP port
5
6 We don't want to enable learning for the ASP port since it only receives
7 directed traffic, this allows us to bypass ARL-driven forwarding rules
8 which could conflict with Broadcom tags and/or CFP forwarding.
9
10 Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
11 Signed-off-by: David S. Miller <davem@davemloft.net>
12 ---
13 drivers/net/dsa/bcm_sf2.c | 10 +++++++++-
14 1 file changed, 9 insertions(+), 1 deletion(-)
15
16 --- a/drivers/net/dsa/bcm_sf2.c
17 +++ b/drivers/net/dsa/bcm_sf2.c
18 @@ -173,9 +173,17 @@ static int bcm_sf2_port_setup(struct dsa
19 core_writel(priv, reg, CORE_MEM_PSM_VDD_CTRL);
20
21 /* Enable Broadcom tags for that port if requested */
22 - if (priv->brcm_tag_mask & BIT(port))
23 + if (priv->brcm_tag_mask & BIT(port)) {
24 b53_brcm_hdr_setup(ds, port);
25
26 + /* Disable learning on ASP port */
27 + if (port == 7) {
28 + reg = core_readl(priv, CORE_DIS_LEARN);
29 + reg |= BIT(port);
30 + core_writel(priv, reg, CORE_DIS_LEARN);
31 + }
32 + }
33 +
34 /* Configure Traffic Class to QoS mapping, allow each priority to map
35 * to a different queue number
36 */