[PATCH 02/15] net/hns3: fix a misjudgment expression
Min Hu (Connor)
humin29 at huawei.com
Fri Jan 7 11:15:45 CET 2022
From: Huisong Li <lihuisong at 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 at dpdk.org
Signed-off-by: Huisong Li <lihuisong at huawei.com>
---
drivers/net/hns3/hns3_flow.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index df5caae83c..479c9963b2 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -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) &&
--
2.33.0
More information about the dev
mailing list