712-net-dsa-qca8k-enable-assisted-learning-on-CPU-port.patch 1.8 KB

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