summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorFaicker Mo <faicker.mo@ucloud.cn>2018-09-18 13:48:52 +0800
committerFerruh Yigit <ferruh.yigit@intel.com>2018-10-26 22:14:06 +0200
commitd0dd0cf06135ec043c587bf14b66ec55adde876a (patch)
tree70d015b1ad76b20c82a3baa1f6d38e292fe84f0a /drivers
parentc10cdce180a6ac535dc420376f115ca4ac44aead (diff)
downloaddpdk-d0dd0cf06135ec043c587bf14b66ec55adde876a.zip
dpdk-d0dd0cf06135ec043c587bf14b66ec55adde876a.tar.gz
dpdk-d0dd0cf06135ec043c587bf14b66ec55adde876a.tar.xz
net/ixgbe: fix flow create in ntuple check
In ixgbe_flow_create function, ntuple filter is parsed first. If the flow is considered to be ntuple filter, it will not go on to judge ethertype filter, syn filter and fdir filter. In the function ntuple_filter_to_5tuple, 5 tuple info is checked, but it's too late to jump over the ntuple filter if it's a fdir filter. Fixes: 46ea969177f3 ("net/ixgbe: add ntuple support to flow parser") Cc: stable@dpdk.org Signed-off-by: Faicker Mo <faicker.mo@ucloud.cn> Acked-by: Wei Zhao <wei.zhao1@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ixgbe/ixgbe_flow.c29
1 files changed, 29 insertions, 0 deletions
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 @@ cons_parse_ntuple_filter(const struct rte_flow_attr *attr,
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 @@ cons_parse_ntuple_filter(const struct rte_flow_attr *attr,
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 @@ cons_parse_ntuple_filter(const struct rte_flow_attr *attr,
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;