764-net-next-net-dsa-qca8k-fix-warning-in-LAG-feature.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. From 0898ca67b86e14207d4feb3f3fea8b87cec5aab1 Mon Sep 17 00:00:00 2001
  2. From: Ansuel Smith <[email protected]>
  3. Date: Tue, 23 Nov 2021 16:44:46 +0100
  4. Subject: net: dsa: qca8k: fix warning in LAG feature
  5. Fix warning reported by bot.
  6. Make sure hash is init to 0 and fix wrong logic for hash_type in
  7. qca8k_lag_can_offload.
  8. Reported-by: kernel test robot <[email protected]>
  9. Fixes: def975307c01 ("net: dsa: qca8k: add LAG support")
  10. Signed-off-by: Ansuel Smith <[email protected]>
  11. Reviewed-by: Florian Fainelli <[email protected]>
  12. Link: https://lore.kernel.org/r/[email protected]
  13. Signed-off-by: Jakub Kicinski <[email protected]>
  14. ---
  15. drivers/net/dsa/qca8k.c | 4 ++--
  16. 1 file changed, 2 insertions(+), 2 deletions(-)
  17. --- a/drivers/net/dsa/qca8k.c
  18. +++ b/drivers/net/dsa/qca8k.c
  19. @@ -2232,7 +2232,7 @@ qca8k_lag_can_offload(struct dsa_switch
  20. if (info->tx_type != NETDEV_LAG_TX_TYPE_HASH)
  21. return false;
  22. - if (info->hash_type != NETDEV_LAG_HASH_L2 ||
  23. + if (info->hash_type != NETDEV_LAG_HASH_L2 &&
  24. info->hash_type != NETDEV_LAG_HASH_L23)
  25. return false;
  26. @@ -2246,8 +2246,8 @@ qca8k_lag_setup_hash(struct dsa_switch *
  27. {
  28. struct qca8k_priv *priv = ds->priv;
  29. bool unique_lag = true;
  30. + u32 hash = 0;
  31. int i, id;
  32. - u32 hash;
  33. id = dsa_lag_id(ds->dst, lag);