DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] common/iavf: add GTPC support
@ 2020-08-27  7:31 alvinx.zhang
  2020-08-27  7:31 ` [dpdk-dev] [PATCH 2/2] net/iavf: support outer IP hash for GTPC alvinx.zhang
  2020-08-31  6:32 ` [dpdk-dev] [PATCH 1/2] common/iavf: add GTPC support alvinx.zhang
  0 siblings, 2 replies; 4+ messages in thread
From: alvinx.zhang @ 2020-08-27  7:31 UTC (permalink / raw)
  To: jia.guo, qi.z.zhang; +Cc: dev, Alvin Zhang

From: Alvin Zhang <alvinx.zhang@intel.com>

Add GTPC header and its field selector.

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
---
 drivers/common/iavf/virtchnl.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/common/iavf/virtchnl.h b/drivers/common/iavf/virtchnl.h
index 79515ee..0042cc0 100644
--- a/drivers/common/iavf/virtchnl.h
+++ b/drivers/common/iavf/virtchnl.h
@@ -852,6 +852,7 @@ enum virtchnl_proto_hdr_type {
 	VIRTCHNL_PROTO_HDR_ESP,
 	VIRTCHNL_PROTO_HDR_AH,
 	VIRTCHNL_PROTO_HDR_PFCP,
+	VIRTCHNL_PROTO_HDR_GTPC,
 };
 
 /* Protocol header field within a protocol header. */
@@ -916,6 +917,9 @@ enum virtchnl_proto_hdr_field {
 	VIRTCHNL_PROTO_HDR_PFCP_S_FIELD =
 		PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_PFCP),
 	VIRTCHNL_PROTO_HDR_PFCP_SEID,
+	/* GTPC */
+	VIRTCHNL_PROTO_HDR_GTPC_TEID =
+		PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_GTPC),
 };
 
 struct virtchnl_proto_hdr {
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH 2/2] net/iavf: support outer IP hash for GTPC
  2020-08-27  7:31 [dpdk-dev] [PATCH 1/2] common/iavf: add GTPC support alvinx.zhang
@ 2020-08-27  7:31 ` alvinx.zhang
  2020-08-31  6:32 ` [dpdk-dev] [PATCH 1/2] common/iavf: add GTPC support alvinx.zhang
  1 sibling, 0 replies; 4+ messages in thread
From: alvinx.zhang @ 2020-08-27  7:31 UTC (permalink / raw)
  To: jia.guo, qi.z.zhang; +Cc: dev, Alvin Zhang

From: Alvin Zhang <alvinx.zhang@intel.com>

Add patterns for GTPC, now outer IP hash can be configured as input set for
GTPC packet.

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
---
 drivers/net/iavf/iavf_generic_flow.c |  36 +++++++++++
 drivers/net/iavf/iavf_generic_flow.h |   8 +++
 drivers/net/iavf/iavf_hash.c         | 122 ++++++++++++++++++++++++++++++++++-
 3 files changed, 164 insertions(+), 2 deletions(-)

diff --git a/drivers/net/iavf/iavf_generic_flow.c b/drivers/net/iavf/iavf_generic_flow.c
index 321a4dc..44fab4d 100644
--- a/drivers/net/iavf/iavf_generic_flow.c
+++ b/drivers/net/iavf/iavf_generic_flow.c
@@ -315,6 +315,24 @@ enum rte_flow_item_type iavf_pattern_eth_qinq_ipv6_icmp6[] = {
 	RTE_FLOW_ITEM_TYPE_END,
 };
 
