DPDK patches and discussions
 help / color / mirror / Atom feed
From: Mesut Ali Ergin <mesut.a.ergin@intel.com>
To: beilei.xing@intel.com, qi.z.zhang@intel.com
Cc: dev@dpdk.org, harry.van.haaren@intel.com,
	Mesut Ali Ergin <mesut.a.ergin@intel.com>
Subject: [dpdk-dev] [PATCH] net/i40e: fix flow double mark action error check
Date: Thu, 25 Jul 2019 14:50:49 -0700	[thread overview]
Message-ID: <1564091449-34248-1-git-send-email-mesut.a.ergin@intel.com> (raw)

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 <harry.van.haaren@intel.com>
Signed-off-by: Mesut Ali Ergin <mesut.a.ergin@intel.com>
---
 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


             reply	other threads:[~2019-07-25 21:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-25 21:50 Mesut Ali Ergin [this message]
2019-07-26  4:48 ` Zhang, Qi Z

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1564091449-34248-1-git-send-email-mesut.a.ergin@intel.com \
    --to=mesut.a.ergin@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=harry.van.haaren@intel.com \
    --cc=qi.z.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).