DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jie Wang <jie1x.wang@intel.com>
To: dev@dpdk.org
Cc: orika@nvidia.com, ferruh.yigit@intel.com, thomas@monjalon.net,
	andrew.rybchenko@oktetlabs.ru, xiaoyun.li@intel.com,
	stevex.yang@intel.com, jingjing.wu@intel.com,
	beilei.xing@intel.com, wenjun1.wu@intel.com,
	qi.z.zhang@intel.com, Jie Wang <jie1x.wang@intel.com>
Subject: [dpdk-dev] [PATCH v9 2/3] net/iavf: support PPPoL2TPv2oUDP RSS Hash
Date: Thu, 21 Oct 2021 18:49:23 +0800	[thread overview]
Message-ID: <20211021104924.1586172-3-jie1x.wang@intel.com> (raw)
In-Reply-To: <20211021104924.1586172-1-jie1x.wang@intel.com>

Add support for PPP over L2TPv2 over UDP protocol RSS Hash based
on inner IP src/dst address and TCP/UDP src/dst port.

Patterns are listed below:
eth/ipv4(6)/udp/l2tpv2/ppp/ipv4(6)
eth/ipv4(6)/udp/l2tpv2/ppp/ipv4(6)/udp
eth/ipv4(6)/udp/l2tpv2/ppp/ipv4(6)/tcp

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Signed-off-by: Jie Wang <jie1x.wang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
---
 doc/guides/nics/features/iavf.ini      |   2 +
 doc/guides/rel_notes/release_21_11.rst |   1 +
 drivers/net/iavf/iavf_generic_flow.c   | 131 +++++++++++++++++++++++++
 drivers/net/iavf/iavf_generic_flow.h   |  15 +++
 drivers/net/iavf/iavf_hash.c           | 108 +++++++++++++++++++-
 5 files changed, 255 insertions(+), 2 deletions(-)

diff --git a/doc/guides/nics/features/iavf.ini b/doc/guides/nics/features/iavf.ini
index d00ca934c3..a916275b88 100644
--- a/doc/guides/nics/features/iavf.ini
+++ b/doc/guides/nics/features/iavf.ini
@@ -50,8 +50,10 @@ icmp6                = Y
 ipv4                 = Y
 ipv6                 = Y
 ipv6_frag_ext        = Y
+l2tpv2               = Y
 l2tpv3oip            = Y
 pfcp                 = Y
+ppp                  = Y
 sctp                 = Y
 tcp                  = Y
 udp                  = Y
diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
index 283770131c..bd0eacc0c5 100644
--- a/doc/guides/rel_notes/release_21_11.rst
+++ b/doc/guides/rel_notes/release_21_11.rst
@@ -132,6 +132,7 @@ New Features
 
   * Added Intel iavf support on Windows.
   * Added IPv4 and L4 (TCP/UDP/SCTP) checksum hash support in RSS flow.
+  * Added PPPoL2TPv2oUDP RSS hash based on inner IP address and TCP/UDP port.
 
 * **Updated Intel ice driver.**
 
diff --git a/drivers/net/iavf/iavf_generic_flow.c b/drivers/net/iavf/iavf_generic_flow.c
index b86d99e57d..364904fa02 100644
--- a/drivers/net/iavf/iavf_generic_flow.c
+++ b/drivers/net/iavf/iavf_generic_flow.c
@@ -1611,6 +1611,137 @@ enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_udp[] = {
 	RTE_FLOW_ITEM_TYPE_END,
 };
 
