Skip to contentSkip to conversation

net/ixgbe: add more check in n-tuple filter

PATCH In review Wei Zhao 2 participants 3 messages Jan 23, 2017 – Feb 3, 2017 Network drivers

lore
Share & tools
lore

Wei Zhao

author
#0 lore raw

PATCH 1/1 net/ixgbe: add more check in n-tuple filter

Add more check on the mask of src_addr, dst_addr and next_proto_id in n-tuple filter rule pattern parser.If do not add such check, it maybe cause error in pattern parser.

---
 drivers/net/ixgbe/ixgbe_flow.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/ixgbe/ixgbe_flow.c +4 -1
index 82aceed..8f78eee 100644
@@ -331,7 +331,10 @@ cons_parse_ntuple_filter(const struct rte_flow_attr *attr,
 	    ipv4_mask->hdr.packet_id ||
 	    ipv4_mask->hdr.fragment_offset ||
 	    ipv4_mask->hdr.time_to_live ||
-	    ipv4_mask->hdr.hdr_checksum) {
+	    ipv4_mask->hdr.hdr_checksum ||
+	    !ipv4_mask->hdr.next_proto_id ||
+	    !ipv4_mask->hdr.dst_addr ||
+	    !ipv4_mask->hdr.src_addr ||) {
 			rte_flow_error_set(error,
 			EINVAL, RTE_FLOW_ERROR_TYPE_ITEM,
 			item, "Not supported by ntuple filter");
Signature · 1 line
2.5.5
#1 lore raw
Quoted 14 lines · Wei Zhao

Add more check on the mask of src_addr, dst_addr and next_proto_id in n-tuple filter rule pattern parser.If do not add such check, it maybe cause error in pattern parser.

---
 drivers/net/ixgbe/ixgbe_flow.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/ixgbe/ixgbe_flow.c +0 -0
index 82aceed..8f78eee 100644

drivers/net/ixgbe/ixgbe_flow.c cons_parse_ntuple_filter(const struct rte_flow_attr *attr, · line 337

Quoted 8 lines
drivers/net/ixgbe/ixgbe_flow.c +4 -1
@@ -331,7 +331,10 @@ cons_parse_ntuple_filter(const struct rte_flow_attr *attr,
 	    ipv4_mask->hdr.packet_id ||
 	    ipv4_mask->hdr.fragment_offset ||
 	    ipv4_mask->hdr.time_to_live ||
-	    ipv4_mask->hdr.hdr_checksum) {
+	    ipv4_mask->hdr.hdr_checksum ||
+	    !ipv4_mask->hdr.next_proto_id ||
+	    !ipv4_mask->hdr.dst_addr ||
+	    !ipv4_mask->hdr.src_addr ||) {

The '||' at the end seems extra.

Also can you please confirm your sign off?

Quoted 4 lines
drivers/net/ixgbe/ixgbe_flow.c +0 -0
 			rte_flow_error_set(error,
 			EINVAL, RTE_FLOW_ERROR_TYPE_ITEM,
 			item, "Not supported by ntuple filter");
author
#2 lore raw

Hi, Ferruh

Quoted 35 lines

-----Original Message-----
From: Yigit, Ferruh
Sent: Monday, January 23, 2017 8:23 PM
To: Zhao1, Wei <[email protected]>; [email protected]
Cc: zhao wei <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v1] net/ixgbe: add more check in n-tuple filter

drivers/net/ixgbe/ixgbe_flow.c cons_parse_ntuple_filter(const struct

Quoted 14 lines · Wei Zhao

Add more check on the mask of src_addr, dst_addr and next_proto_id in n-tuple filter rule pattern parser.If do not add such check, it maybe cause error in pattern parser.

---
 drivers/net/ixgbe/ixgbe_flow.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/net/ixgbe/ixgbe_flow.c index 82aceed..8f78eee 100644

drivers/net/ixgbe/ixgbe_flow.c +0 -0
@@ -331,7 +331,10 @@ cons_parse_ntuple_filter(const struct

rte_flow_attr *attr,

drivers/net/ixgbe/ixgbe_flow.c cons_parse_ntuple_filter(const struct rte_flow_attr *attr, · line 337

Quoted 8 lines
drivers/net/ixgbe/ixgbe_flow.c +4 -1
 	    ipv4_mask->hdr.packet_id ||
 	    ipv4_mask->hdr.fragment_offset ||
 	    ipv4_mask->hdr.time_to_live ||
-	    ipv4_mask->hdr.hdr_checksum) {
+	    ipv4_mask->hdr.hdr_checksum ||
+	    !ipv4_mask->hdr.next_proto_id ||
+	    !ipv4_mask->hdr.dst_addr ||
+	    !ipv4_mask->hdr.src_addr ||) {

The '||' at the end seems extra.

Quoted 6 lines

Also can you please confirm your sign off?

Quoted 4 lines
drivers/net/ixgbe/ixgbe_flow.c +0 -0
 			rte_flow_error_set(error,
 			EINVAL, RTE_FLOW_ERROR_TYPE_ITEM,
 			item, "Not supported by ntuple filter");

This patch has been change to suspended on patchwork net. Thank you.