DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v3 1/3] common/iavf: add GTPC support
@ 2020-09-08  9:50 alvinx.zhang
  2020-09-08  9:50 ` [dpdk-dev] [PATCH v3 2/3] net/iavf: support outer IP hash for GTPC alvinx.zhang
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: alvinx.zhang @ 2020-09-08  9:50 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] 17+ messages in thread

* [dpdk-dev] [PATCH v3 2/3] net/iavf: support outer IP hash for GTPC
  2020-09-08  9:50 [dpdk-dev] [PATCH v3 1/3] common/iavf: add GTPC support alvinx.zhang
@ 2020-09-08  9:50 ` alvinx.zhang
  2020-09-08  9:50 ` [dpdk-dev] [PATCH v3 3/3] net/iavf: support outer IP hash for GTPU alvinx.zhang
  2020-09-10  3:36 ` [dpdk-dev] [PATCH v4 1/2] common/iavf: add GTPC support alvinx.zhang
  2 siblings, 0 replies; 17+ messages in thread
From: alvinx.zhang @ 2020-09-08  9:50 UTC (permalink / raw)
  To: jia.guo, qi.z.zhang; +Cc: dev, Alvin Zhang

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

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

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
---
 drivers/net/iavf/iavf_generic_flow.c | 18 ++++++++++++++++++
 drivers/net/iavf/iavf_generic_flow.h |  6 ++++++
 drivers/net/iavf/iavf_hash.c         | 15 +++++++++++++++
 3 files changed, 39 insertions(+)

diff --git a/drivers/net/iavf/iavf_generic_flow.c b/drivers/net/iavf/iavf_generic_flow.c
index 321a4dc..00e7f15 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..dbc7294 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 aab8b14..ddea3dd 100644
--- a/drivers/net/iavf/iavf_hash.c
+++ b/drivers/net/iavf/iavf_hash.c
@@ -132,6 +132,9 @@ struct iavf_hash_flow_cfg {
 	VIRTCHNL_PROTO_HDR_PFCP, \
 	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_PFCP_SEID), {BUFF_NOUSED} }
 
+#define proto_hdr_gtpc { \
+	VIRTCHNL_PROTO_HDR_GTPC, 0, {BUFF_NOUSED} }
+
 #define TUNNEL_LEVEL_OUTER		0
 #define TUNNEL_LEVEL_INNER		1
 
@@ -256,6 +259,14 @@ struct virtchnl_proto_hdrs ipv6_pfcp_tmplt = {
 	TUNNEL_LEVEL_OUTER, 2, {proto_hdr_ipv6, proto_hdr_pfcp}
 };
 
+struct virtchnl_proto_hdrs ipv4_udp_gtpc_tmplt = {
+	TUNNEL_LEVEL_OUTER, 3, {proto_hdr_ipv4, proto_hdr_udp, proto_hdr_gtpc}
+};
+
+struct virtchnl_proto_hdrs ipv6_udp_gtpc_tmplt = {
+	TUNNEL_LEVEL_OUTER, 3, {proto_hdr_ipv6, proto_hdr_udp, proto_hdr_gtpc}
+};
+
 /* rss type super set */
 
 /* IPv4 outer */
@@ -365,6 +376,7 @@ struct virtchnl_proto_hdrs ipv6_pfcp_tmplt = {
 	{iavf_pattern_eth_ipv4_ah,			IAVF_RSS_TYPE_IPV4_AH,		&ipv4_ah_tmplt},
 	{iavf_pattern_eth_ipv4_l2tpv3,			IAVF_RSS_TYPE_IPV4_L2TPV3,	&ipv4_l2tpv3_tmplt},
 	{iavf_pattern_eth_ipv4_pfcp,			IAVF_RSS_TYPE_IPV4_PFCP,	&ipv4_pfcp_tmplt},
+	{iavf_pattern_eth_ipv4_gtpc,			ETH_RSS_IPV4,			&ipv4_udp_gtpc_tmplt},
 	/* IPv6 */
 	{iavf_pattern_eth_ipv6,				IAVF_RSS_TYPE_OUTER_IPV6,	&outer_ipv6_tmplt},
 	{iavf_pattern_eth_ipv6_udp,			IAVF_RSS_TYPE_OUTER_IPV6_UDP,	&outer_ipv6_udp_tmplt},
@@ -391,6 +403,7 @@ struct virtchnl_proto_hdrs ipv6_pfcp_tmplt = {
 	{iavf_pattern_eth_ipv6_ah,			IAVF_RSS_TYPE_IPV6_AH,		&ipv6_ah_tmplt},
 	{iavf_pattern_eth_ipv6_l2tpv3,			IAVF_RSS_TYPE_IPV6_L2TPV3,	&ipv6_l2tpv3_tmplt},
 	{iavf_pattern_eth_ipv6_pfcp,			IAVF_RSS_TYPE_IPV6_PFCP,	&ipv6_pfcp_tmplt},
+	{iavf_pattern_eth_ipv6_gtpc,			ETH_RSS_IPV6,			&ipv6_udp_gtpc_tmplt},
 };
 
 struct virtchnl_proto_hdrs *iavf_hash_default_hdrs[] = {
@@ -592,6 +605,8 @@ struct virtchnl_proto_hdrs *iavf_hash_default_hdrs[] = {
 				else if (rss_type & ETH_RSS_L4_DST_ONLY)
 					VIRTCHNL_DEL_PROTO_HDR_FIELD(hdr,
 						VIRTCHNL_PROTO_HDR_UDP_SRC_PORT);
+			} else {
+				hdr->field_selector = 0;
 			}
 			break;
 		case VIRTCHNL_PROTO_HDR_TCP:
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v3 3/3] net/iavf: support outer IP hash for GTPU
  2020-09-08  9:50 [dpdk-dev] [PATCH v3 1/3] common/iavf: add GTPC support alvinx.zhang
  2020-09-08  9:50 ` [dpdk-dev] [PATCH v3 2/3] net/iavf: support outer IP hash for GTPC alvinx.zhang
@ 2020-09-08  9:50 ` alvinx.zhang
  2020-09-10  3:26   ` [dpdk-dev] [PATCH v4] " alvinx.zhang
  2020-09-10  3:36 ` [dpdk-dev] [PATCH v4 1/2] common/iavf: add GTPC support alvinx.zhang
  2 siblings, 1 reply; 17+ messages in thread
From: alvinx.zhang @ 2020-09-08  9:50 UTC (permalink / raw)
  To: jia.guo, qi.z.zhang; +Cc: dev, Alvin Zhang

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

Add headers for GTPU, now outer IP hash can be configured as input
sets for GTPU packet.

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
---
 drivers/net/iavf/iavf_hash.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c
index ddea3dd..8aeb3f83 100644
--- a/drivers/net/iavf/iavf_hash.c
+++ b/drivers/net/iavf/iavf_hash.c
@@ -135,6 +135,9 @@ struct iavf_hash_flow_cfg {
 #define proto_hdr_gtpc { \
 	VIRTCHNL_PROTO_HDR_GTPC, 0, {BUFF_NOUSED} }
 
+#define proto_hdr_gtpu { \
+	VIRTCHNL_PROTO_HDR_GTPU_IP, 0, {BUFF_NOUSED} }
+
 #define TUNNEL_LEVEL_OUTER		0
 #define TUNNEL_LEVEL_INNER		1
 
@@ -267,6 +270,14 @@ struct virtchnl_proto_hdrs ipv6_udp_gtpc_tmplt = {
 	TUNNEL_LEVEL_OUTER, 3, {proto_hdr_ipv6, proto_hdr_udp, proto_hdr_gtpc}
 };
 
+struct virtchnl_proto_hdrs outer_ipv4_udp_gtpu_tmplt = {
+	TUNNEL_LEVEL_OUTER, 3, {proto_hdr_ipv4, proto_hdr_udp, proto_hdr_gtpu}
+};
+
+struct virtchnl_proto_hdrs outer_ipv6_udp_gtpu_tmplt = {
+	TUNNEL_LEVEL_OUTER, 3, {proto_hdr_ipv6, proto_hdr_udp, proto_hdr_gtpu}
+};
+
 /* rss type super set */
 
 /* IPv4 outer */
@@ -359,6 +370,7 @@ struct virtchnl_proto_hdrs ipv6_udp_gtpc_tmplt = {
 	{iavf_pattern_eth_vlan_ipv4_udp,		IAVF_RSS_TYPE_VLAN_IPV4_UDP,	&outer_ipv4_udp_tmplt},
 	{iavf_pattern_eth_vlan_ipv4_tcp,		IAVF_RSS_TYPE_VLAN_IPV4_TCP,	&outer_ipv4_tcp_tmplt},
 	{iavf_pattern_eth_vlan_ipv4_sctp,		IAVF_RSS_TYPE_VLAN_IPV4_SCTP,	&outer_ipv4_sctp_tmplt},
+	{iavf_pattern_eth_ipv4_gtpu,			ETH_RSS_IPV4,			&outer_ipv4_udp_gtpu_tmplt},
 	{iavf_pattern_eth_ipv4_gtpu_ipv4,		IAVF_RSS_TYPE_GTPU_IPV4,	&inner_ipv4_tmplt},
 	{iavf_pattern_eth_ipv4_gtpu_ipv4_udp,		IAVF_RSS_TYPE_GTPU_IPV4_UDP,	&inner_ipv4_udp_tmplt},
 	{iavf_pattern_eth_ipv4_gtpu_ipv4_tcp,		IAVF_RSS_TYPE_GTPU_IPV4_TCP,	&inner_ipv4_tcp_tmplt},
@@ -386,6 +398,7 @@ struct virtchnl_proto_hdrs ipv6_udp_gtpc_tmplt = {
 	{iavf_pattern_eth_vlan_ipv6_udp,		IAVF_RSS_TYPE_VLAN_IPV6_UDP,	&outer_ipv6_udp_tmplt},
 	{iavf_pattern_eth_vlan_ipv6_tcp,		IAVF_RSS_TYPE_VLAN_IPV6_TCP,	&outer_ipv6_tcp_tmplt},
 	{iavf_pattern_eth_vlan_ipv6_sctp,		IAVF_RSS_TYPE_VLAN_IPV6_SCTP,	&outer_ipv6_sctp_tmplt},
+	{iavf_pattern_eth_ipv6_gtpu,			ETH_RSS_IPV6,			&outer_ipv6_udp_gtpu_tmplt},
 	{iavf_pattern_eth_ipv4_gtpu_ipv6,		IAVF_RSS_TYPE_GTPU_IPV6,	&inner_ipv6_tmplt},
 	{iavf_pattern_eth_ipv4_gtpu_ipv6_udp,		IAVF_RSS_TYPE_GTPU_IPV6_UDP,	&inner_ipv6_udp_tmplt},
 	{iavf_pattern_eth_ipv4_gtpu_ipv6_tcp,		IAVF_RSS_TYPE_GTPU_IPV6_TCP,	&inner_ipv6_tcp_tmplt},
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v4] net/iavf: support outer IP hash for GTPU
  2020-09-08  9:50 ` [dpdk-dev] [PATCH v3 3/3] net/iavf: support outer IP hash for GTPU alvinx.zhang
@ 2020-09-10  3:26   ` alvinx.zhang
  2020-09-10  5:24     ` Guo, Jia
  2020-09-14  9:03     ` [dpdk-dev] [PATCH v5] net/iavf: support outer IP hash for no inner GTPU alvinx.zhang
  0 siblings, 2 replies; 17+ messages in thread
From: alvinx.zhang @ 2020-09-10  3:26 UTC (permalink / raw)
  To: jia.guo, qi.z.zhang; +Cc: dev, Alvin Zhang

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

Add headers for GTPU, now outer IP hash can be configured as input
sets for GTPU packet.

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
---
 
V2: Modify codes according to comments.
V3: Refact all codes.
V4: Fix compatibility issues.

 drivers/net/iavf/iavf_hash.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c
index aab8b14..3ec32d9 100644
--- a/drivers/net/iavf/iavf_hash.c
+++ b/drivers/net/iavf/iavf_hash.c
@@ -132,6 +132,9 @@ struct iavf_hash_flow_cfg {
 	VIRTCHNL_PROTO_HDR_PFCP, \
 	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_PFCP_SEID), {BUFF_NOUSED} }
 