+/* PPPoL2TPv2oUDP */
+enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_L2TPV2,
+	RTE_FLOW_ITEM_TYPE_PPP,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_L2TPV2,
+	RTE_FLOW_ITEM_TYPE_PPP,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_END,
+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IPV4,
+	RTE_FLOW_ITEM_TYPE_TCP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2_ppp_ipv6_udp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_L2TPV2,
+	RTE_FLOW_ITEM_TYPE_PPP,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2_ppp_ipv6_tcp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_L2TPV2,
+	RTE_FLOW_ITEM_TYPE_PPP,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_TCP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+
+
 typedef struct iavf_flow_engine * (*parse_engine_t)(struct iavf_adapter *ad,
 		struct rte_flow *flow,
 		struct iavf_parser_list *parser_list,
diff --git a/drivers/net/iavf/iavf_generic_flow.h b/drivers/net/iavf/iavf_generic_flow.h
index 4794d1fb80..f2b54e1944 100644
--- a/drivers/net/iavf/iavf_generic_flow.h
+++ b/drivers/net/iavf/iavf_generic_flow.h
@@ -410,6 +410,21 @@ extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_tcp[];
 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_udp[];
 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_udp[];
 
+/* PPPoL2TPv2oUDP */
+extern enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4_udp[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4_tcp[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6_udp[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6_tcp[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2_ppp_ipv4[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2_ppp_ipv6[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2_ppp_ipv4_udp[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2_ppp_ipv4_tcp[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2_ppp_ipv6_udp[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2_ppp_ipv6_tcp[];
+
+
 extern const struct rte_flow_ops iavf_flow_ops;
 
 /* pattern structure */
diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c
index 1f2d3772d1..01724cd569 100644
--- a/drivers/net/iavf/iavf_hash.c
+++ b/drivers/net/iavf/iavf_hash.c
@@ -34,6 +34,8 @@
 /* the second IP header of GTPoGRE */
 #define IAVF_PHINT_MID_IPV4			BIT_ULL(7)
 #define IAVF_PHINT_MID_IPV6			BIT_ULL(8)
+/* L2TPv2 */
+#define IAVF_PHINT_L2TPV2			BIT_ULL(9)
 
 #define IAVF_PHINT_GTPU_MSK	(IAVF_PHINT_GTPU	| \
 				 IAVF_PHINT_GTPU_EH	| \
@@ -164,6 +166,12 @@ iavf_hash_parse_pattern_action(struct iavf_adapter *ad,
 	VIRTCHNL_PROTO_HDR_ECPRI, \
 	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_ECPRI_PC_RTC_ID), {BUFF_NOUSED} }
 
+#define proto_hdr_l2tpv2 { \
+	VIRTCHNL_PROTO_HDR_L2TPV2, 0, {BUFF_NOUSED} }
+
+#define proto_hdr_ppp { \
+	VIRTCHNL_PROTO_HDR_PPP, 0, {BUFF_NOUSED} }
+
 #define TUNNEL_LEVEL_OUTER		0
 #define TUNNEL_LEVEL_INNER		1
 
@@ -338,6 +346,52 @@ struct virtchnl_proto_hdrs ipv4_ecpri_tmplt = {
 	TUNNEL_LEVEL_OUTER, 3, {proto_hdr_ipv4, proto_hdr_udp, proto_hdr_ecpri}
 };
 
+struct virtchnl_proto_hdrs udp_l2tpv2_ppp_ipv4_tmplt = {
+	TUNNEL_LEVEL_INNER, 3,
+	{proto_hdr_l2tpv2,
+	 proto_hdr_ppp,
+	 proto_hdr_ipv4}
+};
+
+struct virtchnl_proto_hdrs udp_l2tpv2_ppp_ipv6_tmplt = {
+	TUNNEL_LEVEL_INNER, 3,
+	{proto_hdr_l2tpv2,
+	 proto_hdr_ppp,
+	 proto_hdr_ipv6}
+};
+
+struct virtchnl_proto_hdrs udp_l2tpv2_ppp_ipv4_udp_tmplt = {
+	TUNNEL_LEVEL_INNER, 4,
+	{proto_hdr_l2tpv2,
+	 proto_hdr_ppp,
+	 proto_hdr_ipv4_with_prot,
+	 proto_hdr_udp}
+};
+
+struct virtchnl_proto_hdrs udp_l2tpv2_ppp_ipv4_tcp_tmplt = {
+	TUNNEL_LEVEL_INNER, 4,
+	{proto_hdr_l2tpv2,
+	 proto_hdr_ppp,
+	 proto_hdr_ipv4_with_prot,
+	 proto_hdr_tcp}
+};
+
+struct virtchnl_proto_hdrs udp_l2tpv2_ppp_ipv6_udp_tmplt = {
+	TUNNEL_LEVEL_INNER, 4,
+	{proto_hdr_l2tpv2,
+	 proto_hdr_ppp,
+	 proto_hdr_ipv6_with_prot,
+	 proto_hdr_udp}
+};
+
+struct virtchnl_proto_hdrs udp_l2tpv2_ppp_ipv6_tcp_tmplt = {
+	TUNNEL_LEVEL_INNER, 4,
+	{proto_hdr_l2tpv2,
+	 proto_hdr_ppp,
+	 proto_hdr_ipv6_with_prot,
+	 proto_hdr_tcp}
+};
+
 /* rss type super set */
 
 /* IPv4 outer */
@@ -493,6 +547,13 @@ static struct iavf_pattern_match_item iavf_hash_pattern_list[] = {
 	{iavf_pattern_eth_ipv6_gre_ipv4_tcp,	IAVF_RSS_TYPE_INNER_IPV4_TCP, &inner_ipv4_tcp_tmplt},
 	{iavf_pattern_eth_ipv4_gre_ipv4_udp,	IAVF_RSS_TYPE_INNER_IPV4_UDP, &inner_ipv4_udp_tmplt},
 	{iavf_pattern_eth_ipv6_gre_ipv4_udp,	IAVF_RSS_TYPE_INNER_IPV4_UDP, &inner_ipv4_udp_tmplt},
+	{iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4,	IAVF_RSS_TYPE_INNER_IPV4,	&udp_l2tpv2_ppp_ipv4_tmplt},
+	{iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4_udp,	IAVF_RSS_TYPE_INNER_IPV4_UDP,	&udp_l2tpv2_ppp_ipv4_udp_tmplt},
+	{iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4_tcp,	IAVF_RSS_TYPE_INNER_IPV4_TCP,	&udp_l2tpv2_ppp_ipv4_tcp_tmplt},
+	{iavf_pattern_eth_ipv6_udp_l2tpv2_ppp_ipv4,	IAVF_RSS_TYPE_INNER_IPV4,	&udp_l2tpv2_ppp_ipv4_tmplt},
+	{iavf_pattern_eth_ipv6_udp_l2tpv2_ppp_ipv4_udp,	IAVF_RSS_TYPE_INNER_IPV4_UDP,	&udp_l2tpv2_ppp_ipv4_udp_tmplt},
+	{iavf_pattern_eth_ipv6_udp_l2tpv2_ppp_ipv4_tcp,	IAVF_RSS_TYPE_INNER_IPV4_TCP,	&udp_l2tpv2_ppp_ipv4_tcp_tmplt},
+
 	/* IPv6 */
 	{iavf_pattern_eth_ipv6,				IAVF_RSS_TYPE_OUTER_IPV6,	&outer_ipv6_tmplt},
 	{iavf_pattern_eth_ipv6_frag_ext,		IAVF_RSS_TYPE_OUTER_IPV6_FRAG,	&outer_ipv6_frag_tmplt},
@@ -553,6 +614,13 @@ static struct iavf_pattern_match_item iavf_hash_pattern_list[] = {
 	{iavf_pattern_eth_ipv6_gre_ipv6_tcp,	IAVF_RSS_TYPE_INNER_IPV6_TCP, &inner_ipv6_tcp_tmplt},
 	{iavf_pattern_eth_ipv4_gre_ipv6_udp,	IAVF_RSS_TYPE_INNER_IPV6_UDP, &inner_ipv6_udp_tmplt},
 	{iavf_pattern_eth_ipv6_gre_ipv6_udp,	IAVF_RSS_TYPE_INNER_IPV6_UDP, &inner_ipv6_udp_tmplt},
+	{iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6,	IAVF_RSS_TYPE_INNER_IPV6,	&udp_l2tpv2_ppp_ipv6_tmplt},
+	{iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6_udp,	IAVF_RSS_TYPE_INNER_IPV6_UDP,	&udp_l2tpv2_ppp_ipv6_udp_tmplt},
+	{iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6_tcp,	IAVF_RSS_TYPE_INNER_IPV6_TCP,	&udp_l2tpv2_ppp_ipv6_tcp_tmplt},
+	{iavf_pattern_eth_ipv6_udp_l2tpv2_ppp_ipv6,	IAVF_RSS_TYPE_INNER_IPV6,	&udp_l2tpv2_ppp_ipv6_tmplt},
+	{iavf_pattern_eth_ipv6_udp_l2tpv2_ppp_ipv6_udp,	IAVF_RSS_TYPE_INNER_IPV6_UDP,	&udp_l2tpv2_ppp_ipv6_udp_tmplt},
+	{iavf_pattern_eth_ipv6_udp_l2tpv2_ppp_ipv6_tcp,	IAVF_RSS_TYPE_INNER_IPV6_TCP,	&udp_l2tpv2_ppp_ipv6_tcp_tmplt},
+
 };
 
 static struct iavf_flow_engine iavf_hash_engine = {
@@ -687,13 +755,17 @@ iavf_hash_parse_pattern(const struct rte_flow_item pattern[], uint64_t *phint,
 
 		switch (item->type) {
 		case RTE_FLOW_ITEM_TYPE_IPV4:
-			if (!(*phint & IAVF_PHINT_GTPU_MSK) && !(*phint & IAVF_PHINT_GRE))
+			if (!(*phint & IAVF_PHINT_GTPU_MSK) &&
+			    !(*phint & IAVF_PHINT_GRE) &&
+			    !(*phint & IAVF_PHINT_L2TPV2))
 				*phint |= IAVF_PHINT_OUTER_IPV4;
 			if ((*phint & IAVF_PHINT_GRE) && !(*phint & IAVF_PHINT_GTPU_MSK))
 				*phint |= IAVF_PHINT_MID_IPV4;
 			break;
 		case RTE_FLOW_ITEM_TYPE_IPV6:
-			if (!(*phint & IAVF_PHINT_GTPU_MSK) && !(*phint & IAVF_PHINT_GRE))
+			if (!(*phint & IAVF_PHINT_GTPU_MSK) &&
+			    !(*phint & IAVF_PHINT_GRE) &&
+			    !(*phint & IAVF_PHINT_L2TPV2))
 				*phint |= IAVF_PHINT_OUTER_IPV6;
 			if ((*phint & IAVF_PHINT_GRE) && !(*phint & IAVF_PHINT_GTPU_MSK))
 				*phint |= IAVF_PHINT_MID_IPV6;
@@ -728,6 +800,10 @@ iavf_hash_parse_pattern(const struct rte_flow_item pattern[], uint64_t *phint,
 			break;
 		case RTE_FLOW_ITEM_TYPE_GRE:
 			*phint |= IAVF_PHINT_GRE;
+			break;
+		case RTE_FLOW_ITEM_TYPE_L2TPV2:
+			*phint |= IAVF_PHINT_L2TPV2;
+			break;
 		default:
 			break;
 		}
@@ -1050,12 +1126,40 @@ iavf_refine_proto_hdrs_by_pattern(struct virtchnl_proto_hdrs *proto_hdrs,
 	proto_hdrs->tunnel_level = tun_lvl;
 }
 
+static void
+iavf_refine_proto_hdrs_l2tpv2(struct virtchnl_proto_hdrs *proto_hdrs,
+			      uint64_t phint)
+{
+	struct virtchnl_proto_hdr *hdr1;
+	int i;
+
+	if (!(phint & IAVF_PHINT_L2TPV2))
+		return;
+
+	if (proto_hdrs->tunnel_level == TUNNEL_LEVEL_INNER) {
+		/* shift headers layer */
+		for (i = proto_hdrs->count - 1 + 1; i > 0; i--)
+			proto_hdrs->proto_hdr[i] = proto_hdrs->proto_hdr[i - 1];
+
+		/* adding outer ip header at layer 0 */
+		hdr1 = &proto_hdrs->proto_hdr[0];
+		hdr1->field_selector = 0;
+		proto_hdrs->count++;
+		proto_hdrs->tunnel_level = TUNNEL_LEVEL_OUTER;
+		if (phint & IAVF_PHINT_OUTER_IPV4)
+			VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, IPV4);
+		else if (phint & IAVF_PHINT_OUTER_IPV6)
+			VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, IPV6);
+	}
+}
+
 static void iavf_refine_proto_hdrs(struct virtchnl_proto_hdrs *proto_hdrs,
 				   uint64_t rss_type, uint64_t phint)
 {
 	iavf_refine_proto_hdrs_l234(proto_hdrs, rss_type);
 	iavf_refine_proto_hdrs_by_pattern(proto_hdrs, phint);
 	iavf_refine_proto_hdrs_gtpu(proto_hdrs, rss_type);
+	iavf_refine_proto_hdrs_l2tpv2(proto_hdrs, phint);
 }
 
 static uint64_t invalid_rss_comb[] = {
-- 
2.25.1


  parent reply	other threads:[~2021-10-21 10:50 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-24 15:17 [dpdk-dev] [PATCH 0/4] " Jie Wang
2021-09-24 15:17 ` [dpdk-dev] [PATCH 1/4] net/iavf: support PPPoL2TPv2oUDP over IPv4 " Jie Wang
2021-09-24 15:17 ` [dpdk-dev] [PATCH 2/4] app/testpmd: support PPPoL2TPv2oUDP " Jie Wang
2021-09-24 15:17 ` [dpdk-dev] [PATCH 3/4] ethdev: " Jie Wang
2021-09-30 14:38   ` Ori Kam
2021-10-05 14:42     ` Ferruh Yigit
2021-10-05 15:06       ` Ori Kam
2021-09-24 15:17 ` [dpdk-dev] [PATCH 4/4] net/iavf: support PPPoL2TPv2oUDP over IPv6 " Jie Wang
2021-10-12 10:25 ` [dpdk-dev] [PATCH v2 0/3] support PPPoL2TPv2oUDP " Jie Wang
2021-10-12 10:25   ` [dpdk-dev] [PATCH v2 1/3] net/iavf: " Jie Wang
2021-10-12 10:25   ` [dpdk-dev] [PATCH v2 2/3] app/testpmd: " Jie Wang
2021-10-12 15:31     ` Ori Kam
2021-10-13  8:15       ` Wang, Jie1X
2021-10-13  9:15         ` Ori Kam
2021-10-13  9:54           ` Wang, Jie1X
2021-10-13 10:19             ` Ori Kam
2021-10-12 10:25   ` [dpdk-dev] [PATCH v2 3/3] ethdev: " Jie Wang
2021-10-12 15:28     ` Ori Kam
2021-10-15  9:58   ` [dpdk-dev] [PATCH v3 0/3] " Jie Wang
2021-10-15  9:58     ` [dpdk-dev] [PATCH v3 1/3] ethdev: support PPP and L2TPV2 procotol Jie Wang
2021-10-15 11:10       ` Ferruh Yigit
2021-10-17  8:12         ` Ori Kam
2021-10-17  8:19       ` Ori Kam
2021-10-15  9:58     ` [dpdk-dev] [PATCH v3 2/3] net/iavf: support PPPoL2TPv2oUDP RSS Hash Jie Wang
2021-10-15  9:58     ` [dpdk-dev] [PATCH v3 3/3] app/testpmd: support L2TPV2 and PPP protocol pattern Jie Wang
2021-10-17  8:51       ` Ori Kam
2021-10-18  9:33     ` [dpdk-dev] [PATCH v4 0/3] support PPPoL2TPv2oUDP RSS Hash Jie Wang
2021-10-18  9:33       ` [dpdk-dev] [PATCH v4 1/3] ethdev: support PPP and L2TPV2 procotol Jie Wang
2021-10-18 10:56         ` Ori Kam
2021-10-18 12:39           ` Zhang, Qi Z
2021-10-18  9:33       ` [dpdk-dev] [PATCH v4 2/3] net/iavf: support PPPoL2TPv2oUDP RSS Hash Jie Wang
2021-10-18  9:33       ` [dpdk-dev] [PATCH v4 3/3] app/testpmd: support L2TPV2 and PPP protocol pattern Jie Wang
2021-10-18 11:03         ` Ori Kam
2021-10-18 12:41           ` Zhang, Qi Z
2021-10-19  3:08       ` [dpdk-dev] [PATCH v5 0/3] support PPPoL2TPv2oUDP RSS Hash Jie Wang
2021-10-19  3:08         ` [dpdk-dev] [PATCH v5 1/3] ethdev: support PPP and L2TPV2 procotol Jie Wang
2021-10-19  6:17           ` Ori Kam
2021-10-19 10:30           ` Ferruh Yigit
2021-10-19  3:08         ` [dpdk-dev] [PATCH v5 2/3] net/iavf: support PPPoL2TPv2oUDP RSS Hash Jie Wang
2021-10-20  1:57           ` Xing, Beilei
2021-10-19  3:08         ` [dpdk-dev] [PATCH v5 3/3] app/testpmd: support L2TPV2 and PPP protocol pattern Jie Wang
2021-10-19  9:41           ` Ferruh Yigit
2021-10-20  9:32         ` [dpdk-dev] [PATCH v6 0/3] support PPPoL2TPv2oUDP RSS Hash Jie Wang
2021-10-20  9:32           ` [dpdk-dev] [PATCH v6 1/3] ethdev: support PPP and L2TPV2 procotol Jie Wang
2021-10-20  9:53             ` Andrew Rybchenko
2021-10-20  9:32           ` [dpdk-dev] [PATCH v6 2/3] net/iavf: support PPPoL2TPv2oUDP RSS Hash Jie Wang
2021-10-21  2:07             ` Xing, Beilei
2021-10-20  9:32           ` [dpdk-dev] [PATCH v6 3/3] app/testpmd: support L2TPV2 and PPP protocol pattern Jie Wang
2021-10-21  6:26           ` [dpdk-dev] [PATCH v7 0/3] support PPPoL2TPv2oUDP RSS Hash Jie Wang
2021-10-21  6:26             ` [dpdk-dev] [PATCH v7 1/3] ethdev: support L2TPv2 and PPP procotol Jie Wang
2021-10-21  7:50               ` Ori Kam
2021-10-21  7:52                 ` Andrew Rybchenko
2021-10-21  8:28                   ` Wang, Jie1X
2021-10-21  8:30                     ` Andrew Rybchenko
2021-10-21  8:41                 ` Wang, Jie1X
2021-10-21 13:18                   ` Ori Kam
2021-10-21  9:26                 ` Ferruh Yigit
2021-10-21  9:29               ` Ferruh Yigit
2021-10-21  6:26             ` [dpdk-dev] [PATCH v7 2/3] net/iavf: support PPPoL2TPv2oUDP RSS Hash Jie Wang
2021-10-21  6:26             ` [dpdk-dev] [PATCH v7 3/3] app/testpmd: support L2TPv2 and PPP protocol pattern Jie Wang
2021-10-21 10:05             ` [dpdk-dev] [PATCH v8 0/3] support PPPoL2TPv2oUDP RSS Hash Jie Wang
2021-10-21 10:05               ` [dpdk-dev] [PATCH v8 1/3] ethdev: support L2TPv2 and PPP procotol Jie Wang
2021-10-21 10:13                 ` Andrew Rybchenko
2021-10-21 10:05               ` [dpdk-dev] [PATCH v8 2/3] net/iavf: support PPPoL2TPv2oUDP RSS Hash Jie Wang
2021-10-21 10:05               ` [dpdk-dev] [PATCH v8 3/3] app/testpmd: support L2TPv2 and PPP protocol pattern Jie Wang
2021-10-21 10:49               ` [dpdk-dev] [PATCH v9 0/3] support PPPoL2TPv2oUDP RSS Hash Jie Wang
2021-10-21 10:49                 ` [dpdk-dev] [PATCH v9 1/3] ethdev: support L2TPv2 and PPP procotol Jie Wang
2021-10-21 12:16                   ` Ferruh Yigit
2021-10-21 10:49                 ` Jie Wang [this message]
2021-10-21 10:49                 ` [dpdk-dev] [PATCH v9 3/3] app/testpmd: support L2TPv2 and PPP protocol pattern Jie Wang
2021-10-21 12:17                 ` [dpdk-dev] [PATCH v9 0/3] support PPPoL2TPv2oUDP RSS Hash Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211021104924.1586172-3-jie1x.wang@intel.com \
    --to=jie1x.wang@intel.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=jingjing.wu@intel.com \
    --cc=orika@nvidia.com \
    --cc=qi.z.zhang@intel.com \
    --cc=stevex.yang@intel.com \
    --cc=thomas@monjalon.net \
    --cc=wenjun1.wu@intel.com \
    --cc=xiaoyun.li@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).