From: Christian Marangi <ansuelsmth@gmail.com>
Ask DSA to propagate dynamically learned FDB entries from foreign
software bridge ports as host addresses. This lets QCA8K react as soon
as a station moves from a switch user port to an interface behind the
CPU instead of waiting for the old hardware entry to age out.
Disable hardware learning on every port during initial setup,
including the CPU ports. Bridge and STP configuration will enable it
again where appropriate on user ports, while CPU-side learning remains
under software control.
Link: https://github.com/openwrt/openwrt/commit/b0048b314620cc99f155c8c5cd4541af5e99e578
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Brandon Mahdavi <redacted>
---
drivers/net/dsa/qca/qca8k-8xxx.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/net/dsa/qca/qca8k-8xxx.c b/drivers/net/dsa/qca/qca8k-8xxx.c
index 32dc626399c9..4af92d51f046 100644
--- a/drivers/net/dsa/qca/qca8k-8xxx.c
+++ b/drivers/net/dsa/qca/qca8k-8xxx.c
@@ -2017,9 +2017,10 @@ qca8k_setup(struct dsa_switch *ds)
/* Initial setup of all ports */
dsa_switch_for_each_port(dp, ds) {
- /* Disable forwarding by default on all ports */
+ /* Disable forwarding and learning by default on all ports */
ret = qca8k_rmw(priv, QCA8K_PORT_LOOKUP_CTRL(dp->index),
- QCA8K_PORT_LOOKUP_MEMBER, 0);
+ QCA8K_PORT_LOOKUP_MEMBER |
+ QCA8K_PORT_LOOKUP_LEARN, 0);
if (ret)
return ret;
}@@ -2061,11 +2062,6 @@ qca8k_setup(struct dsa_switch *ds)
if (ret)
return ret;
- ret = regmap_clear_bits(priv->regmap, QCA8K_PORT_LOOKUP_CTRL(port),
- QCA8K_PORT_LOOKUP_LEARN);
- if (ret)
- return ret;
-
ret = qca8k_rmw(priv, QCA8K_PORT_LOOKUP_CTRL(cpu_port),
BIT(port), BIT(port));
if (ret)
@@ -2122,6 +2118,8 @@ qca8k_setup(struct dsa_switch *ds)
/* Set max number of LAGs supported */
ds->num_lag_ids = QCA8K_NUM_LAGS;
+ ds->assisted_learning_on_cpu_port = true;
+
return 0;
}
--
2.43.0