From: Mesut Ali Ergin Date: Thu, 25 Jul 2019 21:50:49 +0000 (-0700) Subject: net/i40e: fix double flow mark action check X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=3d6666ac97d790660067218c900a1c642c55fd26;p=dpdk.git net/i40e: fix double flow mark action check This commit fixes an issue with the error checking in flow MARK action. Previously, (ANY + MARK) would fail, as the (mark_spec == 0) condition would cause an early error return, however really it is (mark_spec != 0) that should cause the early error return. Flipping the binary comparison corrects the behaviour, and (ANY + MARK) now succeeds, while (MARK + MARK) fails. Fixes: 0bbcfc706a2b ("net/i40e: support MARK and RSS flow action") Suggested-by: Harry van Haaren Signed-off-by: Mesut Ali Ergin Acked-by: Qi Zhang --- diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index c60c9e2402..e902a35d7f 100644 --- a/drivers/net/i40e/i40e_flow.c +++ b/drivers/net/i40e/i40e_flow.c @@ -3105,7 +3105,7 @@ i40e_flow_parse_fdir_action(struct rte_eth_dev *dev, NEXT_ITEM_OF_ACTION(act, actions, index); switch (act->type) { case RTE_FLOW_ACTION_TYPE_MARK: - if (!mark_spec) { + if (mark_spec) { /* Double MARK actions requested */ rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, act, @@ -3117,7 +3117,7 @@ i40e_flow_parse_fdir_action(struct rte_eth_dev *dev, filter->soft_id = mark_spec->id; break; case RTE_FLOW_ACTION_TYPE_FLAG: - if (!mark_spec) { + if (mark_spec) { /* MARK + FLAG not supported */ rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, act,