summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYahui Cao <yahui.cao@intel.com>2019-11-21 19:20:15 +0800
committerFerruh Yigit <ferruh.yigit@intel.com>2019-11-21 13:06:10 +0000
commita39c4851f80ebd86fadb10b96aaeb27764006d5d (patch)
tree6a7822962c5c1a37c2599a36722b6cef8a23692a
parentb81281592e7e3ed64979e4e3b046a8bd65399034 (diff)
downloaddpdk-next-net-intel-a39c4851f80ebd86fadb10b96aaeb27764006d5d.zip
dpdk-next-net-intel-a39c4851f80ebd86fadb10b96aaeb27764006d5d.tar.gz
dpdk-next-net-intel-a39c4851f80ebd86fadb10b96aaeb27764006d5d.tar.xz
net/ice: support flow director for normal GTPU
Add FDIR support for normal GTP-U packet, which doesn't contain GTP_PSC extension header. Fixes: efc16c621415 ("net/ice: support flow director GTPU tunnel") Signed-off-by: Yahui Cao <yahui.cao@intel.com> Acked-by: Qi Zhang <qi.z.zhang@intel.com>
-rw-r--r--drivers/net/ice/ice_fdir_filter.c9
-rw-r--r--drivers/net/ice/ice_generic_flow.c8
-rw-r--r--drivers/net/ice/ice_generic_flow.h1
3 files changed, 16 insertions, 2 deletions
diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c
index f63cb7b..fa87074 100644
--- a/drivers/net/ice/ice_fdir_filter.c
+++ b/drivers/net/ice/ice_fdir_filter.c
@@ -67,6 +67,9 @@
ICE_FDIR_INSET_VXLAN_IPV4 | \
ICE_INSET_TUN_SCTP_SRC_PORT | ICE_INSET_TUN_SCTP_DST_PORT)
+#define ICE_FDIR_INSET_GTPU_IPV4 (\
+ ICE_INSET_GTPU_TEID)
+
#define ICE_FDIR_INSET_GTPU_EH_IPV4 (\
ICE_INSET_GTPU_TEID | ICE_INSET_GTPU_QFI)
@@ -122,6 +125,7 @@ static struct ice_pattern_match_item ice_fdir_pattern_comms[] = {
ICE_FDIR_INSET_VXLAN_IPV4_TCP, ICE_INSET_NONE},
{pattern_eth_ipv4_udp_vxlan_eth_ipv4_sctp,
ICE_FDIR_INSET_VXLAN_IPV4_SCTP, ICE_INSET_NONE},
+ {pattern_eth_ipv4_gtpu_ipv4, ICE_FDIR_INSET_GTPU_IPV4, ICE_INSET_NONE},
{pattern_eth_ipv4_gtpu_eh_ipv4,
ICE_FDIR_INSET_GTPU_EH_IPV4, ICE_INSET_NONE},
};
@@ -981,6 +985,7 @@ ice_fdir_input_set_conf(struct ice_pf *pf, enum ice_fltr_ptype flow,
case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_ICMP:
case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_OTHER:
ICE_FLOW_SET_HDRS(seg, ICE_FLOW_SEG_HDR_GTPU_EH |
+ ICE_FLOW_SEG_HDR_GTPU_IP |
ICE_FLOW_SEG_HDR_IPV4);
break;
default:
@@ -1877,6 +1882,8 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
filter->input.gtpu_data.teid = gtp_spec->teid;
}
+
+ tunnel_type = ICE_FDIR_TUNNEL_TYPE_GTPU;
break;
case RTE_FLOW_ITEM_TYPE_GTP_PSC:
gtp_psc_spec = item->spec;
@@ -1889,8 +1896,6 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
filter->input.gtpu_data.qfi =
gtp_psc_spec->qfi;
}
-
- tunnel_type = ICE_FDIR_TUNNEL_TYPE_GTPU;
break;
default:
rte_flow_error_set(error, EINVAL,
diff --git a/drivers/net/ice/ice_generic_flow.c b/drivers/net/ice/ice_generic_flow.c
index 6bc3086..c9efa83 100644
--- a/drivers/net/ice/ice_generic_flow.c
+++ b/drivers/net/ice/ice_generic_flow.c
@@ -1034,6 +1034,14 @@ enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv6_icmp6[] = {
};
/* GTPU */
+enum rte_flow_item_type pattern_eth_ipv4_gtpu_ipv4[] = {
+ RTE_FLOW_ITEM_TYPE_ETH,
+ RTE_FLOW_ITEM_TYPE_IPV4,
+ RTE_FLOW_ITEM_TYPE_UDP,
+ RTE_FLOW_ITEM_TYPE_GTPU,
+ RTE_FLOW_ITEM_TYPE_IPV4,
+ RTE_FLOW_ITEM_TYPE_END,
+};
enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv4[] = {
RTE_FLOW_ITEM_TYPE_ETH,
RTE_FLOW_ITEM_TYPE_IPV4,
diff --git a/drivers/net/ice/ice_generic_flow.h b/drivers/net/ice/ice_generic_flow.h
index a598cea..ac085b4 100644
--- a/drivers/net/ice/ice_generic_flow.h
+++ b/drivers/net/ice/ice_generic_flow.h
@@ -336,6 +336,7 @@ extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv6_sctp[];
extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv6_icmp6[];
/* GTPU */
+extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_ipv4[];
extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv4[];
extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv4_udp[];
extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv4_tcp[];