DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
To: dev@dpdk.org
Cc: indranil@chelsio.com, nirranjan@chelsio.com, stable@dpdk.org
Subject: [dpdk-dev] [PATCH 3/6] net/cxgbe: fix check for redefined match items
Date: Fri,  9 Nov 2018 13:26:25 +0530	[thread overview]
Message-ID: <84cafa786d943c9d612db31c81d321b95e6e7e5b.1541747960.git.rahul.lakkireddy@chelsio.com> (raw)
In-Reply-To: <cover.1541747960.git.rahul.lakkireddy@chelsio.com>
In-Reply-To: <cover.1541747960.git.rahul.lakkireddy@chelsio.com>

Fix issue where ethertype is set to 0x800 for IPv4 by ether match
item and IPv4 match item also inherently sets ethertype to 0x800.

Current logic returns error when IPv4 match item is parsed. So, fix
by only bailing if the redefined match items have different values.

Fixes: ee61f5113b17 ("net/cxgbe: parse and validate flows")
Cc: stable@dpdk.org

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
---
 drivers/net/cxgbe/cxgbe_flow.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/net/cxgbe/cxgbe_flow.c b/drivers/net/cxgbe/cxgbe_flow.c
index 54ec7e595..a8f076e6c 100644
--- a/drivers/net/cxgbe/cxgbe_flow.c
+++ b/drivers/net/cxgbe/cxgbe_flow.c
@@ -7,14 +7,12 @@
 
 #define __CXGBE_FILL_FS(__v, __m, fs, elem, e) \
 do { \
-	if (!((fs)->val.elem || (fs)->mask.elem)) { \
-		(fs)->val.elem = (__v); \
-		(fs)->mask.elem = (__m); \
-	} else { \
+	if ((fs)->mask.elem && ((fs)->val.elem != (__v))) \
 		return rte_flow_error_set(e, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, \
-					  NULL, "a filter can be specified" \
-					  " only once"); \
-	} \
+					  NULL, "Redefined match item with" \
+					  " different values found"); \
+	(fs)->val.elem = (__v); \
+	(fs)->mask.elem = (__m); \
 } while (0)
 
 #define __CXGBE_FILL_FS_MEMCPY(__v, __m, fs, elem) \
-- 
2.18.0

  parent reply	other threads:[~2018-11-09  7:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-09  7:56 [dpdk-dev] [PATCH 0/6] net/cxgbe: bug fixes Rahul Lakkireddy
2018-11-09  7:56 ` [dpdk-dev] [PATCH 1/6] net/cxgbevf: add missing PCI uninitialization function for VF Rahul Lakkireddy
2018-11-09  7:56 ` [dpdk-dev] [PATCH 2/6] net/cxgbe: check Rx offload flags before doing VLAN strip offload Rahul Lakkireddy
2018-11-09  7:56 ` Rahul Lakkireddy [this message]
2018-11-09  7:56 ` [dpdk-dev] [PATCH 4/6] net/cxgbe: increase completion wait time for flow operations Rahul Lakkireddy
2018-11-09  7:56 ` [dpdk-dev] [PATCH 5/6] net/cxgbe: fix wrong ingress port value set in filter spec Rahul Lakkireddy
2018-11-09  7:56 ` [dpdk-dev] [PATCH 6/6] net/cxgbevf: fix illegal memory access when freeing MPS TCAM Rahul Lakkireddy
2018-11-09 20:19 ` [dpdk-dev] [PATCH 0/6] net/cxgbe: bug fixes Ferruh Yigit

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=84cafa786d943c9d612db31c81d321b95e6e7e5b.1541747960.git.rahul.lakkireddy@chelsio.com \
    --to=rahul.lakkireddy@chelsio.com \
    --cc=dev@dpdk.org \
    --cc=indranil@chelsio.com \
    --cc=nirranjan@chelsio.com \
    --cc=stable@dpdk.org \
    /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).