mediatek: fix PWM fan on BPi-R4
[openwrt/openwrt.git] / target / linux / generic / pending-6.6 / 711-02-net-dsa-qca8k-enable-flooding-to-both-CPU-port.patch
1 From b954d61d9ecfa64450fc178586719dc2a95b92a7 Mon Sep 17 00:00:00 2001
2 From: Christian Marangi <ansuelsmth@gmail.com>
3 Date: Tue, 20 Jun 2023 21:48:24 +0200
4 Subject: [PATCH 3/4] net: dsa: qca8k: enable flooding to both CPU port
5
6 To permit a multi-CPU setup, flood all unknown frames to all CPU ports.
7 Each CPU port should have correct LOOKUP MEMBER configuration to
8 prevent receiving duplicate packets from user ports.
9
10 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
11 ---
12 drivers/net/dsa/qca/qca8k-8xxx.c | 13 +++++--------
13 1 file changed, 5 insertions(+), 8 deletions(-)
14
15 --- a/drivers/net/dsa/qca/qca8k-8xxx.c
16 +++ b/drivers/net/dsa/qca/qca8k-8xxx.c
17 @@ -1901,15 +1901,12 @@ qca8k_setup(struct dsa_switch *ds)
18 }
19 }
20
21 - /* Forward all unknown frames to CPU port for Linux processing
22 - * Notice that in multi-cpu config only one port should be set
23 - * for igmp, unknown, multicast and broadcast packet
24 - */
25 + /* Forward all unknown frames to CPU port for Linux processing */
26 ret = qca8k_write(priv, QCA8K_REG_GLOBAL_FW_CTRL1,
27 - FIELD_PREP(QCA8K_GLOBAL_FW_CTRL1_IGMP_DP_MASK, BIT(cpu_port)) |
28 - FIELD_PREP(QCA8K_GLOBAL_FW_CTRL1_BC_DP_MASK, BIT(cpu_port)) |
29 - FIELD_PREP(QCA8K_GLOBAL_FW_CTRL1_MC_DP_MASK, BIT(cpu_port)) |
30 - FIELD_PREP(QCA8K_GLOBAL_FW_CTRL1_UC_DP_MASK, BIT(cpu_port)));
31 + FIELD_PREP(QCA8K_GLOBAL_FW_CTRL1_IGMP_DP_MASK, dsa_cpu_ports(ds)) |
32 + FIELD_PREP(QCA8K_GLOBAL_FW_CTRL1_BC_DP_MASK, dsa_cpu_ports(ds)) |
33 + FIELD_PREP(QCA8K_GLOBAL_FW_CTRL1_MC_DP_MASK, dsa_cpu_ports(ds)) |
34 + FIELD_PREP(QCA8K_GLOBAL_FW_CTRL1_UC_DP_MASK, dsa_cpu_ports(ds)));
35 if (ret)
36 return ret;
37