mtd: fix build with GCC 14
[openwrt/openwrt.git] / target / linux / generic / pending-6.1 / 712-net-dsa-qca8k-enable-assisted-learning-on-CPU-port.patch
1 From 0f6599167c126ce32c85d4f8a1f3d1775a268572 Mon Sep 17 00:00:00 2001
2 From: Christian Marangi <ansuelsmth@gmail.com>
3 Date: Fri, 6 Oct 2023 12:44:00 +0200
4 Subject: [PATCH] net: dsa: qca8k: enable assisted learning on CPU port
5
6 Enable assisted learning on CPU port.
7
8 It has been verified that there is a problem in packet roaming
9 from one BSS to another in the same security settings from one
10 physical R7800 to another physical R7800 where they are in the
11 same L2 broadcast domain backhauled/linked together via one
12 of the ethernet ports.
13 DHCP will fail to complete and traffic cannot flow for around 300
14 seconds.
15
16 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
17 ---
18 drivers/net/dsa/qca/qca8k-8xxx.c | 14 +++++++++-----
19 1 file changed, 9 insertions(+), 5 deletions(-)
20
21 --- a/drivers/net/dsa/qca/qca8k-8xxx.c
22 +++ b/drivers/net/dsa/qca/qca8k-8xxx.c
23 @@ -2013,6 +2013,12 @@ qca8k_setup(struct dsa_switch *ds)
24 dev_err(priv->dev, "failed enabling QCA header mode on port %d", dp->index);
25 return ret;
26 }
27 +
28 + /* Disable learning by default on all ports */
29 + ret = regmap_clear_bits(priv->regmap, QCA8K_PORT_LOOKUP_CTRL(dp->index),
30 + QCA8K_PORT_LOOKUP_LEARN);
31 + if (ret)
32 + return ret;
33 }
34
35 /* Forward all unknown frames to CPU port for Linux processing */
36 @@ -2042,11 +2048,6 @@ qca8k_setup(struct dsa_switch *ds)
37 if (ret)
38 return ret;
39
40 - ret = regmap_clear_bits(priv->regmap, QCA8K_PORT_LOOKUP_CTRL(port),
41 - QCA8K_PORT_LOOKUP_LEARN);
42 - if (ret)
43 - return ret;
44 -
45 /* For port based vlans to work we need to set the
46 * default egress vid
47 */
48 @@ -2098,6 +2099,9 @@ qca8k_setup(struct dsa_switch *ds)
49 /* Set max number of LAGs supported */
50 ds->num_lag_ids = QCA8K_NUM_LAGS;
51
52 + /* HW learn on CPU port is limited and require manual setting */
53 + ds->assisted_learning_on_cpu_port = true;
54 +
55 return 0;
56 }
57