[v2,02/15] net/hns3: fix a misjudgment expression
Checks
Commit Message
From: Huisong Li <lihuisong@huawei.com>
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>
---
drivers/net/hns3/hns3_flow.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
@@ -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) &&