+/* IPV4 GTPC */
+enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpc[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_GTPC,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_vlan_ipv4_gtpc[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_VLAN,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_GTPC,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
 /* IPV4 GTPU (EH) */
 enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu[] = {
 	RTE_FLOW_ITEM_TYPE_ETH,
@@ -333,6 +351,24 @@ enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_eh[] = {
 	RTE_FLOW_ITEM_TYPE_END,
 };
 
+/* IPV6 GTPC */
+enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpc[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_GTPC,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_vlan_ipv6_gtpc[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_VLAN,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_GTPC,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
 /* IPV6 GTPU (EH) */
 enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu[] = {
 	RTE_FLOW_ITEM_TYPE_ETH,
diff --git a/drivers/net/iavf/iavf_generic_flow.h b/drivers/net/iavf/iavf_generic_flow.h
index f365cc3..eb466f9 100644
--- a/drivers/net/iavf/iavf_generic_flow.h
+++ b/drivers/net/iavf/iavf_generic_flow.h
@@ -182,10 +182,18 @@
 extern enum rte_flow_item_type iavf_pattern_eth_vlan_ipv6_icmp6[];
 extern enum rte_flow_item_type iavf_pattern_eth_qinq_ipv6_icmp6[];
 
+/* IPV4 GTPC */
+extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpc[];
+extern enum rte_flow_item_type iavf_pattern_eth_vlan_ipv4_gtpc[];
+
 /* IPv4 GTPU (EH) */
 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu[];
 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_eh[];
 
+/* IPV4 GTPC */
+extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpc[];
+extern enum rte_flow_item_type iavf_pattern_eth_vlan_ipv6_gtpc[];
+
 /* IPv6 GTPU (EH) */
 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu[];
 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_eh[];
diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c
index c06b52e..7bc32b0 100644
--- a/drivers/net/iavf/iavf_hash.c
+++ b/drivers/net/iavf/iavf_hash.c
@@ -41,6 +41,8 @@ enum iavf_pattern_hint_type {
 	IAVF_PHINT_IPV6_GTPU_EH			= 0x00002000,
 	IAVF_PHINT_IPV6_GTPU_EH_DWNLINK		= 0x00004000,
 	IAVF_PHINT_IPV6_GTPU_EH_UPLINK		= 0x00008000,
+	IAVF_PHINT_IPV4_GTPC			= 0x00010000,
+	IAVF_PHINT_IPV6_GTPC			= 0x00020000,
 };
 
 #define IAVF_GTPU_EH_DWNLINK	0
@@ -189,6 +191,10 @@ struct iavf_hash_flow_cfg {
 	IAVF_PHINT_IPV6_TCP};
 static struct iavf_pattern_match_type phint_eth_vlan_ipv6_sctp = {
 	IAVF_PHINT_IPV6_SCTP};
+static struct iavf_pattern_match_type phint_eth_ipv4_gtpc = {
+	IAVF_PHINT_IPV4_GTPC };
+static struct iavf_pattern_match_type phint_eth_ipv6_gtpc = {
+	IAVF_PHINT_IPV6_GTPC };
 
 /**
  * Supported pattern for hash.
@@ -281,6 +287,12 @@ struct iavf_hash_flow_cfg {
 					&phint_eth_vlan_ipv6_tcp},
 	{iavf_pattern_eth_vlan_ipv6_sctp, IAVF_INSET_NONE,
 					&phint_eth_vlan_ipv6_sctp},
+	{iavf_pattern_eth_ipv4_gtpc, IAVF_INSET_NONE, &phint_eth_ipv4_gtpc},
+	{iavf_pattern_eth_ipv6_gtpc, IAVF_INSET_NONE, &phint_eth_ipv6_gtpc},
+	{iavf_pattern_eth_vlan_ipv4_gtpc, IAVF_INSET_NONE,
+					&phint_eth_ipv4_gtpc},
+	{iavf_pattern_eth_vlan_ipv6_gtpc, IAVF_INSET_NONE,
+					&phint_eth_ipv6_gtpc},
 	{iavf_pattern_empty, IAVF_INSET_NONE, &phint_empty},
 };
 
@@ -290,6 +302,7 @@ struct iavf_hash_flow_cfg {
 #define PROTO_COUNT_ONE			1
 #define PROTO_COUNT_TWO			2
 #define PROTO_COUNT_THREE		3
+#define PROTO_COUNT_FOUR		4
 
 #define BUFF_NOUSED			0
 #define FIELD_FOR_PROTO_ONLY		0
@@ -445,6 +458,10 @@ struct iavf_hash_flow_cfg {
 	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_DST) | \
 	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_PROT), {BUFF_NOUSED } }
 
+#define proto_hint_gtpc_only { \
+	VIRTCHNL_PROTO_HDR_GTPC, \
+	FIELD_FOR_PROTO_ONLY, {BUFF_NOUSED } }
+
 #define proto_hint_gtpu_ip_teid { \
 	VIRTCHNL_PROTO_HDR_GTPU_IP, \
 	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_GTPU_IP_TEID), {BUFF_NOUSED } }
@@ -770,6 +787,37 @@ struct virtchnl_proto_hdrs hdrs_hint_ipv4_udp_esp = {
 	proto_hint_udp_only, proto_hint_esp }
 };
 
+/* IPv4 GTPC */
+struct virtchnl_proto_hdrs hdrs_hint_ipv4_gtpc = {
+	TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_ipv4,
+	proto_hint_udp_only, proto_hint_gtpc_only}
+};
+
+struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_gtpc = {
+	TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_ipv4_dst,
+	proto_hint_udp_only, proto_hint_gtpc_only}
+};
+
+struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_gtpc = {
+	TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_ipv4_src,
+	proto_hint_udp_only, proto_hint_gtpc_only}
+};
+
+struct virtchnl_proto_hdrs hdrs_hint_cvlan_ipv4_gtpc = {
+	TUNNEL_LEVEL_OUTER, PROTO_COUNT_FOUR, {proto_hint_cvlan,
+	proto_hint_ipv4, proto_hint_udp_only, proto_hint_gtpc_only}
+};
+
+struct virtchnl_proto_hdrs hdrs_hint_cvlan_ipv4_dst_gtpc = {
+	TUNNEL_LEVEL_OUTER, PROTO_COUNT_FOUR, {proto_hint_cvlan,
+	proto_hint_ipv4_dst, proto_hint_udp_only, proto_hint_gtpc_only}
+};
+
+struct virtchnl_proto_hdrs hdrs_hint_cvlan_ipv4_src_gtpc = {
+	TUNNEL_LEVEL_OUTER, PROTO_COUNT_FOUR, {proto_hint_cvlan,
+	proto_hint_ipv4_src, proto_hint_udp_only, proto_hint_gtpc_only}
+};
+
 /* IPv4 GTPU IP */
 
 struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_gtpu_ip = {
@@ -891,6 +939,37 @@ struct virtchnl_proto_hdrs hdrs_hint_teid_gtpu_ip = {
 	TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_ip_teid}
 };
 
+/* IPv6 GTPC */
+struct virtchnl_proto_hdrs hdrs_hint_ipv6_gtpc = {
+	TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_ipv6,
+	proto_hint_udp_only, proto_hint_gtpc_only}
+};
+
+struct virtchnl_proto_hdrs hdrs_hint_ipv6_dst_gtpc = {
+	TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_ipv6_dst,
+	proto_hint_udp_only, proto_hint_gtpc_only}
+};
+
+struct virtchnl_proto_hdrs hdrs_hint_ipv6_src_gtpc = {
+	TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_ipv6_src,
+	proto_hint_udp_only, proto_hint_gtpc_only}
+};
+
+struct virtchnl_proto_hdrs hdrs_hint_cvlan_ipv6_gtpc = {
+	TUNNEL_LEVEL_OUTER, PROTO_COUNT_FOUR, {proto_hint_cvlan,
+	proto_hint_ipv6, proto_hint_udp_only, proto_hint_gtpc_only}
+};
+
+struct virtchnl_proto_hdrs hdrs_hint_cvlan_ipv6_dst_gtpc = {
+	TUNNEL_LEVEL_OUTER, PROTO_COUNT_FOUR, {proto_hint_cvlan,
+	proto_hint_ipv6_dst, proto_hint_udp_only, proto_hint_gtpc_only}
+};
+
+struct virtchnl_proto_hdrs hdrs_hint_cvlan_ipv6_src_gtpc = {
+	TUNNEL_LEVEL_OUTER, PROTO_COUNT_FOUR, {proto_hint_cvlan,
+	proto_hint_ipv6_src, proto_hint_udp_only, proto_hint_gtpc_only}
+};
+
 /* IPv6 GTPU IP */
 
 struct virtchnl_proto_hdrs hdrs_hint_ipv6_src_gtpu_ip = {
@@ -2267,7 +2346,44 @@ struct iavf_hash_match_type iavf_hash_map_list[] = {
 };
 
 struct iavf_hash_match_type iavf_gtpu_hash_map_list[] = {
-	/* GTPU */
+	/* IPv4 GTPC */
+	{ETH_RSS_IPV4,
+		&hdrs_hint_ipv4_gtpc, IAVF_PHINT_IPV4_GTPC},
+	{ETH_RSS_IPV4 |
+		ETH_RSS_L3_DST_ONLY,
+		&hdrs_hint_ipv4_dst_gtpc, IAVF_PHINT_IPV4_GTPC},
+	{ETH_RSS_IPV4 |
+		ETH_RSS_L3_SRC_ONLY,
+		&hdrs_hint_ipv4_src_gtpc, IAVF_PHINT_IPV4_GTPC},
+	{ETH_RSS_C_VLAN |
+		ETH_RSS_IPV4,
+		&hdrs_hint_cvlan_ipv4_gtpc, IAVF_PHINT_IPV4_GTPC},
+	{ETH_RSS_C_VLAN |
+		ETH_RSS_IPV4 | ETH_RSS_L3_DST_ONLY,
+		&hdrs_hint_cvlan_ipv4_dst_gtpc, IAVF_PHINT_IPV4_GTPC},
+	{ETH_RSS_C_VLAN |
+		ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY,
+		&hdrs_hint_cvlan_ipv4_src_gtpc, IAVF_PHINT_IPV4_GTPC},
+
+	/* IPv6 GTPC */
+	{ETH_RSS_IPV6,
+		&hdrs_hint_ipv6_gtpc, IAVF_PHINT_IPV6_GTPC},
+	{ETH_RSS_IPV6 |
+		ETH_RSS_L3_DST_ONLY,
+		&hdrs_hint_ipv6_dst_gtpc, IAVF_PHINT_IPV6_GTPC},
+	{ETH_RSS_IPV6 |
+		ETH_RSS_L3_SRC_ONLY,
+		&hdrs_hint_ipv6_src_gtpc, IAVF_PHINT_IPV6_GTPC},
+	{ETH_RSS_C_VLAN |
+		ETH_RSS_IPV6,
+		&hdrs_hint_cvlan_ipv6_gtpc, IAVF_PHINT_IPV6_GTPC},
+	{ETH_RSS_C_VLAN |
+		ETH_RSS_IPV6 | ETH_RSS_L3_DST_ONLY,
+		&hdrs_hint_cvlan_ipv6_dst_gtpc, IAVF_PHINT_IPV6_GTPC},
+	{ETH_RSS_C_VLAN |
+		ETH_RSS_IPV6 | ETH_RSS_L3_SRC_ONLY,
+		&hdrs_hint_cvlan_ipv6_src_gtpc, IAVF_PHINT_IPV6_GTPC},
+
 	/* GTPU IP */
 	/* IPv4 GTPU IP IPv4*/
 	{ETH_RSS_IPV4 |
@@ -3841,7 +3957,9 @@ struct virtchnl_proto_hdrs *iavf_hash_default_hdrs[] = {
 			    (pattern_hint & IAVF_PHINT_IPV6_GTPU_IP) ||
 			    (pattern_hint & IAVF_PHINT_IPV6_GTPU_EH) ||
 			    (pattern_hint & IAVF_PHINT_IPV6_GTPU_EH_UPLINK) ||
-			    (pattern_hint & IAVF_PHINT_IPV6_GTPU_EH_DWNLINK)) {
+			    (pattern_hint & IAVF_PHINT_IPV6_GTPU_EH_DWNLINK) ||
+			    (pattern_hint & IAVF_PHINT_IPV4_GTPC) ||
+			    (pattern_hint & IAVF_PHINT_IPV6_GTPC)) {
 				hash_map_list = iavf_gtpu_hash_map_list;
 				mlist_len = RTE_DIM(iavf_gtpu_hash_map_list);
 			} else {
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH 1/2] common/iavf: add GTPC support
  2020-08-27  7:31 [dpdk-dev] [PATCH 1/2] common/iavf: add GTPC support alvinx.zhang
  2020-08-27  7:31 ` [dpdk-dev] [PATCH 2/2] net/iavf: support outer IP hash for GTPC alvinx.zhang
@ 2020-08-31  6:32 ` alvinx.zhang
  2020-08-31  6:32   ` [dpdk-dev] [PATCH 2/2] net/iavf: support outer IP hash for GTPC alvinx.zhang
  1 sibling, 1 reply; 4+ messages in thread
From: alvinx.zhang @ 2020-08-31  6:32 UTC (permalink / raw)
  To: jia.guo, qi.z.zhang; +Cc: dev, Alvin Zhang

From: Alvin Zhang <alvinx.zhang@intel.com>

Add GTPC header and its field selector.

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
---
 drivers/common/iavf/virtchnl.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/common/iavf/virtchnl.h b/drivers/common/iavf/virtchnl.h
index 79515ee..0042cc0 100644
--- a/drivers/common/iavf/virtchnl.h
+++ b/drivers/common/iavf/virtchnl.h
@@ -852,6 +852,7 @@ enum virtchnl_proto_hdr_type {
 	VIRTCHNL_PROTO_HDR_ESP,
 	VIRTCHNL_PROTO_HDR_AH,
 	VIRTCHNL_PROTO_HDR_PFCP,
+	VIRTCHNL_PROTO_HDR_GTPC,
 };
 
 /* Protocol header field within a protocol header. */
@@ -916,6 +917,9 @@ enum virtchnl_proto_hdr_field {
 	VIRTCHNL_PROTO_HDR_PFCP_S_FIELD =
 		PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_PFCP),
 	VIRTCHNL_PROTO_HDR_PFCP_SEID,
+	/* GTPC */
+	VIRTCHNL_PROTO_HDR_GTPC_TEID =
+		PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_GTPC),
 };
 
 struct virtchnl_proto_hdr {
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH 2/2] net/iavf: support outer IP hash for GTPC
  2020-08-31  6:32 ` [dpdk-dev] [PATCH 1/2] common/iavf: add GTPC support alvinx.zhang
@ 2020-08-31  6:32   ` alvinx.zhang
  0 siblings, 0 replies; 4+ messages in thread
From: alvinx.zhang @ 2020-08-31  6:32 UTC (permalink / raw)
  To: jia.guo, qi.z.zhang; +Cc: dev, Alvin Zhang

From: Alvin Zhang <alvinx.zhang@intel.com>

Add patterns for GTPC, now outer IP hash can be configured as input set for
GTPC packet.

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
---
v2:
 - Remove VLAN as input sets.
 drivers/net/iavf/iavf_generic_flow.c | 18 +++++++++
 drivers/net/iavf/iavf_generic_flow.h |  6 +++
 drivers/net/iavf/iavf_hash.c         | 77 +++++++++++++++++++++++++++++++++++-
 3 files changed, 99 insertions(+), 2 deletions(-)

diff --git a/drivers/net/iavf/iavf_generic_flow.c b/drivers/net/iavf/iavf_generic_flow.c
index 321a4dc..aaa7c97 100644
--- a/drivers/net/iavf/iavf_generic_flow.c
+++ b/drivers/net/iavf/iavf_generic_flow.c
@@ -315,6 +315,15 @@ enum rte_flow_item_type iavf_pattern_eth_qinq_ipv6_icmp6[] = {
 	RTE_FLOW_ITEM_TYPE_END,
 };
 
+/* IPV4 GTPC */
+enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpc[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_GTPC,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
 /* IPV4 GTPU (EH) */
 enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu[] = {
 	RTE_FLOW_ITEM_TYPE_ETH,
@@ -333,6 +342,15 @@ enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_eh[] = {
 	RTE_FLOW_ITEM_TYPE_END,
 };
 
+/* IPV6 GTPC */
+enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpc[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_GTPC,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
 /* IPV6 GTPU (EH) */
 enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu[] = {
 	RTE_FLOW_ITEM_TYPE_ETH,
diff --git a/drivers/net/iavf/iavf_generic_flow.h b/drivers/net/iavf/iavf_generic_flow.h
index f365cc3..c756a08 100644
--- a/drivers/net/iavf/iavf_generic_flow.h
+++ b/drivers/net/iavf/iavf_generic_flow.h
@@ -182,10 +182,16 @@
 extern enum rte_flow_item_type iavf_pattern_eth_vlan_ipv6_icmp6[];
 extern enum rte_flow_item_type iavf_pattern_eth_qinq_ipv6_icmp6[];
 
+/* IPV4 GTPC */
+extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpc[];
+
 /* IPv4 GTPU (EH) */
 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu[];
 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_eh[];
 
+/* IPV4 GTPC */
+extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpc[];
+
 /* IPv6 GTPU (EH) */
 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu[];
 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_eh[];
diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c
index dfc6822..3658895 100644
--- a/drivers/net/iavf/iavf_hash.c
+++ b/drivers/net/iavf/iavf_hash.c
@@ -41,6 +41,8 @@ enum iavf_pattern_hint_type {
 	IAVF_PHINT_IPV6_GTPU_EH			= 0x00002000,
 	IAVF_PHINT_IPV6_GTPU_EH_DWNLINK		= 0x00004000,
 	IAVF_PHINT_IPV6_GTPU_EH_UPLINK		= 0x00008000,
+	IAVF_PHINT_IPV4_GTPC			= 0x00010000,
+	IAVF_PHINT_IPV6_GTPC			= 0x00020000,
 };
 
 #define IAVF_GTPU_EH_DWNLINK	0
@@ -189,6 +191,10 @@ struct iavf_hash_flow_cfg {
 	IAVF_PHINT_IPV6_TCP};
 static struct iavf_pattern_match_type phint_eth_vlan_ipv6_sctp = {
 	IAVF_PHINT_IPV6_SCTP};
+static struct iavf_pattern_match_type phint_eth_ipv4_gtpc = {
+	IAVF_PHINT_IPV4_GTPC };
+static struct iavf_pattern_match_type phint_eth_ipv6_gtpc = {
+	IAVF_PHINT_IPV6_GTPC };
 
 /**
  * Supported pattern for hash.
@@ -281,6 +287,8 @@ struct iavf_hash_flow_cfg {
 					&phint_eth_vlan_ipv6_tcp},
 	{iavf_pattern_eth_vlan_ipv6_sctp, IAVF_INSET_NONE,
 					&phint_eth_vlan_ipv6_sctp},
+	{iavf_pattern_eth_ipv4_gtpc, IAVF_INSET_NONE, &phint_eth_ipv4_gtpc},
+	{iavf_pattern_eth_ipv6_gtpc, IAVF_INSET_NONE, &phint_eth_ipv6_gtpc},
 	{iavf_pattern_empty, IAVF_INSET_NONE, &phint_empty},
 };
 
@@ -445,6 +453,10 @@ struct iavf_hash_flow_cfg {
 	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_DST) | \
 	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_PROT), {BUFF_NOUSED } }
 
+#define proto_hint_gtpc_only { \
+	VIRTCHNL_PROTO_HDR_GTPC, \
+	FIELD_FOR_PROTO_ONLY, {BUFF_NOUSED } }
+
 #define proto_hint_gtpu_ip_teid { \
 	VIRTCHNL_PROTO_HDR_GTPU_IP, \
 	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_GTPU_IP_TEID), {BUFF_NOUSED } }
@@ -770,6 +782,22 @@ struct virtchnl_proto_hdrs hdrs_hint_ipv4_udp_esp = {
 	proto_hint_udp_only, proto_hint_esp }
 };
 
+/* IPv4 GTPC */
+struct virtchnl_proto_hdrs hdrs_hint_ipv4_gtpc = {
+	TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_ipv4,
+	proto_hint_udp_only, proto_hint_gtpc_only}
+};
+
+struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_gtpc = {
+	TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_ipv4_dst,
+	proto_hint_udp_only, proto_hint_gtpc_only}
+};
+
+struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_gtpc = {
+	TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_ipv4_src,
+	proto_hint_udp_only, proto_hint_gtpc_only}
+};
+
 /* IPv4 GTPU IP */
 
 struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_gtpu_ip = {
@@ -891,6 +919,22 @@ struct virtchnl_proto_hdrs hdrs_hint_teid_gtpu_ip = {
 	TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_ip_teid}
 };
 
+/* IPv6 GTPC */
+struct virtchnl_proto_hdrs hdrs_hint_ipv6_gtpc = {
+	TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_ipv6,
+	proto_hint_udp_only, proto_hint_gtpc_only}
+};
+
+struct virtchnl_proto_hdrs hdrs_hint_ipv6_dst_gtpc = {
+	TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_ipv6_dst,
+	proto_hint_udp_only, proto_hint_gtpc_only}
+};
+
+struct virtchnl_proto_hdrs hdrs_hint_ipv6_src_gtpc = {
+	TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_ipv6_src,
+	proto_hint_udp_only, proto_hint_gtpc_only}
+};
+
 /* IPv6 GTPU IP */
 
 struct virtchnl_proto_hdrs hdrs_hint_ipv6_src_gtpu_ip = {
@@ -2371,7 +2415,34 @@ struct iavf_hash_match_type iavf_hash_map_list[] = {
 };
 
 struct iavf_hash_match_type iavf_gtpu_hash_map_list[] = {
-	/* GTPU */
+	/* IPv4 GTPC */
+	{ETH_RSS_IPV4,
+		&hdrs_hint_ipv4_gtpc, IAVF_PHINT_IPV4_GTPC},
+	{ETH_RSS_IPV4 |
+		ETH_RSS_L3_DST_ONLY,
+		&hdrs_hint_ipv4_dst_gtpc, IAVF_PHINT_IPV4_GTPC},
+	{ETH_RSS_L3_DST_ONLY,
+		&hdrs_hint_ipv4_dst_gtpc, IAVF_PHINT_IPV4_GTPC},
+	{ETH_RSS_IPV4 |
+		ETH_RSS_L3_SRC_ONLY,
+		&hdrs_hint_ipv4_src_gtpc, IAVF_PHINT_IPV4_GTPC},
+	{ETH_RSS_L3_SRC_ONLY,
+		&hdrs_hint_ipv4_src_gtpc, IAVF_PHINT_IPV4_GTPC},
+
+	/* IPv6 GTPC */
+	{ETH_RSS_IPV6,
+		&hdrs_hint_ipv6_gtpc, IAVF_PHINT_IPV6_GTPC},
+	{ETH_RSS_IPV6 |
+		ETH_RSS_L3_DST_ONLY,
+		&hdrs_hint_ipv6_dst_gtpc, IAVF_PHINT_IPV6_GTPC},
+	{ETH_RSS_L3_DST_ONLY,
+		&hdrs_hint_ipv6_dst_gtpc, IAVF_PHINT_IPV6_GTPC},
+	{ETH_RSS_IPV6 |
+		ETH_RSS_L3_SRC_ONLY,
+		&hdrs_hint_ipv6_src_gtpc, IAVF_PHINT_IPV6_GTPC},
+	{ETH_RSS_L3_SRC_ONLY,
+		&hdrs_hint_ipv6_src_gtpc, IAVF_PHINT_IPV6_GTPC},
+
 	/* GTPU IP */
 	/* IPv4 GTPU IP IPv4*/
 	{ETH_RSS_L3_SRC_ONLY,
@@ -4200,7 +4271,9 @@ struct virtchnl_proto_hdrs *iavf_hash_default_hdrs[] = {
 			    (pattern_hint & IAVF_PHINT_IPV6_GTPU_IP) ||
 			    (pattern_hint & IAVF_PHINT_IPV6_GTPU_EH) ||
 			    (pattern_hint & IAVF_PHINT_IPV6_GTPU_EH_UPLINK) ||
-			    (pattern_hint & IAVF_PHINT_IPV6_GTPU_EH_DWNLINK)) {
+			    (pattern_hint & IAVF_PHINT_IPV6_GTPU_EH_DWNLINK) ||
+			    (pattern_hint & IAVF_PHINT_IPV4_GTPC) ||
+			    (pattern_hint & IAVF_PHINT_IPV6_GTPC)) {
 				hash_map_list = iavf_gtpu_hash_map_list;
 				mlist_len = RTE_DIM(iavf_gtpu_hash_map_list);
 			} else {
-- 
1.8.3.1


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

end of thread, other threads:[~2020-08-31  6:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-27  7:31 [dpdk-dev] [PATCH 1/2] common/iavf: add GTPC support alvinx.zhang
2020-08-27  7:31 ` [dpdk-dev] [PATCH 2/2] net/iavf: support outer IP hash for GTPC alvinx.zhang
2020-08-31  6:32 ` [dpdk-dev] [PATCH 1/2] common/iavf: add GTPC support alvinx.zhang
2020-08-31  6:32   ` [dpdk-dev] [PATCH 2/2] net/iavf: support outer IP hash for GTPC alvinx.zhang

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git