]> git.droids-corp.org - dpdk.git/commitdiff
net/hns3: fix using enum as boolean
authorHuisong Li <lihuisong@huawei.com>
Sat, 22 Jan 2022 01:51:29 +0000 (09:51 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 27 Jan 2022 13:39:12 +0000 (14:39 +0100)
The enum type variables cannot be used as bool variables. This patch
fixes for "with->func" in hns3_action_rss_same().

Fixes: eb158fc756a5 ("net/hns3: fix config when creating RSS rule after flush")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
drivers/net/hns3/hns3_flow.c

index 5f2b279546d4d4e75d9fa2e892296807d5ad6dde..00084872ad2a87faf44f772f45eaed8875515e9a 100644 (file)
@@ -1251,7 +1251,8 @@ hns3_action_rss_same(const struct rte_flow_action_rss *comp,
        if (comp->func == RTE_ETH_HASH_FUNCTION_MAX)
                func_is_same = false;
        else
-               func_is_same = with->func ? (comp->func == with->func) : true;
+               func_is_same = (with->func != RTE_ETH_HASH_FUNCTION_DEFAULT) ?
+                               (comp->func == with->func) : true;
 
        return (func_is_same &&
                comp->types == (with->types & HNS3_ETH_RSS_SUPPORT) &&