+#define proto_hdr_gtpu { \
+	VIRTCHNL_PROTO_HDR_GTPU_IP, 0, {BUFF_NOUSED} }
+
 #define TUNNEL_LEVEL_OUTER		0
 #define TUNNEL_LEVEL_INNER		1
 
@@ -256,6 +259,14 @@ struct virtchnl_proto_hdrs ipv6_pfcp_tmplt = {
 	TUNNEL_LEVEL_OUTER, 2, {proto_hdr_ipv6, proto_hdr_pfcp}
 };
 
+struct virtchnl_proto_hdrs outer_ipv4_udp_gtpu_tmplt = {
+	TUNNEL_LEVEL_OUTER, 3, {proto_hdr_ipv4, proto_hdr_udp, proto_hdr_gtpu}
+};
+
+struct virtchnl_proto_hdrs outer_ipv6_udp_gtpu_tmplt = {
+	TUNNEL_LEVEL_OUTER, 3, {proto_hdr_ipv6, proto_hdr_udp, proto_hdr_gtpu}
+};
+
 /* rss type super set */
 
 /* IPv4 outer */
@@ -348,6 +359,7 @@ struct virtchnl_proto_hdrs ipv6_pfcp_tmplt = {
 	{iavf_pattern_eth_vlan_ipv4_udp,		IAVF_RSS_TYPE_VLAN_IPV4_UDP,	&outer_ipv4_udp_tmplt},
 	{iavf_pattern_eth_vlan_ipv4_tcp,		IAVF_RSS_TYPE_VLAN_IPV4_TCP,	&outer_ipv4_tcp_tmplt},
 	{iavf_pattern_eth_vlan_ipv4_sctp,		IAVF_RSS_TYPE_VLAN_IPV4_SCTP,	&outer_ipv4_sctp_tmplt},
+	{iavf_pattern_eth_ipv4_gtpu,			ETH_RSS_IPV4,			&outer_ipv4_udp_gtpu_tmplt},
 	{iavf_pattern_eth_ipv4_gtpu_ipv4,		IAVF_RSS_TYPE_GTPU_IPV4,	&inner_ipv4_tmplt},
 	{iavf_pattern_eth_ipv4_gtpu_ipv4_udp,		IAVF_RSS_TYPE_GTPU_IPV4_UDP,	&inner_ipv4_udp_tmplt},
 	{iavf_pattern_eth_ipv4_gtpu_ipv4_tcp,		IAVF_RSS_TYPE_GTPU_IPV4_TCP,	&inner_ipv4_tcp_tmplt},
@@ -374,6 +386,7 @@ struct virtchnl_proto_hdrs ipv6_pfcp_tmplt = {
 	{iavf_pattern_eth_vlan_ipv6_udp,		IAVF_RSS_TYPE_VLAN_IPV6_UDP,	&outer_ipv6_udp_tmplt},
 	{iavf_pattern_eth_vlan_ipv6_tcp,		IAVF_RSS_TYPE_VLAN_IPV6_TCP,	&outer_ipv6_tcp_tmplt},
 	{iavf_pattern_eth_vlan_ipv6_sctp,		IAVF_RSS_TYPE_VLAN_IPV6_SCTP,	&outer_ipv6_sctp_tmplt},
+	{iavf_pattern_eth_ipv6_gtpu,			ETH_RSS_IPV6,			&outer_ipv6_udp_gtpu_tmplt},
 	{iavf_pattern_eth_ipv4_gtpu_ipv6,		IAVF_RSS_TYPE_GTPU_IPV6,	&inner_ipv6_tmplt},
 	{iavf_pattern_eth_ipv4_gtpu_ipv6_udp,		IAVF_RSS_TYPE_GTPU_IPV6_UDP,	&inner_ipv6_udp_tmplt},
 	{iavf_pattern_eth_ipv4_gtpu_ipv6_tcp,		IAVF_RSS_TYPE_GTPU_IPV6_TCP,	&inner_ipv6_tcp_tmplt},
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v4 1/2] common/iavf: add GTPC support
  2020-09-08  9:50 [dpdk-dev] [PATCH v3 1/3] common/iavf: add GTPC support alvinx.zhang
  2020-09-08  9:50 ` [dpdk-dev] [PATCH v3 2/3] net/iavf: support outer IP hash for GTPC alvinx.zhang
  2020-09-08  9:50 ` [dpdk-dev] [PATCH v3 3/3] net/iavf: support outer IP hash for GTPU alvinx.zhang
@ 2020-09-10  3:36 ` alvinx.zhang
  2020-09-10  3:36   ` [dpdk-dev] [PATCH v4 2/2] net/iavf: support outer IP hash for GTPC alvinx.zhang
  2 siblings, 1 reply; 17+ messages in thread
From: alvinx.zhang @ 2020-09-10  3:36 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] 17+ messages in thread

* [dpdk-dev] [PATCH v4 2/2] net/iavf: support outer IP hash for GTPC
  2020-09-10  3:36 ` [dpdk-dev] [PATCH v4 1/2] common/iavf: add GTPC support alvinx.zhang
@ 2020-09-10  3:36   ` alvinx.zhang
  2020-09-10  5:14     ` Guo, Jia
  2020-09-14  9:12     ` [dpdk-dev] [PATCH v5] " alvinx.zhang
  0 siblings, 2 replies; 17+ messages in thread
From: alvinx.zhang @ 2020-09-10  3:36 UTC (permalink / raw)
  To: jia.guo, qi.z.zhang; +Cc: dev, Alvin Zhang

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

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

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
---

V2: Modify codes according to comments.
V3: Refact all codes.
V4: Fix compatibility issues.

 drivers/net/iavf/iavf_generic_flow.c | 18 ++++++++++++++++++
 drivers/net/iavf/iavf_generic_flow.h |  6 ++++++
 drivers/net/iavf/iavf_hash.c         | 13 +++++++++++++
 3 files changed, 37 insertions(+)

diff --git a/drivers/net/iavf/iavf_generic_flow.c b/drivers/net/iavf/iavf_generic_flow.c
index 321a4dc..00e7f15 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..dbc7294 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 d0f0057..4e8ee5c 100644
--- a/drivers/net/iavf/iavf_hash.c
+++ b/drivers/net/iavf/iavf_hash.c
@@ -135,6 +135,9 @@ struct iavf_hash_flow_cfg {
 #define proto_hdr_gtpu { \
 	VIRTCHNL_PROTO_HDR_GTPU_IP, 0, {BUFF_NOUSED} }
 
+#define proto_hdr_gtpc { \
+	VIRTCHNL_PROTO_HDR_GTPC, 0, {BUFF_NOUSED} }
+
 #define TUNNEL_LEVEL_OUTER		0
 #define TUNNEL_LEVEL_INNER		1
 
@@ -267,6 +270,14 @@ struct virtchnl_proto_hdrs outer_ipv6_udp_gtpu_tmplt = {
 	TUNNEL_LEVEL_OUTER, 3, {proto_hdr_ipv6, proto_hdr_udp, proto_hdr_gtpu}
 };
 
+struct virtchnl_proto_hdrs ipv4_udp_gtpc_tmplt = {
+	TUNNEL_LEVEL_OUTER, 3, {proto_hdr_ipv4, proto_hdr_udp, proto_hdr_gtpc}
+};
+
+struct virtchnl_proto_hdrs ipv6_udp_gtpc_tmplt = {
+	TUNNEL_LEVEL_OUTER, 3, {proto_hdr_ipv6, proto_hdr_udp, proto_hdr_gtpc}
+};
+
 /* rss type super set */
 
 /* IPv4 outer */
