summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorQi Zhang <qi.z.zhang@intel.com>2019-11-19 09:07:02 +0800
committerFerruh Yigit <ferruh.yigit@intel.com>2019-11-20 17:36:06 +0100
commit6e0fbe16dfc029aeaf6e1250e07f8c7619c87f2b (patch)
tree2c8418df874a092a486fa30f2473283ec992f498 /drivers
parentf078ceb6ae9395f48285850edad41ebc21532de6 (diff)
downloaddpdk-6e0fbe16dfc029aeaf6e1250e07f8c7619c87f2b.zip
dpdk-6e0fbe16dfc029aeaf6e1250e07f8c7619c87f2b.tar.gz
dpdk-6e0fbe16dfc029aeaf6e1250e07f8c7619c87f2b.tar.xz
net/ice: fix flow type selection for flow director
The FDIR parser will select ICE_FLTR_PTYPE_NONF_IPV4_OTHER as flow type for an IPv4 UDP flow with empty l4 matching field which is not correct. Same issues happens on all the combination between IPv4/IPv6 and UDP/TCP/SCTP cases. The patch fixes all the wrong flow ptype selections. Fixes: f5cafa961fae ("net/ice: add flow director create and destroy") Signed-off-by: Qi Zhang <qi.z.zhang@intel.com> Acked-by: Beilei Xing <beilei.xing@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ice/ice_fdir_filter.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c
index 7876f4b..a68c295 100644
--- a/drivers/net/ice/ice_fdir_filter.c
+++ b/drivers/net/ice/ice_fdir_filter.c
@@ -1559,6 +1559,11 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
tcp_spec = item->spec;
tcp_mask = item->mask;
+ if (l3 == RTE_FLOW_ITEM_TYPE_IPV4)
+ flow_type = ICE_FLTR_PTYPE_NONF_IPV4_TCP;
+ else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6)
+ flow_type = ICE_FLTR_PTYPE_NONF_IPV6_TCP;
+
if (tcp_spec && tcp_mask) {
/* Check TCP mask and update input set */
if (tcp_mask->hdr.sent_seq ||
@@ -1590,15 +1595,11 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
tcp_spec->hdr.src_port;
filter->input.ip.v4.src_port =
tcp_spec->hdr.dst_port;
- flow_type =
- ICE_FLTR_PTYPE_NONF_IPV4_TCP;
} else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6) {
filter->input.ip.v6.dst_port =
tcp_spec->hdr.src_port;
filter->input.ip.v6.src_port =
tcp_spec->hdr.dst_port;
- flow_type =
- ICE_FLTR_PTYPE_NONF_IPV6_TCP;
}
}
break;
@@ -1606,6 +1607,11 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
udp_spec = item->spec;
udp_mask = item->mask;
+ if (l3 == RTE_FLOW_ITEM_TYPE_IPV4)
+ flow_type = ICE_FLTR_PTYPE_NONF_IPV4_UDP;
+ else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6)
+ flow_type = ICE_FLTR_PTYPE_NONF_IPV6_UDP;
+
if (udp_spec && udp_mask) {
/* Check UDP mask and update input set*/
if (udp_mask->hdr.dgram_len ||
@@ -1632,15 +1638,11 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
udp_spec->hdr.src_port;
filter->input.ip.v4.src_port =
udp_spec->hdr.dst_port;
- flow_type =
- ICE_FLTR_PTYPE_NONF_IPV4_UDP;
} else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6) {
filter->input.ip.v6.src_port =
udp_spec->hdr.dst_port;
filter->input.ip.v6.dst_port =
udp_spec->hdr.src_port;
- flow_type =
- ICE_FLTR_PTYPE_NONF_IPV6_UDP;
}
}
break;
@@ -1648,6 +1650,11 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
sctp_spec = item->spec;
sctp_mask = item->mask;
+ if (l3 == RTE_FLOW_ITEM_TYPE_IPV4)
+ flow_type = ICE_FLTR_PTYPE_NONF_IPV4_SCTP;
+ else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6)
+ flow_type = ICE_FLTR_PTYPE_NONF_IPV6_SCTP;
+
if (sctp_spec && sctp_mask) {
/* Check SCTP mask and update input set */
if (sctp_mask->hdr.cksum) {
@@ -1673,15 +1680,11 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
sctp_spec->hdr.src_port;
filter->input.ip.v4.src_port =
sctp_spec->hdr.dst_port;
- flow_type =
- ICE_FLTR_PTYPE_NONF_IPV4_SCTP;
} else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6) {
filter->input.ip.v6.dst_port =
sctp_spec->hdr.src_port;
filter->input.ip.v6.src_port =
sctp_spec->hdr.dst_port;
- flow_type =
- ICE_FLTR_PTYPE_NONF_IPV6_SCTP;
}
}
break;