From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 97357A046B for ; Thu, 25 Jul 2019 23:51:00 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1EF8A1C37F; Thu, 25 Jul 2019 23:51:00 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id AA8F11C37D for ; Thu, 25 Jul 2019 23:50:58 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jul 2019 14:50:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,308,1559545200"; d="scan'208";a="189471052" Received: from skx-pink.jf.intel.com ([10.54.80.236]) by fmsmga001.fm.intel.com with ESMTP; 25 Jul 2019 14:50:57 -0700 From: Mesut Ali Ergin To: beilei.xing@intel.com, qi.z.zhang@intel.com Cc: dev@dpdk.org, harry.van.haaren@intel.com, Mesut Ali Ergin Date: Thu, 25 Jul 2019 14:50:49 -0700 Message-Id: <1564091449-34248-1-git-send-email-mesut.a.ergin@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] net/i40e: fix flow double mark action error check X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- drivers/net/i40e/i40e_flow.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index c60c9e2..e902a35 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, -- 2.7.4