@@ -377,6 +388,7 @@ struct virtchnl_proto_hdrs outer_ipv6_udp_gtpu_tmplt = {
 	{iavf_pattern_eth_ipv4_ah,			IAVF_RSS_TYPE_IPV4_AH,		&ipv4_ah_tmplt},
 	{iavf_pattern_eth_ipv4_l2tpv3,			IAVF_RSS_TYPE_IPV4_L2TPV3,	&ipv4_l2tpv3_tmplt},
 	{iavf_pattern_eth_ipv4_pfcp,			IAVF_RSS_TYPE_IPV4_PFCP,	&ipv4_pfcp_tmplt},
+	{iavf_pattern_eth_ipv4_gtpc,			ETH_RSS_IPV4,			&ipv4_udp_gtpc_tmplt},
 	/* IPv6 */
 	{iavf_pattern_eth_ipv6,				IAVF_RSS_TYPE_OUTER_IPV6,	&outer_ipv6_tmplt},
 	{iavf_pattern_eth_ipv6_udp,			IAVF_RSS_TYPE_OUTER_IPV6_UDP,	&outer_ipv6_udp_tmplt},
@@ -404,6 +416,7 @@ struct virtchnl_proto_hdrs outer_ipv6_udp_gtpu_tmplt = {
 	{iavf_pattern_eth_ipv6_ah,			IAVF_RSS_TYPE_IPV6_AH,		&ipv6_ah_tmplt},
 	{iavf_pattern_eth_ipv6_l2tpv3,			IAVF_RSS_TYPE_IPV6_L2TPV3,	&ipv6_l2tpv3_tmplt},
 	{iavf_pattern_eth_ipv6_pfcp,			IAVF_RSS_TYPE_IPV6_PFCP,	&ipv6_pfcp_tmplt},
+	{iavf_pattern_eth_ipv6_gtpc,			ETH_RSS_IPV6,			&ipv6_udp_gtpc_tmplt},
 };
 
 struct virtchnl_proto_hdrs *iavf_hash_default_hdrs[] = {
-- 
1.8.3.1


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

* Re: [dpdk-dev] [PATCH v4 2/2] net/iavf: support outer IP hash for GTPC
  2020-09-10  3:36   ` [dpdk-dev] [PATCH v4 2/2] net/iavf: support outer IP hash for GTPC alvinx.zhang
@ 2020-09-10  5:14     ` Guo, Jia
  2020-09-10  9:29       ` Zhang, AlvinX
  2020-09-14  9:12     ` [dpdk-dev] [PATCH v5] " alvinx.zhang
  1 sibling, 1 reply; 17+ messages in thread
From: Guo, Jia @ 2020-09-10  5:14 UTC (permalink / raw)
  To: Zhang, AlvinX, Zhang, Qi Z; +Cc: dev

Hi, Alvin

> -----Original Message-----
> From: Zhang, AlvinX <alvinx.zhang@intel.com>
> Sent: Thursday, September 10, 2020 11:37 AM
> To: Guo, Jia <jia.guo@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org; Zhang, AlvinX <alvinx.zhang@intel.com>
> Subject: [PATCH v4 2/2] net/iavf: support outer IP hash for GTPC
> 
> From: Alvin Zhang <alvinx.zhang@intel.com>
> 
> Add patterns and headers for GTPC, now outer IP hash can be configured as
> input sets for GTPC packet.
> 
> Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
> ---
> 
> V2: Modify codes according to comments.
> V3: Refact all codes.
> V4: Fix compatibility issues.
> 
>  drivers/net/iavf/iavf_generic_flow.c | 18 ++++++++++++++++++
> drivers/net/iavf/iavf_generic_flow.h |  6 ++++++
>  drivers/net/iavf/iavf_hash.c         | 13 +++++++++++++
>  3 files changed, 37 insertions(+)
> 
> diff --git a/drivers/net/iavf/iavf_generic_flow.c
> b/drivers/net/iavf/iavf_generic_flow.c
> index 321a4dc..00e7f15 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..dbc7294 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 */

/* IPv6 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
> d0f0057..4e8ee5c 100644
> --- a/drivers/net/iavf/iavf_hash.c
> +++ b/drivers/net/iavf/iavf_hash.c
> @@ -135,6 +135,9 @@ struct iavf_hash_flow_cfg {  #define proto_hdr_gtpu
> { \
>  	VIRTCHNL_PROTO_HDR_GTPU_IP, 0, {BUFF_NOUSED} }
> 
> +#define proto_hdr_gtpc { \
> +	VIRTCHNL_PROTO_HDR_GTPC, 0, {BUFF_NOUSED} }
> +
>  #define TUNNEL_LEVEL_OUTER		0
>  #define TUNNEL_LEVEL_INNER		1
> 
> @@ -267,6 +270,14 @@ struct virtchnl_proto_hdrs
> outer_ipv6_udp_gtpu_tmplt = {
>  	TUNNEL_LEVEL_OUTER, 3, {proto_hdr_ipv6, proto_hdr_udp,
> proto_hdr_gtpu}  };
> 
> +struct virtchnl_proto_hdrs ipv4_udp_gtpc_tmplt = {
> +	TUNNEL_LEVEL_OUTER, 3, {proto_hdr_ipv4, proto_hdr_udp,
> proto_hdr_gtpc}
> +};
> +
> +struct virtchnl_proto_hdrs ipv6_udp_gtpc_tmplt = {
> +	TUNNEL_LEVEL_OUTER, 3, {proto_hdr_ipv6, proto_hdr_udp,
> proto_hdr_gtpc}
> +};
> +
>  /* rss type super set */
> 
>  /* IPv4 outer */
> @@ -377,6 +388,7 @@ struct virtchnl_proto_hdrs
> outer_ipv6_udp_gtpu_tmplt = {
>  	{iavf_pattern_eth_ipv4_ah,
> 	IAVF_RSS_TYPE_IPV4_AH,		&ipv4_ah_tmplt},
>  	{iavf_pattern_eth_ipv4_l2tpv3,
> 	IAVF_RSS_TYPE_IPV4_L2TPV3,	&ipv4_l2tpv3_tmplt},
>  	{iavf_pattern_eth_ipv4_pfcp,
> 	IAVF_RSS_TYPE_IPV4_PFCP,	&ipv4_pfcp_tmplt},
> +	{iavf_pattern_eth_ipv4_gtpc,			ETH_RSS_IPV4,

Since the input set hint is the supper set, so I suppose you use the supper set "ETH_RSS_IPV4 | ETH_RSS_GTPC" here, and considerate if we need to enable GTPC hash at this patch,
if not it  could be process when parsing pattern. Want to know other's opinion. 

> 		&ipv4_udp_gtpc_tmplt},
>  	/* IPv6 */
>  	{iavf_pattern_eth_ipv6,
> 	IAVF_RSS_TYPE_OUTER_IPV6,	&outer_ipv6_tmplt},
>  	{iavf_pattern_eth_ipv6_udp,
> 	IAVF_RSS_TYPE_OUTER_IPV6_UDP,	&outer_ipv6_udp_tmplt},
> @@ -404,6 +416,7 @@ struct virtchnl_proto_hdrs
> outer_ipv6_udp_gtpu_tmplt = {
>  	{iavf_pattern_eth_ipv6_ah,
> 	IAVF_RSS_TYPE_IPV6_AH,		&ipv6_ah_tmplt},
>  	{iavf_pattern_eth_ipv6_l2tpv3,
> 	IAVF_RSS_TYPE_IPV6_L2TPV3,	&ipv6_l2tpv3_tmplt},
>  	{iavf_pattern_eth_ipv6_pfcp,
> 	IAVF_RSS_TYPE_IPV6_PFCP,	&ipv6_pfcp_tmplt},
> +	{iavf_pattern_eth_ipv6_gtpc,			ETH_RSS_IPV6,
> 		&ipv6_udp_gtpc_tmplt},
>  };
> 
>  struct virtchnl_proto_hdrs *iavf_hash_default_hdrs[] = {
> --
> 1.8.3.1


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

* Re: [dpdk-dev] [PATCH v4] net/iavf: support outer IP hash for GTPU
  2020-09-10  3:26   ` [dpdk-dev] [PATCH v4] " alvinx.zhang
@ 2020-09-10  5:24     ` Guo, Jia
  2020-09-10  9:24       ` Zhang, AlvinX
  2020-09-14  9:03     ` [dpdk-dev] [PATCH v5] net/iavf: support outer IP hash for no inner GTPU alvinx.zhang
  1 sibling, 1 reply; 17+ messages in thread
From: Guo, Jia @ 2020-09-10  5:24 UTC (permalink / raw)
  To: Zhang, AlvinX, Zhang, Qi Z; +Cc: dev


> -----Original Message-----
> From: Zhang, AlvinX <alvinx.zhang@intel.com>
> Sent: Thursday, September 10, 2020 11:26 AM
> To: Guo, Jia <jia.guo@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org; Zhang, AlvinX <alvinx.zhang@intel.com>
> Subject: [PATCH v4] net/iavf: support outer IP hash for GTPU
> 
> From: Alvin Zhang <alvinx.zhang@intel.com>
> 
> Add headers for GTPU, now outer IP hash can be configured as input sets for
> GTPU packet.
> 

I think this patch will not cover outer IP hash for any GTPU case, only none-inner GTPU case, right? 

> Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
> ---
> 
> V2: Modify codes according to comments.
> V3: Refact all codes.
> V4: Fix compatibility issues.
> 
>  drivers/net/iavf/iavf_hash.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index
> aab8b14..3ec32d9 100644
> --- a/drivers/net/iavf/iavf_hash.c
> +++ b/drivers/net/iavf/iavf_hash.c
> @@ -132,6 +132,9 @@ struct iavf_hash_flow_cfg {
>  	VIRTCHNL_PROTO_HDR_PFCP, \
>  	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_PFCP_SEID),
> {BUFF_NOUSED} }
> 
> +#define proto_hdr_gtpu { \
> +	VIRTCHNL_PROTO_HDR_GTPU_IP, 0, {BUFF_NOUSED} }
> +

I still not funs of set field to zero here since it should be general use for other case, it could specific refine to 0 when parsing pattern if need. 

>  #define TUNNEL_LEVEL_OUTER		0
>  #define TUNNEL_LEVEL_INNER		1
> 
> @@ -256,6 +259,14 @@ struct virtchnl_proto_hdrs ipv6_pfcp_tmplt = {
>  	TUNNEL_LEVEL_OUTER, 2, {proto_hdr_ipv6, proto_hdr_pfcp}  };
> 
> +struct virtchnl_proto_hdrs outer_ipv4_udp_gtpu_tmplt = {
> +	TUNNEL_LEVEL_OUTER, 3, {proto_hdr_ipv4, proto_hdr_udp,
> proto_hdr_gtpu}
> +};
> +
> +struct virtchnl_proto_hdrs outer_ipv6_udp_gtpu_tmplt = {
> +	TUNNEL_LEVEL_OUTER, 3, {proto_hdr_ipv6, proto_hdr_udp,
> proto_hdr_gtpu}
> +};
> +
>  /* rss type super set */
> 
>  /* IPv4 outer */
> @@ -348,6 +359,7 @@ struct virtchnl_proto_hdrs ipv6_pfcp_tmplt = {
>  	{iavf_pattern_eth_vlan_ipv4_udp,
> 	IAVF_RSS_TYPE_VLAN_IPV4_UDP,	&outer_ipv4_udp_tmplt},
>  	{iavf_pattern_eth_vlan_ipv4_tcp,
> 	IAVF_RSS_TYPE_VLAN_IPV4_TCP,	&outer_ipv4_tcp_tmplt},
>  	{iavf_pattern_eth_vlan_ipv4_sctp,
> 	IAVF_RSS_TYPE_VLAN_IPV4_SCTP,	&outer_ipv4_sctp_tmplt},
> +	{iavf_pattern_eth_ipv4_gtpu,			ETH_RSS_IPV4,
> 		&outer_ipv4_udp_gtpu_tmplt},

There is also a question the same as the other mail loop of GTPC, should it be supper set here?

>  	{iavf_pattern_eth_ipv4_gtpu_ipv4,
> 	IAVF_RSS_TYPE_GTPU_IPV4,	&inner_ipv4_tmplt},
>  	{iavf_pattern_eth_ipv4_gtpu_ipv4_udp,
> 	IAVF_RSS_TYPE_GTPU_IPV4_UDP,	&inner_ipv4_udp_tmplt},
>  	{iavf_pattern_eth_ipv4_gtpu_ipv4_tcp,
> 	IAVF_RSS_TYPE_GTPU_IPV4_TCP,	&inner_ipv4_tcp_tmplt},
> @@ -374,6 +386,7 @@ struct virtchnl_proto_hdrs ipv6_pfcp_tmplt = {
>  	{iavf_pattern_eth_vlan_ipv6_udp,
> 	IAVF_RSS_TYPE_VLAN_IPV6_UDP,	&outer_ipv6_udp_tmplt},
>  	{iavf_pattern_eth_vlan_ipv6_tcp,
> 	IAVF_RSS_TYPE_VLAN_IPV6_TCP,	&outer_ipv6_tcp_tmplt},
>  	{iavf_pattern_eth_vlan_ipv6_sctp,
> 	IAVF_RSS_TYPE_VLAN_IPV6_SCTP,	&outer_ipv6_sctp_tmplt},
> +	{iavf_pattern_eth_ipv6_gtpu,			ETH_RSS_IPV6,
> 		&outer_ipv6_udp_gtpu_tmplt},
>  	{iavf_pattern_eth_ipv4_gtpu_ipv6,
> 	IAVF_RSS_TYPE_GTPU_IPV6,	&inner_ipv6_tmplt},
>  	{iavf_pattern_eth_ipv4_gtpu_ipv6_udp,
> 	IAVF_RSS_TYPE_GTPU_IPV6_UDP,	&inner_ipv6_udp_tmplt},
>  	{iavf_pattern_eth_ipv4_gtpu_ipv6_tcp,
> 	IAVF_RSS_TYPE_GTPU_IPV6_TCP,	&inner_ipv6_tcp_tmplt},
> --
> 1.8.3.1


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

* Re: [dpdk-dev] [PATCH v4] net/iavf: support outer IP hash for GTPU
  2020-09-10  5:24     ` Guo, Jia
@ 2020-09-10  9:24       ` Zhang, AlvinX
  0 siblings, 0 replies; 17+ messages in thread
From: Zhang, AlvinX @ 2020-09-10  9:24 UTC (permalink / raw)
  To: Guo, Jia, Zhang, Qi Z; +Cc: dev

Thanks Guojia,

> -----Original Message-----
> From: Guo, Jia <jia.guo@intel.com>
> Sent: Thursday, September 10, 2020 1:25 PM
> To: Zhang, AlvinX <alvinx.zhang@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org
> Subject: RE: [PATCH v4] net/iavf: support outer IP hash for GTPU
> 
> 
> > -----Original Message-----
> > From: Zhang, AlvinX <alvinx.zhang@intel.com>
> > Sent: Thursday, September 10, 2020 11:26 AM
> > To: Guo, Jia <jia.guo@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> > Cc: dev@dpdk.org; Zhang, AlvinX <alvinx.zhang@intel.com>
> > Subject: [PATCH v4] net/iavf: support outer IP hash for GTPU
> >
> > From: Alvin Zhang <alvinx.zhang@intel.com>
> >
> > Add headers for GTPU, now outer IP hash can be configured as input
> > sets for GTPU packet.
> >
> 
> I think this patch will not cover outer IP hash for any GTPU case, only none-inner
> GTPU case, right?
> 
> > Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
> > ---
> >
> > V2: Modify codes according to comments.
> > V3: Refact all codes.
> > V4: Fix compatibility issues.
> >
> >  drivers/net/iavf/iavf_hash.c | 13 +++++++++++++
> >  1 file changed, 13 insertions(+)
> >
> > diff --git a/drivers/net/iavf/iavf_hash.c
> > b/drivers/net/iavf/iavf_hash.c index
> > aab8b14..3ec32d9 100644
> > --- a/drivers/net/iavf/iavf_hash.c
> > +++ b/drivers/net/iavf/iavf_hash.c
> > @@ -132,6 +132,9 @@ struct iavf_hash_flow_cfg {
> > VIRTCHNL_PROTO_HDR_PFCP, \
> > FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_PFCP_SEID),
> > {BUFF_NOUSED} }
> >
> > +#define proto_hdr_gtpu { \
> > +VIRTCHNL_PROTO_HDR_GTPU_IP, 0, {BUFF_NOUSED} }
> > +
> 
> I still not funs of set field to zero here since it should be general use for other
> case, it could specific refine to 0 when parsing pattern if need.

In V1 patch I have put TEID field as input set, but the kernel driver did not supported this field and returned success.
That's mean the rule has been created succeed, but it did not work.

> 
> >  #define TUNNEL_LEVEL_OUTER0
> >  #define TUNNEL_LEVEL_INNER1
> >
> > @@ -256,6 +259,14 @@ struct virtchnl_proto_hdrs ipv6_pfcp_tmplt = {
> > TUNNEL_LEVEL_OUTER, 2, {proto_hdr_ipv6, proto_hdr_pfcp}  };
> >
> > +struct virtchnl_proto_hdrs outer_ipv4_udp_gtpu_tmplt = {
> > +TUNNEL_LEVEL_OUTER, 3, {proto_hdr_ipv4, proto_hdr_udp,
> > proto_hdr_gtpu}
> > +};
> > +
> > +struct virtchnl_proto_hdrs outer_ipv6_udp_gtpu_tmplt = {
> > +TUNNEL_LEVEL_OUTER, 3, {proto_hdr_ipv6, proto_hdr_udp,
> > proto_hdr_gtpu}
> > +};
> > +
> >  /* rss type super set */
> >
> >  /* IPv4 outer */
> > @@ -348,6 +359,7 @@ struct virtchnl_proto_hdrs ipv6_pfcp_tmplt = {
> > {iavf_pattern_eth_vlan_ipv4_udp,
> > IAVF_RSS_TYPE_VLAN_IPV4_UDP,&outer_ipv4_udp_tmplt},
> >  {iavf_pattern_eth_vlan_ipv4_tcp,
> > IAVF_RSS_TYPE_VLAN_IPV4_TCP,&outer_ipv4_tcp_tmplt},
> >  {iavf_pattern_eth_vlan_ipv4_sctp,
> > IAVF_RSS_TYPE_VLAN_IPV4_SCTP,&outer_ipv4_sctp_tmplt},
> > +{iavf_pattern_eth_ipv4_gtpu,ETH_RSS_IPV4,
> > &outer_ipv4_udp_gtpu_tmplt},
> 
> There is also a question the same as the other mail loop of GTPC, should it be
> supper set here?

As above, if user really set ETH_RSS_GTPU as input set, the rule will be created succeed, but it don't work.

> 
> >  {iavf_pattern_eth_ipv4_gtpu_ipv4,
> > IAVF_RSS_TYPE_GTPU_IPV4,&inner_ipv4_tmplt},
> >  {iavf_pattern_eth_ipv4_gtpu_ipv4_udp,
> > IAVF_RSS_TYPE_GTPU_IPV4_UDP,&inner_ipv4_udp_tmplt},
> >  {iavf_pattern_eth_ipv4_gtpu_ipv4_tcp,
> > IAVF_RSS_TYPE_GTPU_IPV4_TCP,&inner_ipv4_tcp_tmplt},
> > @@ -374,6 +386,7 @@ struct virtchnl_proto_hdrs ipv6_pfcp_tmplt = {
> > {iavf_pattern_eth_vlan_ipv6_udp,
> > IAVF_RSS_TYPE_VLAN_IPV6_UDP,&outer_ipv6_udp_tmplt},
> >  {iavf_pattern_eth_vlan_ipv6_tcp,
> > IAVF_RSS_TYPE_VLAN_IPV6_TCP,&outer_ipv6_tcp_tmplt},
> >  {iavf_pattern_eth_vlan_ipv6_sctp,
> > IAVF_RSS_TYPE_VLAN_IPV6_SCTP,&outer_ipv6_sctp_tmplt},
> > +{iavf_pattern_eth_ipv6_gtpu,ETH_RSS_IPV6,
> > &outer_ipv6_udp_gtpu_tmplt},
> >  {iavf_pattern_eth_ipv4_gtpu_ipv6,
> > IAVF_RSS_TYPE_GTPU_IPV6,&inner_ipv6_tmplt},
> >  {iavf_pattern_eth_ipv4_gtpu_ipv6_udp,
> > IAVF_RSS_TYPE_GTPU_IPV6_UDP,&inner_ipv6_udp_tmplt},
> >  {iavf_pattern_eth_ipv4_gtpu_ipv6_tcp,
> > IAVF_RSS_TYPE_GTPU_IPV6_TCP,&inner_ipv6_tcp_tmplt},
> > --
> > 1.8.3.1
> 


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

* Re: [dpdk-dev] [PATCH v4 2/2] net/iavf: support outer IP hash for GTPC
  2020-09-10  5:14     ` Guo, Jia
@ 2020-09-10  9:29       ` Zhang, AlvinX
  0 siblings, 0 replies; 17+ messages in thread
From: Zhang, AlvinX @ 2020-09-10  9:29 UTC (permalink / raw)
  To: Guo, Jia, Zhang, Qi Z; +Cc: dev

Thanks Guojia,

> -----Original Message-----
> From: Guo, Jia <jia.guo@intel.com>
> Sent: Thursday, September 10, 2020 1:14 PM
> To: Zhang, AlvinX <alvinx.zhang@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org
> Subject: RE: [PATCH v4 2/2] net/iavf: support outer IP hash for GTPC
> 
> Hi, Alvin
> 
> > -----Original Message-----
> > From: Zhang, AlvinX <alvinx.zhang@intel.com>
> > Sent: Thursday, September 10, 2020 11:37 AM
> > To: Guo, Jia <jia.guo@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> > Cc: dev@dpdk.org; Zhang, AlvinX <alvinx.zhang@intel.com>
> > Subject: [PATCH v4 2/2] net/iavf: support outer IP hash for GTPC
> >
> > From: Alvin Zhang <alvinx.zhang@intel.com>
> >
> > Add patterns and headers for GTPC, now outer IP hash can be configured
> > as input sets for GTPC packet.
> >
> > Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
> > ---
> >
> > V2: Modify codes according to comments.
> > V3: Refact all codes.
> > V4: Fix compatibility issues.
> >
> >  drivers/net/iavf/iavf_generic_flow.c | 18 ++++++++++++++++++
> > drivers/net/iavf/iavf_generic_flow.h |  6 ++++++
> >  drivers/net/iavf/iavf_hash.c         | 13 +++++++++++++
> >  3 files changed, 37 insertions(+)
> >
> > diff --git a/drivers/net/iavf/iavf_generic_flow.c
> > b/drivers/net/iavf/iavf_generic_flow.c
> > index 321a4dc..00e7f15 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..dbc7294 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 */
> 
> /* IPv6 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
> > d0f0057..4e8ee5c 100644
> > --- a/drivers/net/iavf/iavf_hash.c
> > +++ b/drivers/net/iavf/iavf_hash.c
> > @@ -135,6 +135,9 @@ struct iavf_hash_flow_cfg {  #define
> > proto_hdr_gtpu { \  VIRTCHNL_PROTO_HDR_GTPU_IP, 0, {BUFF_NOUSED} }
> >
> > +#define proto_hdr_gtpc { \
> > +VIRTCHNL_PROTO_HDR_GTPC, 0, {BUFF_NOUSED} }
> > +
> >  #define TUNNEL_LEVEL_OUTER0
> >  #define TUNNEL_LEVEL_INNER1
> >
> > @@ -267,6 +270,14 @@ struct virtchnl_proto_hdrs
> > outer_ipv6_udp_gtpu_tmplt = {  TUNNEL_LEVEL_OUTER, 3, {proto_hdr_ipv6,
> > proto_hdr_udp, proto_hdr_gtpu}  };
> >
> > +struct virtchnl_proto_hdrs ipv4_udp_gtpc_tmplt = {
> > +TUNNEL_LEVEL_OUTER, 3, {proto_hdr_ipv4, proto_hdr_udp,
> > proto_hdr_gtpc}
> > +};
> > +
> > +struct virtchnl_proto_hdrs ipv6_udp_gtpc_tmplt = {
> > +TUNNEL_LEVEL_OUTER, 3, {proto_hdr_ipv6, proto_hdr_udp,
> > proto_hdr_gtpc}
> > +};
> > +
> >  /* rss type super set */
> >
> >  /* IPv4 outer */
> > @@ -377,6 +388,7 @@ struct virtchnl_proto_hdrs
> > outer_ipv6_udp_gtpu_tmplt = {  {iavf_pattern_eth_ipv4_ah,
> > IAVF_RSS_TYPE_IPV4_AH,&ipv4_ah_tmplt},
> >  {iavf_pattern_eth_ipv4_l2tpv3,
> > IAVF_RSS_TYPE_IPV4_L2TPV3,&ipv4_l2tpv3_tmplt},
> >  {iavf_pattern_eth_ipv4_pfcp,
> > IAVF_RSS_TYPE_IPV4_PFCP,&ipv4_pfcp_tmplt},
> > +{iavf_pattern_eth_ipv4_gtpc,ETH_RSS_IPV4,
> 
> Since the input set hint is the supper set, so I suppose you use the supper set
> "ETH_RSS_IPV4 | ETH_RSS_GTPC" here, and considerate if we need to enable
> GTPC hash at this patch, if not it  could be process when parsing pattern. Want
> to know other's opinion.

In V1 patch I have put TEID field as input set, but the kernel driver did not supported this field and returned success.
That's mean if user really set ETH_RSS_GTPC as input set, the rule will be created succeed, but it don't work

> 
> > &ipv4_udp_gtpc_tmplt},
> >  /* IPv6 */
> >  {iavf_pattern_eth_ipv6,
> > IAVF_RSS_TYPE_OUTER_IPV6,&outer_ipv6_tmplt},
> >  {iavf_pattern_eth_ipv6_udp,
> > IAVF_RSS_TYPE_OUTER_IPV6_UDP,&outer_ipv6_udp_tmplt},
> > @@ -404,6 +416,7 @@ struct virtchnl_proto_hdrs
> > outer_ipv6_udp_gtpu_tmplt = {  {iavf_pattern_eth_ipv6_ah,
> > IAVF_RSS_TYPE_IPV6_AH,&ipv6_ah_tmplt},
> >  {iavf_pattern_eth_ipv6_l2tpv3,
> > IAVF_RSS_TYPE_IPV6_L2TPV3,&ipv6_l2tpv3_tmplt},
> >  {iavf_pattern_eth_ipv6_pfcp,
> > IAVF_RSS_TYPE_IPV6_PFCP,&ipv6_pfcp_tmplt},
> > +{iavf_pattern_eth_ipv6_gtpc,ETH_RSS_IPV6,
> > &ipv6_udp_gtpc_tmplt},
> >  };
> >
> >  struct virtchnl_proto_hdrs *iavf_hash_default_hdrs[] = {
> > --
> > 1.8.3.1
> 


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

* [dpdk-dev] [PATCH v5] net/iavf: support outer IP hash for no inner GTPU
  2020-09-10  3:26   ` [dpdk-dev] [PATCH v4] " alvinx.zhang
  2020-09-10  5:24     ` Guo, Jia
@ 2020-09-14  9:03     ` alvinx.zhang
  2020-09-14 10:33       ` Zhang, Qi Z
  2020-09-15  2:43       ` [dpdk-dev] [PATCH v6] " alvinx.zhang
  1 sibling, 2 replies; 17+ messages in thread
From: alvinx.zhang @ 2020-09-14  9:03 UTC (permalink / raw)
  To: jia.guo, qi.z.zhang; +Cc: dev, Alvin Zhang

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

Outer IP hash can be configured as input sets for no inner GTPU packets.

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
---

V2: Modify codes according to comments.
V3: Refact all codes.
V4: Fix compatibility issues.
V5: Modify codes according to comments.

 drivers/net/iavf/iavf_hash.c | 48 ++++++++++++++++++++++++++------------------
 1 file changed, 28 insertions(+), 20 deletions(-)

diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c
index ff77d71..d0a6396 100644
--- a/drivers/net/iavf/iavf_hash.c
+++ b/drivers/net/iavf/iavf_hash.c
@@ -348,6 +348,7 @@ struct virtchnl_proto_hdrs ipv6_pfcp_tmplt = {
 	{iavf_pattern_eth_vlan_ipv4_udp,		IAVF_RSS_TYPE_VLAN_IPV4_UDP,	&outer_ipv4_udp_tmplt},
 	{iavf_pattern_eth_vlan_ipv4_tcp,		IAVF_RSS_TYPE_VLAN_IPV4_TCP,	&outer_ipv4_tcp_tmplt},
 	{iavf_pattern_eth_vlan_ipv4_sctp,		IAVF_RSS_TYPE_VLAN_IPV4_SCTP,	&outer_ipv4_sctp_tmplt},
+	{iavf_pattern_eth_ipv4_gtpu,			ETH_RSS_IPV4,			&outer_ipv4_udp_tmplt},
 	{iavf_pattern_eth_ipv4_gtpu_ipv4,		IAVF_RSS_TYPE_GTPU_IPV4,	&inner_ipv4_tmplt},
 	{iavf_pattern_eth_ipv4_gtpu_ipv4_udp,		IAVF_RSS_TYPE_GTPU_IPV4_UDP,	&inner_ipv4_udp_tmplt},
 	{iavf_pattern_eth_ipv4_gtpu_ipv4_tcp,		IAVF_RSS_TYPE_GTPU_IPV4_TCP,	&inner_ipv4_tcp_tmplt},
@@ -374,6 +375,7 @@ struct virtchnl_proto_hdrs ipv6_pfcp_tmplt = {
 	{iavf_pattern_eth_vlan_ipv6_udp,		IAVF_RSS_TYPE_VLAN_IPV6_UDP,	&outer_ipv6_udp_tmplt},
 	{iavf_pattern_eth_vlan_ipv6_tcp,		IAVF_RSS_TYPE_VLAN_IPV6_TCP,	&outer_ipv6_tcp_tmplt},
 	{iavf_pattern_eth_vlan_ipv6_sctp,		IAVF_RSS_TYPE_VLAN_IPV6_SCTP,	&outer_ipv6_sctp_tmplt},
+	{iavf_pattern_eth_ipv6_gtpu,			ETH_RSS_IPV6,			&outer_ipv6_udp_tmplt},
 	{iavf_pattern_eth_ipv4_gtpu_ipv6,		IAVF_RSS_TYPE_GTPU_IPV6,	&inner_ipv6_tmplt},
 	{iavf_pattern_eth_ipv4_gtpu_ipv6_udp,		IAVF_RSS_TYPE_GTPU_IPV6_UDP,	&inner_ipv6_udp_tmplt},
 	{iavf_pattern_eth_ipv4_gtpu_ipv6_tcp,		IAVF_RSS_TYPE_GTPU_IPV6_TCP,	&inner_ipv6_tcp_tmplt},
@@ -698,31 +700,37 @@ struct virtchnl_proto_hdrs *iavf_hash_default_hdrs[] = {
 	struct virtchnl_proto_hdr *hdr2;
 	int i;
 
-	if (!(phint & IAVF_PHINT_GTPU_MSK) ||
-	    proto_hdrs->tunnel_level == 0)
+	if (!(phint & IAVF_PHINT_GTPU_MSK))
 		return;
 
-	/* shift headers 1 layer */
-	for (i = proto_hdrs->count; i > 0; i--) {
-		hdr1 = &proto_hdrs->proto_hdr[i];
-		hdr2 = &proto_hdrs->proto_hdr[i - 1];
+	if (proto_hdrs->tunnel_level == TUNNEL_LEVEL_INNER) {
+		/* shift headers 1 layer */
+		for (i = proto_hdrs->count; i > 0; i--) {
+			hdr1 = &proto_hdrs->proto_hdr[i];
+			hdr2 = &proto_hdrs->proto_hdr[i - 1];
 
-		*hdr1 = *hdr2;
-	}
+			*hdr1 = *hdr2;
+		}
 
-	/* adding gtpu header at layer 0 */
-	proto_hdrs->count++;
-	hdr1 = &proto_hdrs->proto_hdr[0];
-	hdr1->field_selector = 0;
-
-	if (phint & IAVF_PHINT_GTPU_EH_DWN)
-		VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, GTPU_EH_PDU_DWN);
-	else if (phint & IAVF_PHINT_GTPU_EH_UP)
-		VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, GTPU_EH_PDU_UP);
-	else if (phint & IAVF_PHINT_GTPU_EH)
-		VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, GTPU_EH);
-	else if (phint & IAVF_PHINT_GTPU)
+		/* adding gtpu header at layer 0 */
+		proto_hdrs->count++;
+		hdr1 = &proto_hdrs->proto_hdr[0];
+		hdr1->field_selector = 0;
+
+		if (phint & IAVF_PHINT_GTPU_EH_DWN)
+			VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, GTPU_EH_PDU_DWN);
+		else if (phint & IAVF_PHINT_GTPU_EH_UP)
+			VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, GTPU_EH_PDU_UP);
+		else if (phint & IAVF_PHINT_GTPU_EH)
+			VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, GTPU_EH);
+		else if (phint & IAVF_PHINT_GTPU)
+			VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, GTPU_IP);
+	} else {
+		hdr1 = &proto_hdrs->proto_hdr[proto_hdrs->count];
+		hdr1->field_selector = 0;
+		proto_hdrs->count++;
 		VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, GTPU_IP);
+	}
 }
 
 static void iavf_refine_proto_hdrs(struct virtchnl_proto_hdrs *proto_hdrs,
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v5] net/iavf: support outer IP hash for GTPC
  2020-09-10  3:36   ` [dpdk-dev] [PATCH v4 2/2] net/iavf: support outer IP hash for GTPC alvinx.zhang
  2020-09-10  5:14     ` Guo, Jia
@ 2020-09-14  9:12     ` alvinx.zhang
  2020-09-14 10:48       ` Zhang, Qi Z
  1 sibling, 1 reply; 17+ messages in thread
From: alvinx.zhang @ 2020-09-14  9:12 UTC (permalink / raw)
  To: jia.guo, qi.z.zhang; +Cc: dev, Alvin Zhang

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

Add patterns and headers for GTPC, now outer IP hash can be configured
as input sets for GTPC packets.

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
---

V2: Modify codes according to comments.
V3: Refact all codes.
V4, V5: Fix compatibility issues.

 drivers/net/iavf/iavf_generic_flow.c | 18 ++++++++++++++++++
 drivers/net/iavf/iavf_generic_flow.h |  6 ++++++
 drivers/net/iavf/iavf_hash.c         | 13 +++++++++++++
 3 files changed, 37 insertions(+)

diff --git a/drivers/net/iavf/iavf_generic_flow.c b/drivers/net/iavf/iavf_generic_flow.c
index 321a4dc..00e7f15 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..efc7f22 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[];
 
+/* IPv6 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 d0a6396..2193360 100644
--- a/drivers/net/iavf/iavf_hash.c
+++ b/drivers/net/iavf/iavf_hash.c
@@ -132,6 +132,9 @@ struct iavf_hash_flow_cfg {
 	VIRTCHNL_PROTO_HDR_PFCP, \
 	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_PFCP_SEID), {BUFF_NOUSED} }
 
+#define proto_hdr_gtpc { \
+	VIRTCHNL_PROTO_HDR_GTPC, 0, {BUFF_NOUSED} }
+
 #define TUNNEL_LEVEL_OUTER		0
 #define TUNNEL_LEVEL_INNER		1
 
@@ -256,6 +259,14 @@ struct virtchnl_proto_hdrs ipv6_pfcp_tmplt = {
 	TUNNEL_LEVEL_OUTER, 2, {proto_hdr_ipv6, proto_hdr_pfcp}
 };
 
+struct virtchnl_proto_hdrs ipv4_udp_gtpc_tmplt = {
+	TUNNEL_LEVEL_OUTER, 3, {proto_hdr_ipv4, proto_hdr_udp, proto_hdr_gtpc}
+};
+
+struct virtchnl_proto_hdrs ipv6_udp_gtpc_tmplt = {
+	TUNNEL_LEVEL_OUTER, 3, {proto_hdr_ipv6, proto_hdr_udp, proto_hdr_gtpc}
+};
+
 /* rss type super set */
 
 /* IPv4 outer */
@@ -366,6 +377,7 @@ struct virtchnl_proto_hdrs ipv6_pfcp_tmplt = {
 	{iavf_pattern_eth_ipv4_ah,			IAVF_RSS_TYPE_IPV4_AH,		&ipv4_ah_tmplt},
 	{iavf_pattern_eth_ipv4_l2tpv3,			IAVF_RSS_TYPE_IPV4_L2TPV3,	&ipv4_l2tpv3_tmplt},
 	{iavf_pattern_eth_ipv4_pfcp,			IAVF_RSS_TYPE_IPV4_PFCP,	&ipv4_pfcp_tmplt},
+	{iavf_pattern_eth_ipv4_gtpc,			ETH_RSS_IPV4,			&ipv4_udp_gtpc_tmplt},
 	/* IPv6 */
 	{iavf_pattern_eth_ipv6,				IAVF_RSS_TYPE_OUTER_IPV6,	&outer_ipv6_tmplt},
 	{iavf_pattern_eth_ipv6_udp,			IAVF_RSS_TYPE_OUTER_IPV6_UDP,	&outer_ipv6_udp_tmplt},
@@ -393,6 +405,7 @@ struct virtchnl_proto_hdrs ipv6_pfcp_tmplt = {
 	{iavf_pattern_eth_ipv6_ah,			IAVF_RSS_TYPE_IPV6_AH,		&ipv6_ah_tmplt},
 	{iavf_pattern_eth_ipv6_l2tpv3,			IAVF_RSS_TYPE_IPV6_L2TPV3,	&ipv6_l2tpv3_tmplt},
 	{iavf_pattern_eth_ipv6_pfcp,			IAVF_RSS_TYPE_IPV6_PFCP,	&ipv6_pfcp_tmplt},
+	{iavf_pattern_eth_ipv6_gtpc,			ETH_RSS_IPV6,			&ipv6_udp_gtpc_tmplt},
 };
 
 struct virtchnl_proto_hdrs *iavf_hash_default_hdrs[] = {
-- 
1.8.3.1


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

* Re: [dpdk-dev] [PATCH v5] net/iavf: support outer IP hash for no inner GTPU
  2020-09-14  9:03     ` [dpdk-dev] [PATCH v5] net/iavf: support outer IP hash for no inner GTPU alvinx.zhang
@ 2020-09-14 10:33       ` Zhang, Qi Z
  2020-09-15  1:54         ` Zhang, AlvinX
  2020-09-15  2:43       ` [dpdk-dev] [PATCH v6] " alvinx.zhang
  1 sibling, 1 reply; 17+ messages in thread
From: Zhang, Qi Z @ 2020-09-14 10:33 UTC (permalink / raw)
  To: Zhang, AlvinX, Guo, Jia; +Cc: dev



> -----Original Message-----
> From: Zhang, AlvinX <alvinx.zhang@intel.com>
> Sent: Monday, September 14, 2020 5:03 PM
> To: Guo, Jia <jia.guo@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org; Zhang, AlvinX <alvinx.zhang@intel.com>
> Subject: [PATCH v5] net/iavf: support outer IP hash for no inner GTPU
> 
> From: Alvin Zhang <alvinx.zhang@intel.com>
> 
> Outer IP hash can be configured as input sets for no inner GTPU packets.
> 
> Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
> ---
> 
> V2: Modify codes according to comments.
> V3: Refact all codes.
> V4: Fix compatibility issues.
> V5: Modify codes according to comments.
> 
>  drivers/net/iavf/iavf_hash.c | 48 ++++++++++++++++++++++++++------------------
>  1 file changed, 28 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index
> ff77d71..d0a6396 100644
> --- a/drivers/net/iavf/iavf_hash.c
> +++ b/drivers/net/iavf/iavf_hash.c
> @@ -348,6 +348,7 @@ struct virtchnl_proto_hdrs ipv6_pfcp_tmplt = {
>  	{iavf_pattern_eth_vlan_ipv4_udp,		IAVF_RSS_TYPE_VLAN_IPV4_UDP,
> 	&outer_ipv4_udp_tmplt},
>  	{iavf_pattern_eth_vlan_ipv4_tcp,		IAVF_RSS_TYPE_VLAN_IPV4_TCP,
> 	&outer_ipv4_tcp_tmplt},
>  	{iavf_pattern_eth_vlan_ipv4_sctp,		IAVF_RSS_TYPE_VLAN_IPV4_SCTP,
> 	&outer_ipv4_sctp_tmplt},
> +	{iavf_pattern_eth_ipv4_gtpu,			ETH_RSS_IPV4,
> 	&outer_ipv4_udp_tmplt},
>  	{iavf_pattern_eth_ipv4_gtpu_ipv4,		IAVF_RSS_TYPE_GTPU_IPV4,
> 	&inner_ipv4_tmplt},
>  	{iavf_pattern_eth_ipv4_gtpu_ipv4_udp,
> 	IAVF_RSS_TYPE_GTPU_IPV4_UDP,	&inner_ipv4_udp_tmplt},
>  	{iavf_pattern_eth_ipv4_gtpu_ipv4_tcp,
> 	IAVF_RSS_TYPE_GTPU_IPV4_TCP,	&inner_ipv4_tcp_tmplt},
> @@ -374,6 +375,7 @@ struct virtchnl_proto_hdrs ipv6_pfcp_tmplt = {
>  	{iavf_pattern_eth_vlan_ipv6_udp,		IAVF_RSS_TYPE_VLAN_IPV6_UDP,
> 	&outer_ipv6_udp_tmplt},
>  	{iavf_pattern_eth_vlan_ipv6_tcp,		IAVF_RSS_TYPE_VLAN_IPV6_TCP,
> 	&outer_ipv6_tcp_tmplt},
>  	{iavf_pattern_eth_vlan_ipv6_sctp,		IAVF_RSS_TYPE_VLAN_IPV6_SCTP,
> 	&outer_ipv6_sctp_tmplt},
> +	{iavf_pattern_eth_ipv6_gtpu,			ETH_RSS_IPV6,
> 	&outer_ipv6_udp_tmplt},
>  	{iavf_pattern_eth_ipv4_gtpu_ipv6,		IAVF_RSS_TYPE_GTPU_IPV6,
> 	&inner_ipv6_tmplt},
>  	{iavf_pattern_eth_ipv4_gtpu_ipv6_udp,
> 	IAVF_RSS_TYPE_GTPU_IPV6_UDP,	&inner_ipv6_udp_tmplt},
>  	{iavf_pattern_eth_ipv4_gtpu_ipv6_tcp,
> 	IAVF_RSS_TYPE_GTPU_IPV6_TCP,	&inner_ipv6_tcp_tmplt},
> @@ -698,31 +700,37 @@ struct virtchnl_proto_hdrs
> *iavf_hash_default_hdrs[] = {
>  	struct virtchnl_proto_hdr *hdr2;
>  	int i;
> 
> -	if (!(phint & IAVF_PHINT_GTPU_MSK) ||
> -	    proto_hdrs->tunnel_level == 0)
> +	if (!(phint & IAVF_PHINT_GTPU_MSK))
>  		return;
> 
> -	/* shift headers 1 layer */
> -	for (i = proto_hdrs->count; i > 0; i--) {
> -		hdr1 = &proto_hdrs->proto_hdr[i];
> -		hdr2 = &proto_hdrs->proto_hdr[i - 1];
> +	if (proto_hdrs->tunnel_level == TUNNEL_LEVEL_INNER) {
> +		/* shift headers 1 layer */
> +		for (i = proto_hdrs->count; i > 0; i--) {
> +			hdr1 = &proto_hdrs->proto_hdr[i];
> +			hdr2 = &proto_hdrs->proto_hdr[i - 1];
> 
> -		*hdr1 = *hdr2;
> -	}
> +			*hdr1 = *hdr2;
> +		}
> 
> -	/* adding gtpu header at layer 0 */
> -	proto_hdrs->count++;
> -	hdr1 = &proto_hdrs->proto_hdr[0];
> -	hdr1->field_selector = 0;
> -
> -	if (phint & IAVF_PHINT_GTPU_EH_DWN)
> -		VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, GTPU_EH_PDU_DWN);
> -	else if (phint & IAVF_PHINT_GTPU_EH_UP)
> -		VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, GTPU_EH_PDU_UP);
> -	else if (phint & IAVF_PHINT_GTPU_EH)
> -		VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, GTPU_EH);
> -	else if (phint & IAVF_PHINT_GTPU)
> +		/* adding gtpu header at layer 0 */
> +		proto_hdrs->count++;
> +		hdr1 = &proto_hdrs->proto_hdr[0];
> +		hdr1->field_selector = 0;
> +
> +		if (phint & IAVF_PHINT_GTPU_EH_DWN)
> +			VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, GTPU_EH_PDU_DWN);
> +		else if (phint & IAVF_PHINT_GTPU_EH_UP)
> +			VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, GTPU_EH_PDU_UP);
> +		else if (phint & IAVF_PHINT_GTPU_EH)
> +			VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, GTPU_EH);
> +		else if (phint & IAVF_PHINT_GTPU)
> +			VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, GTPU_IP);
> +	} else {
> +		hdr1 = &proto_hdrs->proto_hdr[proto_hdrs->count];
> +		hdr1->field_selector = 0;
> +		proto_hdrs->count++;
>  		VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, GTPU_IP);

Its better to also check phint for outer case, could be implemented as below

If (inner) {
	Shift 
	Hdr = hdrs[0]
}
else {
	Hdr = hdrs[count]
}

hdr-count++

if (phint & IAVF_PHINT_GTPU_EH_DWN)
	VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, GTPU_EH_PDU_DWN);
else if (phint & IAVF_PHINT_GTPU_EH_UP)
	VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, GTPU_EH_PDU_UP);
else if (phint & IAVF_PHINT_GTPU_EH)			
	VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, GTPU_EH);
else if (phint & IAVF_PHINT_GTPU)
	VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, GTPU_IP);


> +	}
>  }
> 
>  static void iavf_refine_proto_hdrs(struct virtchnl_proto_hdrs *proto_hdrs,
> --
> 1.8.3.1


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

* Re: [dpdk-dev] [PATCH v5] net/iavf: support outer IP hash for GTPC
  2020-09-14  9:12     ` [dpdk-dev] [PATCH v5] " alvinx.zhang
@ 2020-09-14 10:48       ` Zhang, Qi Z
  0 siblings, 0 replies; 17+ messages in thread
From: Zhang, Qi Z @ 2020-09-14 10:48 UTC (permalink / raw)
  To: Zhang, AlvinX, Guo, Jia; +Cc: dev



> -----Original Message-----
> From: Zhang, AlvinX <alvinx.zhang@intel.com>
> Sent: Monday, September 14, 2020 5:12 PM
> To: Guo, Jia <jia.guo@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org; Zhang, AlvinX <alvinx.zhang@intel.com>
> Subject: [PATCH v5] net/iavf: support outer IP hash for GTPC
> 
> From: Alvin Zhang <alvinx.zhang@intel.com>
> 
> Add patterns and headers for GTPC, now outer IP hash can be configured as
> input sets for GTPC packets.
> 
> Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi

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

* Re: [dpdk-dev] [PATCH v5] net/iavf: support outer IP hash for no inner GTPU
  2020-09-14 10:33       ` Zhang, Qi Z
@ 2020-09-15  1:54         ` Zhang, AlvinX
  0 siblings, 0 replies; 17+ messages in thread
From: Zhang, AlvinX @ 2020-09-15  1:54 UTC (permalink / raw)
  To: Zhang, Qi Z; +Cc: dev

Thanks Zhangqi.

> -----Original Message-----
> From: Zhang, Qi Z <qi.z.zhang@intel.com>
> Sent: Monday, September 14, 2020 6:33 PM
> To: Zhang, AlvinX <alvinx.zhang@intel.com>; Guo, Jia <jia.guo@intel.com>
> Cc: dev@dpdk.org
> Subject: RE: [PATCH v5] net/iavf: support outer IP hash for no inner GTPU
> 
> 
> 
> > -----Original Message-----
> > From: Zhang, AlvinX <alvinx.zhang@intel.com>
> > Sent: Monday, September 14, 2020 5:03 PM
> > To: Guo, Jia <jia.guo@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> > Cc: dev@dpdk.org; Zhang, AlvinX <alvinx.zhang@intel.com>
> > Subject: [PATCH v5] net/iavf: support outer IP hash for no inner GTPU
> >
> > From: Alvin Zhang <alvinx.zhang@intel.com>
> >
> > Outer IP hash can be configured as input sets for no inner GTPU packets.
> >
> > Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
> > ---
> >
> > V2: Modify codes according to comments.
> > V3: Refact all codes.
> > V4: Fix compatibility issues.
> > V5: Modify codes according to comments.
> >
> >  drivers/net/iavf/iavf_hash.c | 48
> > ++++++++++++++++++++++++++------------------
> >  1 file changed, 28 insertions(+), 20 deletions(-)
> >
> > diff --git a/drivers/net/iavf/iavf_hash.c
> > b/drivers/net/iavf/iavf_hash.c index
> > ff77d71..d0a6396 100644
> > --- a/drivers/net/iavf/iavf_hash.c
> > +++ b/drivers/net/iavf/iavf_hash.c
> > @@ -348,6 +348,7 @@ struct virtchnl_proto_hdrs ipv6_pfcp_tmplt = {
> > {iavf_pattern_eth_vlan_ipv4_udp,IAVF_RSS_TYPE_VLAN_IPV4_UDP,
> > &outer_ipv4_udp_tmplt},
> >  {iavf_pattern_eth_vlan_ipv4_tcp,IAVF_RSS_TYPE_VLAN_IPV4_TCP,
> > &outer_ipv4_tcp_tmplt},
> >  {iavf_pattern_eth_vlan_ipv4_sctp,IAVF_RSS_TYPE_VLAN_IPV4_SCTP,
> > &outer_ipv4_sctp_tmplt},
> > +{iavf_pattern_eth_ipv4_gtpu,ETH_RSS_IPV4,
> > &outer_ipv4_udp_tmplt},
> >  {iavf_pattern_eth_ipv4_gtpu_ipv4,IAVF_RSS_TYPE_GTPU_IPV4,
> > &inner_ipv4_tmplt},
> >  {iavf_pattern_eth_ipv4_gtpu_ipv4_udp,
> > IAVF_RSS_TYPE_GTPU_IPV4_UDP,&inner_ipv4_udp_tmplt},
> >  {iavf_pattern_eth_ipv4_gtpu_ipv4_tcp,
> > IAVF_RSS_TYPE_GTPU_IPV4_TCP,&inner_ipv4_tcp_tmplt},
> > @@ -374,6 +375,7 @@ struct virtchnl_proto_hdrs ipv6_pfcp_tmplt = {
> > {iavf_pattern_eth_vlan_ipv6_udp,IAVF_RSS_TYPE_VLAN_IPV6_UDP,
> > &outer_ipv6_udp_tmplt},
> >  {iavf_pattern_eth_vlan_ipv6_tcp,IAVF_RSS_TYPE_VLAN_IPV6_TCP,
> > &outer_ipv6_tcp_tmplt},
> >  {iavf_pattern_eth_vlan_ipv6_sctp,IAVF_RSS_TYPE_VLAN_IPV6_SCTP,
> > &outer_ipv6_sctp_tmplt},
> > +{iavf_pattern_eth_ipv6_gtpu,ETH_RSS_IPV6,
> > &outer_ipv6_udp_tmplt},
> >  {iavf_pattern_eth_ipv4_gtpu_ipv6,IAVF_RSS_TYPE_GTPU_IPV6,
> > &inner_ipv6_tmplt},
> >  {iavf_pattern_eth_ipv4_gtpu_ipv6_udp,
> > IAVF_RSS_TYPE_GTPU_IPV6_UDP,&inner_ipv6_udp_tmplt},
> >  {iavf_pattern_eth_ipv4_gtpu_ipv6_tcp,
> > IAVF_RSS_TYPE_GTPU_IPV6_TCP,&inner_ipv6_tcp_tmplt},
> > @@ -698,31 +700,37 @@ struct virtchnl_proto_hdrs
> > *iavf_hash_default_hdrs[] = {  struct virtchnl_proto_hdr *hdr2;  int
> > i;
> >
> > -if (!(phint & IAVF_PHINT_GTPU_MSK) ||
> > -    proto_hdrs->tunnel_level == 0)
> > +if (!(phint & IAVF_PHINT_GTPU_MSK))
> >  return;
> >
> > -/* shift headers 1 layer */
> > -for (i = proto_hdrs->count; i > 0; i--) {
> > -hdr1 = &proto_hdrs->proto_hdr[i];
> > -hdr2 = &proto_hdrs->proto_hdr[i - 1];
> > +if (proto_hdrs->tunnel_level == TUNNEL_LEVEL_INNER) {
> > +/* shift headers 1 layer */
> > +for (i = proto_hdrs->count; i > 0; i--) {
> > +hdr1 = &proto_hdrs->proto_hdr[i];
> > +hdr2 = &proto_hdrs->proto_hdr[i - 1];
> >
> > -*hdr1 = *hdr2;
> > -}
> > +*hdr1 = *hdr2;
> > +}
> >
> > -/* adding gtpu header at layer 0 */
> > -proto_hdrs->count++;
> > -hdr1 = &proto_hdrs->proto_hdr[0];
> > -hdr1->field_selector = 0;
> > -
> > -if (phint & IAVF_PHINT_GTPU_EH_DWN)
> > -VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, GTPU_EH_PDU_DWN); -else if
> (phint &
> > IAVF_PHINT_GTPU_EH_UP) -VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1,
> > GTPU_EH_PDU_UP); -else if (phint & IAVF_PHINT_GTPU_EH)
> > -VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, GTPU_EH); -else if (phint &
> > IAVF_PHINT_GTPU)
> > +/* adding gtpu header at layer 0 */
> > +proto_hdrs->count++;
> > +hdr1 = &proto_hdrs->proto_hdr[0];
> > +hdr1->field_selector = 0;
> > +
> > +if (phint & IAVF_PHINT_GTPU_EH_DWN)
> > +VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, GTPU_EH_PDU_DWN); else if
> (phint &
> > +IAVF_PHINT_GTPU_EH_UP) VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1,
> > +GTPU_EH_PDU_UP); else if (phint & IAVF_PHINT_GTPU_EH)
> > +VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, GTPU_EH); else if (phint &
> > +IAVF_PHINT_GTPU) VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, GTPU_IP); }
> else {
> > +hdr1 = &proto_hdrs->proto_hdr[proto_hdrs->count];
> > +hdr1->field_selector = 0;
> > +proto_hdrs->count++;
> >  VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, GTPU_IP);
> 
> Its better to also check phint for outer case, could be implemented as below
> 
> If (inner) {
> Shift
> Hdr = hdrs[0]
> }
> else {
> Hdr = hdrs[count]
> }
> 
> hdr-count++
> 
> if (phint & IAVF_PHINT_GTPU_EH_DWN)
> VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, GTPU_EH_PDU_DWN); else if (phint &
> IAVF_PHINT_GTPU_EH_UP) VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1,
> GTPU_EH_PDU_UP); else if (phint & IAVF_PHINT_GTPU_EH)
> VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, GTPU_EH); else if (phint &
> IAVF_PHINT_GTPU) VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, GTPU_IP);
> 
> 
> > +}
> >  }
> >
> >  static void iavf_refine_proto_hdrs(struct virtchnl_proto_hdrs
> > *proto_hdrs,
> > --
> > 1.8.3.1
> 


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

* [dpdk-dev] [PATCH v6] net/iavf: support outer IP hash for no inner GTPU
  2020-09-14  9:03     ` [dpdk-dev] [PATCH v5] net/iavf: support outer IP hash for no inner GTPU alvinx.zhang
  2020-09-14 10:33       ` Zhang, Qi Z
@ 2020-09-15  2:43       ` alvinx.zhang
  2020-09-15  2:58         ` Zhang, Qi Z
  1 sibling, 1 reply; 17+ messages in thread
From: alvinx.zhang @ 2020-09-15  2:43 UTC (permalink / raw)
  To: jia.guo, qi.z.zhang; +Cc: dev, Alvin Zhang

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

Outer IP hash can be configured as input sets for no inner GTPU packets.

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>

V2: Modify codes according to comments.
V3: Refact all codes.
V4: Fix compatibility issues.
V5, V6: Modify codes according to comments.

---
 drivers/net/iavf/iavf_hash.c | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c
index 780ec27..3152218 100644
--- a/drivers/net/iavf/iavf_hash.c
+++ b/drivers/net/iavf/iavf_hash.c
@@ -359,6 +359,7 @@ struct virtchnl_proto_hdrs ipv6_udp_gtpc_tmplt = {
 	{iavf_pattern_eth_vlan_ipv4_udp,		IAVF_RSS_TYPE_VLAN_IPV4_UDP,	&outer_ipv4_udp_tmplt},
 	{iavf_pattern_eth_vlan_ipv4_tcp,		IAVF_RSS_TYPE_VLAN_IPV4_TCP,	&outer_ipv4_tcp_tmplt},
 	{iavf_pattern_eth_vlan_ipv4_sctp,		IAVF_RSS_TYPE_VLAN_IPV4_SCTP,	&outer_ipv4_sctp_tmplt},
+	{iavf_pattern_eth_ipv4_gtpu,			ETH_RSS_IPV4,			&outer_ipv4_udp_tmplt},
 	{iavf_pattern_eth_ipv4_gtpu_ipv4,		IAVF_RSS_TYPE_GTPU_IPV4,	&inner_ipv4_tmplt},
 	{iavf_pattern_eth_ipv4_gtpu_ipv4_udp,		IAVF_RSS_TYPE_GTPU_IPV4_UDP,	&inner_ipv4_udp_tmplt},
 	{iavf_pattern_eth_ipv4_gtpu_ipv4_tcp,		IAVF_RSS_TYPE_GTPU_IPV4_TCP,	&inner_ipv4_tcp_tmplt},
@@ -386,6 +387,7 @@ struct virtchnl_proto_hdrs ipv6_udp_gtpc_tmplt = {
 	{iavf_pattern_eth_vlan_ipv6_udp,		IAVF_RSS_TYPE_VLAN_IPV6_UDP,	&outer_ipv6_udp_tmplt},
 	{iavf_pattern_eth_vlan_ipv6_tcp,		IAVF_RSS_TYPE_VLAN_IPV6_TCP,	&outer_ipv6_tcp_tmplt},
 	{iavf_pattern_eth_vlan_ipv6_sctp,		IAVF_RSS_TYPE_VLAN_IPV6_SCTP,	&outer_ipv6_sctp_tmplt},
+	{iavf_pattern_eth_ipv6_gtpu,			ETH_RSS_IPV6,			&outer_ipv6_udp_tmplt},
 	{iavf_pattern_eth_ipv4_gtpu_ipv6,		IAVF_RSS_TYPE_GTPU_IPV6,	&inner_ipv6_tmplt},
 	{iavf_pattern_eth_ipv4_gtpu_ipv6_udp,		IAVF_RSS_TYPE_GTPU_IPV6_UDP,	&inner_ipv6_udp_tmplt},
 	{iavf_pattern_eth_ipv4_gtpu_ipv6_tcp,		IAVF_RSS_TYPE_GTPU_IPV6_TCP,	&inner_ipv6_tcp_tmplt},
@@ -714,22 +716,26 @@ struct virtchnl_proto_hdrs *iavf_hash_default_hdrs[] = {
 	struct virtchnl_proto_hdr *hdr2;
 	int i;
 
-	if (!(phint & IAVF_PHINT_GTPU_MSK) ||
-	    proto_hdrs->tunnel_level == 0)
+	if (!(phint & IAVF_PHINT_GTPU_MSK))
 		return;
 
-	/* shift headers 1 layer */
-	for (i = proto_hdrs->count; i > 0; i--) {
-		hdr1 = &proto_hdrs->proto_hdr[i];
-		hdr2 = &proto_hdrs->proto_hdr[i - 1];
+	if (proto_hdrs->tunnel_level == TUNNEL_LEVEL_INNER) {
+		/* shift headers 1 layer */
+		for (i = proto_hdrs->count; i > 0; i--) {
+			hdr1 = &proto_hdrs->proto_hdr[i];
+			hdr2 = &proto_hdrs->proto_hdr[i - 1];
 
-		*hdr1 = *hdr2;
+			*hdr1 = *hdr2;
+		}
+
+		/* adding gtpu header at layer 0 */
+		hdr1 = &proto_hdrs->proto_hdr[0];
+	} else {
+		hdr1 = &proto_hdrs->proto_hdr[proto_hdrs->count];
 	}
 
-	/* adding gtpu header at layer 0 */
-	proto_hdrs->count++;
-	hdr1 = &proto_hdrs->proto_hdr[0];
 	hdr1->field_selector = 0;
+	proto_hdrs->count++;
 
 	if (phint & IAVF_PHINT_GTPU_EH_DWN)
 		VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, GTPU_EH_PDU_DWN);
-- 
1.8.3.1


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

* Re: [dpdk-dev] [PATCH v6] net/iavf: support outer IP hash for no inner GTPU
  2020-09-15  2:43       ` [dpdk-dev] [PATCH v6] " alvinx.zhang
@ 2020-09-15  2:58         ` Zhang, Qi Z
  0 siblings, 0 replies; 17+ messages in thread
From: Zhang, Qi Z @ 2020-09-15  2:58 UTC (permalink / raw)
  To: Zhang, AlvinX, Guo, Jia; +Cc: dev



> -----Original Message-----
> From: Zhang, AlvinX <alvinx.zhang@intel.com>
> Sent: Tuesday, September 15, 2020 10:44 AM
> To: Guo, Jia <jia.guo@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org; Zhang, AlvinX <alvinx.zhang@intel.com>
> Subject: [PATCH v6] net/iavf: support outer IP hash for no inner GTPU
> 
> From: Alvin Zhang <alvinx.zhang@intel.com>
> 
> Outer IP hash can be configured as input sets for no inner GTPU packets.
> 
> Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi

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

end of thread, other threads:[~2020-09-15  2:58 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-08  9:50 [dpdk-dev] [PATCH v3 1/3] common/iavf: add GTPC support alvinx.zhang
2020-09-08  9:50 ` [dpdk-dev] [PATCH v3 2/3] net/iavf: support outer IP hash for GTPC alvinx.zhang
2020-09-08  9:50 ` [dpdk-dev] [PATCH v3 3/3] net/iavf: support outer IP hash for GTPU alvinx.zhang
2020-09-10  3:26   ` [dpdk-dev] [PATCH v4] " alvinx.zhang
2020-09-10  5:24     ` Guo, Jia
2020-09-10  9:24       ` Zhang, AlvinX
2020-09-14  9:03     ` [dpdk-dev] [PATCH v5] net/iavf: support outer IP hash for no inner GTPU alvinx.zhang
2020-09-14 10:33       ` Zhang, Qi Z
2020-09-15  1:54         ` Zhang, AlvinX
2020-09-15  2:43       ` [dpdk-dev] [PATCH v6] " alvinx.zhang
2020-09-15  2:58         ` Zhang, Qi Z
2020-09-10  3:36 ` [dpdk-dev] [PATCH v4 1/2] common/iavf: add GTPC support alvinx.zhang
2020-09-10  3:36   ` [dpdk-dev] [PATCH v4 2/2] net/iavf: support outer IP hash for GTPC alvinx.zhang
2020-09-10  5:14     ` Guo, Jia
2020-09-10  9:29       ` Zhang, AlvinX
2020-09-14  9:12     ` [dpdk-dev] [PATCH v5] " alvinx.zhang
2020-09-14 10:48       ` 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).