DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/ixgbe: put 5tuple check in front to jump over ntuple filter case
@ 2018-09-18  5:48 faicker.mo
  2018-09-21 15:48 ` Zhang, Qi Z
  0 siblings, 1 reply; 10+ messages in thread
From: faicker.mo @ 2018-09-18  5:48 UTC (permalink / raw)
  To: dev; +Cc: faicker.mo

From: "faicker.mo" <faicker.mo@ucloud.cn>

Check in func ntuple_filter_to_5tuple is too late for fdir filter rule,
add check in func cons_parse_ntuple_filter.

Signed-off-by: faicker.mo <faicker.mo@ucloud.cn>
---
 drivers/net/ixgbe/ixgbe_flow.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c
index 1adf1b8..f0fafeb 100644
--- a/drivers/net/ixgbe/ixgbe_flow.c
+++ b/drivers/net/ixgbe/ixgbe_flow.c
@@ -363,6 +363,17 @@ const struct rte_flow_action *next_no_void_action(
 				item, "Not supported by ntuple filter");
 			return -rte_errno;
 		}
+		if ((ipv4_mask->hdr.src_addr != 0 &&
+			ipv4_mask->hdr.src_addr != UINT32_MAX) ||
+			(ipv4_mask->hdr.dst_addr != 0 &&
+			ipv4_mask->hdr.dst_addr != UINT32_MAX) ||
+			(ipv4_mask->hdr.next_proto_id != UINT8_MAX &&
+			ipv4_mask->hdr.next_proto_id != 0)) {
+			rte_flow_error_set(error,
+				EINVAL, RTE_FLOW_ERROR_TYPE_ITEM,
+				item, "Not supported by ntuple filter");
+			return -rte_errno;
+		}
 
 		filter->dst_ip_mask = ipv4_mask->hdr.dst_addr;
 		filter->src_ip_mask = ipv4_mask->hdr.src_addr;
@@ -432,6 +443,15 @@ const struct rte_flow_action *next_no_void_action(
 				item, "Not supported by ntuple filter");
 			return -rte_errno;
 		}
+		if ((tcp_mask->hdr.src_port != 0 &&
+			tcp_mask->hdr.src_port != UINT16_MAX) ||
+			(tcp_mask->hdr.dst_port != 0 &&
+			tcp_mask->hdr.dst_port != UINT16_MAX)) {
+			rte_flow_error_set(error,
+				EINVAL, RTE_FLOW_ERROR_TYPE_ITEM,
+				item, "Not supported by ntuple filter");
+			return -rte_errno;
+		}
 
 		filter->dst_port_mask  = tcp_mask->hdr.dst_port;
 		filter->src_port_mask  = tcp_mask->hdr.src_port;
@@ -467,6 +487,15 @@ const struct rte_flow_action *next_no_void_action(
 				item, "Not supported by ntuple filter");
 			return -rte_errno;
 		}
+		if ((udp_mask->hdr.src_port != 0 &&
+			udp_mask->hdr.src_port != UINT16_MAX) ||
+			(udp_mask->hdr.dst_port != 0 &&
+			udp_mask->hdr.dst_port != UINT16_MAX)) {
+			rte_flow_error_set(error,
+				EINVAL, RTE_FLOW_ERROR_TYPE_ITEM,
+				item, "Not supported by ntuple filter");
+			return -rte_errno;
+		}
 
 		filter->dst_port_mask = udp_mask->hdr.dst_port;
 		filter->src_port_mask = udp_mask->hdr.src_port;
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-10-19 17:10 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-18  5:48 [dpdk-dev] [PATCH] net/ixgbe: put 5tuple check in front to jump over ntuple filter case faicker.mo
2018-09-21 15:48 ` Zhang, Qi Z
2018-09-26  8:15   ` mocan
2018-09-26 11:14     ` Zhang, Qi Z
2018-10-08  9:46       ` Zhao1, Wei
2018-10-10 18:36         ` Zhang, Qi Z
2018-10-11  8:10           ` Zhao1, Wei
2018-10-15  3:30             ` Zhang, Qi Z
2018-10-17  5:57               ` Zhao1, Wei
2018-10-19 17:10                 ` Zhang, Qi Z

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).