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