Skip to content

Commit

Permalink
net/hns3: fix using enum as boolean
Browse files Browse the repository at this point in the history
[ upstream commit 67d0b17 ]

The enum type variables cannot be used as bool variables. This patch
fixes for "with->func" in hns3_action_rss_same().

Fixes: eb158fc ("net/hns3: fix config when creating RSS rule after flush")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
  • Loading branch information
LiHuiSong1 authored and kevintraynor committed Feb 21, 2022
1 parent 9d6db3c commit ad51b31
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/hns3/hns3_flow.c
Expand Up @@ -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) &&
Expand Down

0 comments on commit ad51b31

Please sign in to comment.