Skip to contentSkip to conversation

support L2TPv2 for AVF RSS hash and FDIR

PATCH Superseded Jie Wang 5 participants 41 messages Jan 29, 2022 – Feb 11, 2022 Network drivers

lore
Share & tools
lore

Jie Wang

author
#0 lore raw

v3 cover support L2TPv2 for AVF RSS hash and FDIR

Support IAVF L2TPv2(include PPP over L2tpv2) RSS hash and flow director. Required to distribute packets based on outer MAC src address and L2TPv2 session ID.

Support IAVF PPPoL2TPv2oUDP flow director. Required to distribute packets based on inner IP src+dest address and TCP/UDP src+dest port.

---
v3:
* update new macros in ethdev.
* update commit log.
* rebase the main branch code.
v2:
* upadte release notes.
* add comment for RTE_ETH_RSS_L2TPV2.
* update ipv6 l2tpv2 flow item.
* rebase the main branch code.

Jie Wang (6):
ethdev: add L2TPv2 RSS offload type
net: fix L2TPv2 common header
app/testpmd: add 6 types of L2TPv2 message
common/iavf: add session ID fields for L2TPv2
net/iavf: support L2TPv2 for AVF HASH
net/iavf: support L2TPv2 for AVF FDIR

 app/test-pmd/cmdline.c                 |  10 +-
 app/test-pmd/cmdline_flow.c            | 313 +++++++++++++++++++++----
 app/test-pmd/config.c                  |   3 +-
 doc/guides/rel_notes/release_22_03.rst |  15 ++
 drivers/common/iavf/virtchnl.h         |   4 +
 drivers/net/iavf/iavf.h                |   2 +
 drivers/net/iavf/iavf_fdir.c           | 174 +++++++++++---
 drivers/net/iavf/iavf_generic_flow.c   |  34 +++
 drivers/net/iavf/iavf_generic_flow.h   |  10 +
 drivers/net/iavf/iavf_hash.c           |  83 ++++++-
 lib/ethdev/rte_ethdev.h                |   7 +
 lib/net/rte_l2tpv2.h                   |  33 ++-
 12 files changed, 590 insertions(+), 98 deletions(-)
Signature · 1 line
2.25.1
author
#1 lore raw

PATCH v3 1/6 ethdev: add L2TPv2 RSS offload type

This patch defines new RSS offload type for L2TPv2, which is required when users want to distribute packets based on the L2TPv2 session ID field.

---
 app/test-pmd/cmdline.c                 | 10 ++++++----
 app/test-pmd/config.c                  |  3 ++-
 doc/guides/rel_notes/release_22_03.rst |  5 +++++
 lib/ethdev/rte_ethdev.h                |  7 +++++++
 4 files changed, 20 insertions(+), 5 deletions(-)
app/test-pmd/cmdline.c +6 -4
index e626b1c7d9..d535311f21 100644
@@ -2178,7 +2178,7 @@ cmd_config_rss_parsed(void *parsed_result,
 			RTE_ETH_RSS_TCP | RTE_ETH_RSS_UDP | RTE_ETH_RSS_SCTP |
 			RTE_ETH_RSS_L2_PAYLOAD | RTE_ETH_RSS_L2TPV3 | RTE_ETH_RSS_ESP |
 			RTE_ETH_RSS_AH | RTE_ETH_RSS_PFCP | RTE_ETH_RSS_GTPU |
-			RTE_ETH_RSS_ECPRI;
+			RTE_ETH_RSS_ECPRI | RTE_ETH_RSS_L2TPV2;
 	else if (!strcmp(res->value, "eth"))
 		rss_conf.rss_hf = RTE_ETH_RSS_ETH;
 	else if (!strcmp(res->value, "vlan"))
@@ -2256,6 +2256,8 @@ cmd_config_rss_parsed(void *parsed_result,
 		rss_conf.rss_hf = (rss_hf | RTE_ETH_RSS_LEVEL_INNERMOST);
 	} else if (!strcmp(res->value, "default"))
 		use_default = 1;
+	else if (!strcmp(res->value, "l2tpv2"))
+		rss_conf.rss_hf = RTE_ETH_RSS_L2TPV2;
 	else if (isdigit(res->value[0]) && atoi(res->value) > 0 &&
 						atoi(res->value) < 64)
 		rss_conf.rss_hf = 1ULL << atoi(res->value);
@@ -2314,7 +2316,7 @@ cmdline_parse_inst_t cmd_config_rss = {
 	.help_str = "port config all rss "
 		"all|default|eth|vlan|ip|tcp|udp|sctp|ether|port|vxlan|geneve|"
 		"nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|ecpri|mpls|none|level-default|"
-		"level-outer|level-inner|ipv4-chksum|<flowtype_id>",
+		"level-outer|level-inner|ipv4-chksum|l2tpv2|<flowtype_id>",
 	.tokens = {
 		(void *)&cmd_config_rss_port,
 		(void *)&cmd_config_rss_keyword,
@@ -2429,7 +2431,7 @@ cmdline_parse_token_string_t cmd_config_rss_hash_key_rss_type =
 				 "ipv6-tcp-ex#ipv6-udp-ex#"
 				 "l3-src-only#l3-dst-only#l4-src-only#l4-dst-only#"
 				 "l2-src-only#l2-dst-only#s-vlan#c-vlan#"
-				 "l2tpv3#esp#ah#pfcp#pppoe#gtpu#ecpri#mpls");
+				 "l2tpv3#esp#ah#pfcp#pppoe#gtpu#ecpri#mpls#l2tpv2");
 cmdline_parse_token_string_t cmd_config_rss_hash_key_value =
 	TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_key, key, NULL);
 
@@ -2442,7 +2444,7 @@ cmdline_parse_inst_t cmd_config_rss_hash_key = {
 		"l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex|"
 		"l3-src-only|l3-dst-only|l4-src-only|l4-dst-only|"
 		"l2-src-only|l2-dst-only|s-vlan|c-vlan|"
-		"l2tpv3|esp|ah|pfcp|pppoe|gtpu|ecpri|mpls "
+		"l2tpv3|esp|ah|pfcp|pppoe|gtpu|ecpri|mpls|l2tpv2 "
 		"<string of hex digits (variable length, NIC dependent)>",
 	.tokens = {
 		(void *)&cmd_config_rss_hash_key_port,
app/test-pmd/config.c +2 -1
index 1722d6c8f8..ec922bd304 100644
@@ -90,7 +90,7 @@ const struct rss_type_info rss_type_table[] = {
 	{ "all", RTE_ETH_RSS_ETH | RTE_ETH_RSS_VLAN | RTE_ETH_RSS_IP | RTE_ETH_RSS_TCP |
 		RTE_ETH_RSS_UDP | RTE_ETH_RSS_SCTP | RTE_ETH_RSS_L2_PAYLOAD |
 		RTE_ETH_RSS_L2TPV3 | RTE_ETH_RSS_ESP | RTE_ETH_RSS_AH | RTE_ETH_RSS_PFCP |
-		RTE_ETH_RSS_GTPU | RTE_ETH_RSS_ECPRI | RTE_ETH_RSS_MPLS},
+		RTE_ETH_RSS_GTPU | RTE_ETH_RSS_ECPRI | RTE_ETH_RSS_MPLS | RTE_ETH_RSS_L2TPV2},
 	{ "none", 0 },
 	{ "eth", RTE_ETH_RSS_ETH },
 	{ "l2-src-only", RTE_ETH_RSS_L2_SRC_ONLY },
@@ -143,6 +143,7 @@ const struct rss_type_info rss_type_table[] = {
 	{ "mpls", RTE_ETH_RSS_MPLS },
 	{ "ipv4-chksum", RTE_ETH_RSS_IPV4_CHKSUM },
 	{ "l4-chksum", RTE_ETH_RSS_L4_CHKSUM },
+	{ "l2tpv2", RTE_ETH_RSS_L2TPV2 },
 	{ NULL, 0 },
 };
 
doc/guides/rel_notes/release_22_03.rst +5 -0
index 33be3241b9..9a507ab9ea 100644
@@ -55,6 +55,11 @@ New Features
      Also, make sure to start the actual text at the margin.
      =======================================================
 
+* **Added new RSS offload types for L2TPv2 in RSS flow.**
+
+  Added macro RTE_ETH_RSS_L2TPV2, now L2TPv2 session ID field can be used as
+  input set for RSS.
+
 * **Updated Cisco enic driver.**
 
   * Added rte_flow support for matching GENEVE packets.
lib/ethdev/rte_ethdev.h +7 -0
index 147cc1ced3..29e6091bc8 100644
@@ -651,6 +651,13 @@ struct rte_eth_rss_conf {
 #define RTE_ETH_RSS_L4_CHKSUM          RTE_BIT64(35)
 #define ETH_RSS_L4_CHKSUM RTE_DEPRECATED(ETH_RSS_L4_CHKSUM) RTE_ETH_RSS_L4_CHKSUM
 
+/*
+ * Below macro is defined for RSS offload type, it can be used to
+ * fill rte_eth_rss_conf.rss_hf or rte_flow_action_rss.types.
+ */
+#define RTE_ETH_RSS_L2TPV2            RTE_BIT64(36)
+#define ETH_RSS_L2TPV2                RTE_ETH_RSS_L2TPV2
+
 /*
  * We use the following macros to combine with above RTE_ETH_RSS_* for
  * more specific input set selection. These bits are defined starting
Signature · 1 line
2.25.1
Acked-by on v3 1/6
#2 lore raw

RE: [PATCH v3 1/6] ethdev: add L2TPv2 RSS offload type

Hi Jie,

Quoted 124 lines

-----Original Message-----
From: Jie Wang <[email protected]>
Sent: Saturday, January 29, 2022 8:24 AM
Subject: [PATCH v3 1/6] ethdev: add L2TPv2 RSS offload type

This patch defines new RSS offload type for L2TPv2, which is required when users want to distribute packets based on the L2TPv2 session ID field.

---
 app/test-pmd/cmdline.c                 | 10 ++++++----
 app/test-pmd/config.c                  |  3 ++-
 doc/guides/rel_notes/release_22_03.rst |  5 +++++
 lib/ethdev/rte_ethdev.h                |  7 +++++++
 4 files changed, 20 insertions(+), 5 deletions(-)
app/test-pmd/cmdline.c +6 -4
index e626b1c7d9..d535311f21 100644
@@ -2178,7 +2178,7 @@ cmd_config_rss_parsed(void *parsed_result,
 			RTE_ETH_RSS_TCP | RTE_ETH_RSS_UDP | RTE_ETH_RSS_SCTP |
 			RTE_ETH_RSS_L2_PAYLOAD | RTE_ETH_RSS_L2TPV3 | RTE_ETH_RSS_ESP |
 			RTE_ETH_RSS_AH | RTE_ETH_RSS_PFCP | RTE_ETH_RSS_GTPU |
-			RTE_ETH_RSS_ECPRI;
+			RTE_ETH_RSS_ECPRI | RTE_ETH_RSS_L2TPV2;
 	else if (!strcmp(res->value, "eth"))
 		rss_conf.rss_hf = RTE_ETH_RSS_ETH;
 	else if (!strcmp(res->value, "vlan"))
@@ -2256,6 +2256,8 @@ cmd_config_rss_parsed(void *parsed_result,
 		rss_conf.rss_hf = (rss_hf | RTE_ETH_RSS_LEVEL_INNERMOST);
 	} else if (!strcmp(res->value, "default"))
 		use_default = 1;
+	else if (!strcmp(res->value, "l2tpv2"))
+		rss_conf.rss_hf = RTE_ETH_RSS_L2TPV2;
 	else if (isdigit(res->value[0]) && atoi(res->value) > 0 &&
 						atoi(res->value) < 64)
 		rss_conf.rss_hf = 1ULL << atoi(res->value);
@@ -2314,7 +2316,7 @@ cmdline_parse_inst_t cmd_config_rss = {
 	.help_str = "port config all rss "
 		"all|default|eth|vlan|ip|tcp|udp|sctp|ether|port|vxlan|geneve|"
 		"nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|ecpri|mpls|none|level-default|"
-		"level-outer|level-inner|ipv4-chksum|<flowtype_id>",
+		"level-outer|level-inner|ipv4-chksum|l2tpv2|<flowtype_id>",
 	.tokens = {
 		(void *)&cmd_config_rss_port,
 		(void *)&cmd_config_rss_keyword,
@@ -2429,7 +2431,7 @@ cmdline_parse_token_string_t cmd_config_rss_hash_key_rss_type =
 				 "ipv6-tcp-ex#ipv6-udp-ex#"
 				 "l3-src-only#l3-dst-only#l4-src-only#l4-dst-only#"
 				 "l2-src-only#l2-dst-only#s-vlan#c-vlan#"
-				 "l2tpv3#esp#ah#pfcp#pppoe#gtpu#ecpri#mpls");
+				 "l2tpv3#esp#ah#pfcp#pppoe#gtpu#ecpri#mpls#l2tpv2");
 cmdline_parse_token_string_t cmd_config_rss_hash_key_value =
 	TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_key, key, NULL);
 
@@ -2442,7 +2444,7 @@ cmdline_parse_inst_t cmd_config_rss_hash_key = {
 		"l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex|"
 		"l3-src-only|l3-dst-only|l4-src-only|l4-dst-only|"
 		"l2-src-only|l2-dst-only|s-vlan|c-vlan|"
-		"l2tpv3|esp|ah|pfcp|pppoe|gtpu|ecpri|mpls "
+		"l2tpv3|esp|ah|pfcp|pppoe|gtpu|ecpri|mpls|l2tpv2 "
 		"<string of hex digits (variable length, NIC dependent)>",
 	.tokens = {
 		(void *)&cmd_config_rss_hash_key_port,
app/test-pmd/config.c +0 -0
index 1722d6c8f8..ec922bd304 100644
@@ -90,7 +90,7 @@ const struct rss_type_info rss_type_table[] = {
 	{ "all", RTE_ETH_RSS_ETH | RTE_ETH_RSS_VLAN | RTE_ETH_RSS_IP | RTE_ETH_RSS_TCP |
 		RTE_ETH_RSS_UDP | RTE_ETH_RSS_SCTP | RTE_ETH_RSS_L2_PAYLOAD |
 		RTE_ETH_RSS_L2TPV3 | RTE_ETH_RSS_ESP | RTE_ETH_RSS_AH | RTE_ETH_RSS_PFCP

|

app/test-pmd/config.c +1 -1
-		RTE_ETH_RSS_GTPU | RTE_ETH_RSS_ECPRI | RTE_ETH_RSS_MPLS},
+		RTE_ETH_RSS_GTPU | RTE_ETH_RSS_ECPRI | RTE_ETH_RSS_MPLS |

RTE_ETH_RSS_L2TPV2},

app/test-pmd/config.c +1 -0
 	{ "none", 0 },
 	{ "eth", RTE_ETH_RSS_ETH },
 	{ "l2-src-only", RTE_ETH_RSS_L2_SRC_ONLY },
@@ -143,6 +143,7 @@ const struct rss_type_info rss_type_table[] = {
 	{ "mpls", RTE_ETH_RSS_MPLS },
 	{ "ipv4-chksum", RTE_ETH_RSS_IPV4_CHKSUM },
 	{ "l4-chksum", RTE_ETH_RSS_L4_CHKSUM },
+	{ "l2tpv2", RTE_ETH_RSS_L2TPV2 },
 	{ NULL, 0 },
 };
 
doc/guides/rel_notes/release_22_03.rst +5 -0
index 33be3241b9..9a507ab9ea 100644
@@ -55,6 +55,11 @@ New Features
      Also, make sure to start the actual text at the margin.
      =======================================================
 
+* **Added new RSS offload types for L2TPv2 in RSS flow.**
+
+  Added macro RTE_ETH_RSS_L2TPV2, now L2TPv2 session ID field can be used as
+  input set for RSS.
+
 * **Updated Cisco enic driver.**
 
   * Added rte_flow support for matching GENEVE packets.
lib/ethdev/rte_ethdev.h +7 -1
index 147cc1ced3..29e6091bc8 100644
@@ -651,6 +651,13 @@ struct rte_eth_rss_conf {
 #define RTE_ETH_RSS_L4_CHKSUM          RTE_BIT64(35)
 #define ETH_RSS_L4_CHKSUM RTE_DEPRECATED(ETH_RSS_L4_CHKSUM) RTE_ETH_RSS_L4_CHKSUM
 
+/*
+ * Below macro is defined for RSS offload type, it can be used to
+ * fill rte_eth_rss_conf.rss_hf or rte_flow_action_rss.types.
+ */
+#define RTE_ETH_RSS_L2TPV2            RTE_BIT64(36)
+#define ETH_RSS_L2TPV2                RTE_ETH_RSS_L2TPV2
+
 /*
  * We use the following macros to combine with above RTE_ETH_RSS_* for
  * more specific input set selection. These bits are defined starting
--
Quoted 1 line

2.25.1

Best,
Ori

#3 lore raw

Re: [PATCH v3 1/6] ethdev: add L2TPv2 RSS offload type

In reply to Jie Wang
Quoted 5 lines · Jie Wang
lib/ethdev/rte_ethdev.h +0 -0
index 147cc1ced3..29e6091bc8 100644

lib/ethdev/rte_ethdev.h struct rte_eth_rss_conf { · line 659

Quoted 9 lines
lib/ethdev/rte_ethdev.h +6 -0
@@ -651,6 +651,13 @@ struct rte_eth_rss_conf {
  #define RTE_ETH_RSS_L4_CHKSUM          RTE_BIT64(35)
  #define ETH_RSS_L4_CHKSUM RTE_DEPRECATED(ETH_RSS_L4_CHKSUM) RTE_ETH_RSS_L4_CHKSUM
 
+/*
+ * Below macro is defined for RSS offload type, it can be used to
+ * fill rte_eth_rss_conf.rss_hf or rte_flow_action_rss.types.
+ */
+#define RTE_ETH_RSS_L2TPV2            RTE_BIT64(36)
+#define ETH_RSS_L2TPV2                RTE_ETH_RSS_L2TPV2

Perhaps I wasn't clear, don't have 'ETH_RSS_L2TPV2' at all.

Old macros were missing 'RTE_' prefix, so new ones added with prefix, and old ones marked as deprecated.
When you are adding a new macro that already starts with 'RTE_' prefix no need to add old/deprecated style of macro.

Please keep existing acks in next version of the patch.

author
#4 lore raw

PATCH v3 2/6 net: fix L2TPv2 common header

In reply to Jie Wang

The fields of L2TPv2 common header were reversed in big endian and little endian.

This patch fixes this error to ensure L2TPv2 can be parsed correctly.

Fixes 3a929df1f286 ("ethdev: support L2TPv2 and PPP procotol")
---
 lib/net/rte_l2tpv2.h | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
lib/net/rte_l2tpv2.h +10 -10
index 938a993b48..1f3ad3f03c 100644
@@ -89,16 +89,6 @@ struct rte_l2tpv2_common_hdr {
 		__extension__
 		struct {
 #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
-			uint16_t t:1;		/**< message Type */
-			uint16_t l:1;		/**< length option bit */
-			uint16_t res1:2;	/**< reserved */
-			uint16_t s:1;		/**< ns/nr option bit */
-			uint16_t res2:1;	/**< reserved */
-			uint16_t o:1;		/**< offset option bit */
-			uint16_t p:1;		/**< priority option bit */
-			uint16_t res3:4;	/**< reserved */
-			uint16_t ver:4;		/**< protocol version */
-#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
 			uint16_t ver:4;		/**< protocol version */
 			uint16_t res3:4;	/**< reserved */
 			uint16_t p:1;		/**< priority option bit */
@@ -108,6 +98,16 @@ struct rte_l2tpv2_common_hdr {
 			uint16_t res1:2;	/**< reserved */
 			uint16_t l:1;		/**< length option bit */
 			uint16_t t:1;		/**< message Type */
+#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
+			uint16_t t:1;		/**< message Type */
+			uint16_t l:1;		/**< length option bit */
+			uint16_t res1:2;	/**< reserved */
+			uint16_t s:1;		/**< ns/nr option bit */
+			uint16_t res2:1;	/**< reserved */
+			uint16_t o:1;		/**< offset option bit */
+			uint16_t p:1;		/**< priority option bit */
+			uint16_t res3:4;	/**< reserved */
+			uint16_t ver:4;		/**< protocol version */
 #endif
 		};
 	};
Signature · 1 line
2.25.1
Acked-by on v3 2/6
#5 lore raw

RE: [PATCH v3 2/6] net: fix L2TPv2 common header

Quoted 64 lines

-----Original Message-----
From: Jie Wang <[email protected]>
Sent: Saturday, January 29, 2022 8:25 AM
To: [email protected]
Cc: [email protected]; Ori Kam <[email protected]>; [email protected]; [email protected]; NBU-Contact-Thomas Monjalon (EXTERNAL) <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Jie Wang <[email protected]>; [email protected]
Subject: [PATCH v3 2/6] net: fix L2TPv2 common header

The fields of L2TPv2 common header were reversed in big endian and little endian.

This patch fixes this error to ensure L2TPv2 can be parsed correctly.

Fixes 3a929df1f286 ("ethdev: support L2TPv2 and PPP procotol")
---
 lib/net/rte_l2tpv2.h | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
lib/net/rte_l2tpv2.h +10 -11
index 938a993b48..1f3ad3f03c 100644
@@ -89,16 +89,6 @@ struct rte_l2tpv2_common_hdr {
 		__extension__
 		struct {
 #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
-			uint16_t t:1;		/**< message Type */
-			uint16_t l:1;		/**< length option bit */
-			uint16_t res1:2;	/**< reserved */
-			uint16_t s:1;		/**< ns/nr option bit */
-			uint16_t res2:1;	/**< reserved */
-			uint16_t o:1;		/**< offset option bit */
-			uint16_t p:1;		/**< priority option bit */
-			uint16_t res3:4;	/**< reserved */
-			uint16_t ver:4;		/**< protocol version */
-#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
 			uint16_t ver:4;		/**< protocol version */
 			uint16_t res3:4;	/**< reserved */
 			uint16_t p:1;		/**< priority option bit */
@@ -108,6 +98,16 @@ struct rte_l2tpv2_common_hdr {
 			uint16_t res1:2;	/**< reserved */
 			uint16_t l:1;		/**< length option bit */
 			uint16_t t:1;		/**< message Type */
+#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
+			uint16_t t:1;		/**< message Type */
+			uint16_t l:1;		/**< length option bit */
+			uint16_t res1:2;	/**< reserved */
+			uint16_t s:1;		/**< ns/nr option bit */
+			uint16_t res2:1;	/**< reserved */
+			uint16_t o:1;		/**< offset option bit */
+			uint16_t p:1;		/**< priority option bit */
+			uint16_t res3:4;	/**< reserved */
+			uint16_t ver:4;		/**< protocol version */
 #endif
 		};
 	};
--
Quoted 1 line

2.25.1

Best,
Ori

Acked-by
#6 lore raw

Re: [PATCH v3 2/6] net: fix L2TPv2 common header

Quoted 59 lines · Ori Kam
Quoted 59 lines

-----Original Message-----
From: Jie Wang <[email protected]>
Sent: Saturday, January 29, 2022 8:25 AM
To: [email protected]
Cc: [email protected]; Ori Kam <[email protected]>; [email protected]; [email protected]; NBU-Contact-Thomas Monjalon (EXTERNAL) <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Jie Wang <[email protected]>; [email protected]
Subject: [PATCH v3 2/6] net: fix L2TPv2 common header

The fields of L2TPv2 common header were reversed in big endian and little endian.

This patch fixes this error to ensure L2TPv2 can be parsed correctly.

Fixes 3a929df1f286 ("ethdev: support L2TPv2 and PPP procotol")
---
  lib/net/rte_l2tpv2.h | 20 ++++++++++----------
  1 file changed, 10 insertions(+), 10 deletions(-)
lib/net/rte_l2tpv2.h +9 -10
index 938a993b48..1f3ad3f03c 100644
@@ -89,16 +89,6 @@ struct rte_l2tpv2_common_hdr {
  		__extension__
  		struct {
  #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
-			uint16_t t:1;		/**< message Type */
-			uint16_t l:1;		/**< length option bit */
-			uint16_t res1:2;	/**< reserved */
-			uint16_t s:1;		/**< ns/nr option bit */
-			uint16_t res2:1;	/**< reserved */
-			uint16_t o:1;		/**< offset option bit */
-			uint16_t p:1;		/**< priority option bit */
-			uint16_t res3:4;	/**< reserved */
-			uint16_t ver:4;		/**< protocol version */
-#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
  			uint16_t ver:4;		/**< protocol version */
  			uint16_t res3:4;	/**< reserved */
  			uint16_t p:1;		/**< priority option bit */
@@ -108,6 +98,16 @@ struct rte_l2tpv2_common_hdr {
  			uint16_t res1:2;	/**< reserved */
  			uint16_t l:1;		/**< length option bit */
  			uint16_t t:1;		/**< message Type */
+#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
+			uint16_t t:1;		/**< message Type */
+			uint16_t l:1;		/**< length option bit */
+			uint16_t res1:2;	/**< reserved */
+			uint16_t s:1;		/**< ns/nr option bit */
+			uint16_t res2:1;	/**< reserved */
+			uint16_t o:1;		/**< offset option bit */
+			uint16_t p:1;		/**< priority option bit */
+			uint16_t res3:4;	/**< reserved */
Quoted 9 lines
Quoted 6 lines
lib/net/rte_l2tpv2.h +1 -1
+			uint16_t ver:4;		/**< protocol version */
  #endif
  		};
  	};
--

2.25.1

What do you think putting the link of the related RFC in the commit log for reference: https://datatracker.ietf.org/doc/html/rfc2661#section-3.1

author
#7 lore raw

PATCH v3 3/6 app/testpmd: add 6 types of L2TPv2 message

In reply to Jie Wang

This patch adds L2TPv2 control message and 5 types of data message support for testpmd.

The added L2TPv2 message types are listed below:
1. L2TPv2 control
2. L2TPv2
3. L2TPv2 + length option
4. L2TPv2 + sequence option
5. L2TPv2 + offset option
6. L2TPv2 + length option + sequence option

---
 app/test-pmd/cmdline_flow.c | 313 ++++++++++++++++++++++++++++++------
 lib/net/rte_l2tpv2.h        |  13 ++
 2 files changed, 275 insertions(+), 51 deletions(-)
app/test-pmd/cmdline_flow.c +262 -51
index bbaf18d76e..4e2ed3d6a3 100644
@@ -322,13 +322,30 @@ enum index {
 	ITEM_FLEX_ITEM_HANDLE,
 	ITEM_FLEX_PATTERN_HANDLE,
 	ITEM_L2TPV2,
-	ITEM_L2TPV2_COMMON,
-	ITEM_L2TPV2_COMMON_TYPE,
-	ITEM_L2TPV2_COMMON_TYPE_DATA_L,
-	ITEM_L2TPV2_COMMON_TYPE_CTRL,
+	ITEM_L2TPV2_TYPE,
+	ITEM_L2TPV2_TYPE_DATA,
+	ITEM_L2TPV2_TYPE_DATA_L,
+	ITEM_L2TPV2_TYPE_DATA_S,
+	ITEM_L2TPV2_TYPE_DATA_O,
+	ITEM_L2TPV2_TYPE_DATA_L_S,
+	ITEM_L2TPV2_TYPE_CTRL,
+	ITEM_L2TPV2_MSG_DATA_TUNNEL_ID,
+	ITEM_L2TPV2_MSG_DATA_SESSION_ID,
 	ITEM_L2TPV2_MSG_DATA_L_LENGTH,
 	ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID,
 	ITEM_L2TPV2_MSG_DATA_L_SESSION_ID,
+	ITEM_L2TPV2_MSG_DATA_S_TUNNEL_ID,
+	ITEM_L2TPV2_MSG_DATA_S_SESSION_ID,
+	ITEM_L2TPV2_MSG_DATA_S_NS,
+	ITEM_L2TPV2_MSG_DATA_S_NR,
+	ITEM_L2TPV2_MSG_DATA_O_TUNNEL_ID,
+	ITEM_L2TPV2_MSG_DATA_O_SESSION_ID,
+	ITEM_L2TPV2_MSG_DATA_O_OFFSET,
+	ITEM_L2TPV2_MSG_DATA_L_S_LENGTH,
+	ITEM_L2TPV2_MSG_DATA_L_S_TUNNEL_ID,
+	ITEM_L2TPV2_MSG_DATA_L_S_SESSION_ID,
+	ITEM_L2TPV2_MSG_DATA_L_S_NS,
+	ITEM_L2TPV2_MSG_DATA_L_S_NR,
 	ITEM_L2TPV2_MSG_CTRL_LENGTH,
 	ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID,
 	ITEM_L2TPV2_MSG_CTRL_SESSION_ID,
@@ -1449,19 +1466,70 @@ static const enum index item_flex[] = {
 };
 
 static const enum index item_l2tpv2[] = {
-	ITEM_L2TPV2_COMMON,
+	ITEM_L2TPV2_TYPE,
 	ITEM_NEXT,
 	ZERO,
 };
 
-static const enum index item_l2tpv2_common[] = {
-	ITEM_L2TPV2_COMMON_TYPE,
+static const enum index item_l2tpv2_type[] = {
+	ITEM_L2TPV2_TYPE_DATA,
+	ITEM_L2TPV2_TYPE_DATA_L,
+	ITEM_L2TPV2_TYPE_DATA_S,
+	ITEM_L2TPV2_TYPE_DATA_O,
+	ITEM_L2TPV2_TYPE_DATA_L_S,
+	ITEM_L2TPV2_TYPE_CTRL,
 	ZERO,
 };
 
-static const enum index item_l2tpv2_common_type[] = {
-	ITEM_L2TPV2_COMMON_TYPE_DATA_L,
-	ITEM_L2TPV2_COMMON_TYPE_CTRL,
+static const enum index item_l2tpv2_type_data[] = {
+	ITEM_L2TPV2_MSG_DATA_TUNNEL_ID,
+	ITEM_L2TPV2_MSG_DATA_SESSION_ID,
+	ITEM_NEXT,
+	ZERO,
+};
+
+static const enum index item_l2tpv2_type_data_l[] = {
+	ITEM_L2TPV2_MSG_DATA_L_LENGTH,
+	ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID,
+	ITEM_L2TPV2_MSG_DATA_L_SESSION_ID,
+	ITEM_NEXT,
+	ZERO,
+};
+
+static const enum index item_l2tpv2_type_data_s[] = {
+	ITEM_L2TPV2_MSG_DATA_S_TUNNEL_ID,
+	ITEM_L2TPV2_MSG_DATA_S_SESSION_ID,
+	ITEM_L2TPV2_MSG_DATA_S_NS,
+	ITEM_L2TPV2_MSG_DATA_S_NR,
+	ITEM_NEXT,
+	ZERO,
+};
+
+static const enum index item_l2tpv2_type_data_o[] = {
+	ITEM_L2TPV2_MSG_DATA_O_TUNNEL_ID,
+	ITEM_L2TPV2_MSG_DATA_O_SESSION_ID,
+	ITEM_L2TPV2_MSG_DATA_O_OFFSET,
+	ITEM_NEXT,
+	ZERO,
+};
+
+static const enum index item_l2tpv2_type_data_l_s[] = {
+	ITEM_L2TPV2_MSG_DATA_L_S_LENGTH,
+	ITEM_L2TPV2_MSG_DATA_L_S_TUNNEL_ID,
+	ITEM_L2TPV2_MSG_DATA_L_S_SESSION_ID,
+	ITEM_L2TPV2_MSG_DATA_L_S_NS,
+	ITEM_L2TPV2_MSG_DATA_L_S_NR,
+	ITEM_NEXT,
+	ZERO,
+};
+
+static const enum index item_l2tpv2_type_ctrl[] = {
+	ITEM_L2TPV2_MSG_CTRL_LENGTH,
+	ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID,
+	ITEM_L2TPV2_MSG_CTRL_SESSION_ID,
+	ITEM_L2TPV2_MSG_CTRL_NS,
+	ITEM_L2TPV2_MSG_CTRL_NR,
+	ITEM_NEXT,
 	ZERO,
 };
 
@@ -3843,31 +3911,46 @@ static const struct token token_list[] = {
 		.next = NEXT(item_l2tpv2),
 		.call = parse_vc,
 	},
-	[ITEM_L2TPV2_COMMON] = {
-		.name = "common",
-		.help = "L2TPv2 common header",
-		.next = NEXT(item_l2tpv2_common),
-	},
-	[ITEM_L2TPV2_COMMON_TYPE] = {
+	[ITEM_L2TPV2_TYPE] = {
 		.name = "type",
-		.help = "type of common header",
-		.next = NEXT(item_l2tpv2_common_type),
+		.help = "type of l2tpv2",
+		.next = NEXT(item_l2tpv2_type),
 		.args = ARGS(ARG_ENTRY_HTON(struct rte_flow_item_l2tpv2)),
 	},
-	[ITEM_L2TPV2_COMMON_TYPE_DATA_L] = {
+	[ITEM_L2TPV2_TYPE_DATA] = {
+		.name = "data",
+		.help = "Type #7: data message without any options",
+		.next = NEXT(item_l2tpv2_type_data),
+		.call = parse_vc_item_l2tpv2_type,
+	},
+	[ITEM_L2TPV2_MSG_DATA_TUNNEL_ID] = {
+		.name = "tunnel_id",
+		.help = "tunnel identifier",
+		.next = NEXT(item_l2tpv2_type_data,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type7.tunnel_id)),
+	},
+	[ITEM_L2TPV2_MSG_DATA_SESSION_ID] = {
+		.name = "session_id",
+		.help = "session identifier",
+		.next = NEXT(item_l2tpv2_type_data,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type7.session_id)),
+	},
+	[ITEM_L2TPV2_TYPE_DATA_L] = {
 		.name = "data_l",
 		.help = "Type #6: data message with length option",
-		.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_DATA_L_LENGTH,
-					ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID,
-					ITEM_L2TPV2_MSG_DATA_L_SESSION_ID,
-					ITEM_NEXT)),
+		.next = NEXT(item_l2tpv2_type_data_l),
 		.call = parse_vc_item_l2tpv2_type,
 	},
 	[ITEM_L2TPV2_MSG_DATA_L_LENGTH] = {
 		.name = "length",
 		.help = "message length",
-		.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_DATA_L_LENGTH,
-					ITEM_L2TPV2_COMMON, ITEM_NEXT),
+		.next = NEXT(item_l2tpv2_type_data_l,
 			     NEXT_ENTRY(COMMON_UNSIGNED),
 			     item_param),
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -3876,8 +3959,7 @@ static const struct token token_list[] = {
 	[ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID] = {
 		.name = "tunnel_id",
 		.help = "tunnel identifier",
-		.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID,
-					ITEM_L2TPV2_COMMON, ITEM_NEXT),
+		.next = NEXT(item_l2tpv2_type_data_l,
 			     NEXT_ENTRY(COMMON_UNSIGNED),
 			     item_param),
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -3886,29 +3968,150 @@ static const struct token token_list[] = {
 	[ITEM_L2TPV2_MSG_DATA_L_SESSION_ID] = {
 		.name = "session_id",
 		.help = "session identifier",
-		.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_DATA_L_SESSION_ID,
-					ITEM_L2TPV2_COMMON, ITEM_NEXT),
+		.next = NEXT(item_l2tpv2_type_data_l,
 			     NEXT_ENTRY(COMMON_UNSIGNED),
 			     item_param),
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
 					     hdr.type6.session_id)),
 	},
-	[ITEM_L2TPV2_COMMON_TYPE_CTRL] = {
+	[ITEM_L2TPV2_TYPE_DATA_S] = {
+		.name = "data_s",
+		.help = "Type #5: data message with ns, nr option",
+		.next = NEXT(item_l2tpv2_type_data_s),
+		.call = parse_vc_item_l2tpv2_type,
+	},
+	[ITEM_L2TPV2_MSG_DATA_S_TUNNEL_ID] = {
+		.name = "tunnel_id",
+		.help = "tunnel identifier",
+		.next = NEXT(item_l2tpv2_type_data_s,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type5.tunnel_id)),
+	},
+	[ITEM_L2TPV2_MSG_DATA_S_SESSION_ID] = {
+		.name = "session_id",
+		.help = "session identifier",
+		.next = NEXT(item_l2tpv2_type_data_s,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type5.session_id)),
+	},
+	[ITEM_L2TPV2_MSG_DATA_S_NS] = {
+		.name = "ns",
+		.help = "sequence number for message",
+		.next = NEXT(item_l2tpv2_type_data_s,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type5.ns)),
+	},
+	[ITEM_L2TPV2_MSG_DATA_S_NR] = {
+		.name = "nr",
+		.help = "sequence number for next receive message",
+		.next = NEXT(item_l2tpv2_type_data_s,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type5.nr)),
+	},
+	[ITEM_L2TPV2_TYPE_DATA_O] = {
+		.name = "data_o",
+		.help = "Type #4: data message with offset option",
+		.next = NEXT(item_l2tpv2_type_data_o),
+		.call = parse_vc_item_l2tpv2_type,
+	},
+	[ITEM_L2TPV2_MSG_DATA_O_TUNNEL_ID] = {
+		.name = "tunnel_id",
+		.help = "tunnel identifier",
+		.next = NEXT(item_l2tpv2_type_data_o,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type4.tunnel_id)),
+	},
+	[ITEM_L2TPV2_MSG_DATA_O_SESSION_ID] = {
+		.name = "session_id",
+		.help = "session identifier",
+		.next = NEXT(item_l2tpv2_type_data_o,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type5.session_id)),
+	},
+	[ITEM_L2TPV2_MSG_DATA_O_OFFSET] = {
+		.name = "offset_size",
+		.help = "the size of offset padding",
+		.next = NEXT(item_l2tpv2_type_data_o,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type4.offset_size)),
+	},
+	[ITEM_L2TPV2_TYPE_DATA_L_S] = {
+		.name = "data_l_s",
+		.help = "Type #3: data message contains length, ns, nr "
+			"options",
+		.next = NEXT(item_l2tpv2_type_data_l_s),
+		.call = parse_vc_item_l2tpv2_type,
+	},
+	[ITEM_L2TPV2_MSG_DATA_L_S_LENGTH] = {
+		.name = "length",
+		.help = "message length",
+		.next = NEXT(item_l2tpv2_type_data_l_s,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type3.length)),
+	},
+	[ITEM_L2TPV2_MSG_DATA_L_S_TUNNEL_ID] = {
+		.name = "tunnel_id",
+		.help = "tunnel identifier",
+		.next = NEXT(item_l2tpv2_type_data_l_s,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type3.tunnel_id)),
+	},
+	[ITEM_L2TPV2_MSG_DATA_L_S_SESSION_ID] = {
+		.name = "session_id",
+		.help = "session identifier",
+		.next = NEXT(item_l2tpv2_type_data_l_s,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type3.session_id)),
+	},
+	[ITEM_L2TPV2_MSG_DATA_L_S_NS] = {
+		.name = "ns",
+		.help = "sequence number for message",
+		.next = NEXT(item_l2tpv2_type_data_l_s,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type3.ns)),
+	},
+	[ITEM_L2TPV2_MSG_DATA_L_S_NR] = {
+		.name = "nr",
+		.help = "sequence number for next receive message",
+		.next = NEXT(item_l2tpv2_type_data_l_s,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type3.nr)),
+	},
+	[ITEM_L2TPV2_TYPE_CTRL] = {
 		.name = "control",
-		.help = "Type #3: conrtol message contains length, ns, nr options",
-		.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_LENGTH,
-					ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID,
-					ITEM_L2TPV2_MSG_CTRL_SESSION_ID,
-					ITEM_L2TPV2_MSG_CTRL_NS,
-					ITEM_L2TPV2_MSG_CTRL_NR,
-					ITEM_NEXT)),
+		.help = "Type #3: conrtol message contains length, ns, nr "
+			"options",
+		.next = NEXT(item_l2tpv2_type_ctrl),
 		.call = parse_vc_item_l2tpv2_type,
 	},
 	[ITEM_L2TPV2_MSG_CTRL_LENGTH] = {
 		.name = "length",
 		.help = "message length",
-		.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_LENGTH,
-					ITEM_L2TPV2_COMMON, ITEM_NEXT),
+		.next = NEXT(item_l2tpv2_type_ctrl,
 			     NEXT_ENTRY(COMMON_UNSIGNED),
 			     item_param),
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -3917,8 +4120,7 @@ static const struct token token_list[] = {
 	[ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID] = {
 		.name = "tunnel_id",
 		.help = "tunnel identifier",
-		.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID,
-					ITEM_L2TPV2_COMMON, ITEM_NEXT),
+		.next = NEXT(item_l2tpv2_type_ctrl,
 			     NEXT_ENTRY(COMMON_UNSIGNED),
 			     item_param),
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -3927,8 +4129,7 @@ static const struct token token_list[] = {
 	[ITEM_L2TPV2_MSG_CTRL_SESSION_ID] = {
 		.name = "session_id",
 		.help = "session identifier",
-		.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_SESSION_ID,
-					ITEM_L2TPV2_COMMON, ITEM_NEXT),
+		.next = NEXT(item_l2tpv2_type_ctrl,
 			     NEXT_ENTRY(COMMON_UNSIGNED),
 			     item_param),
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -3937,8 +4138,7 @@ static const struct token token_list[] = {
 	[ITEM_L2TPV2_MSG_CTRL_NS] = {
 		.name = "ns",
 		.help = "sequence number for message",
-		.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_NS,
-					ITEM_L2TPV2_COMMON, ITEM_NEXT),
+		.next = NEXT(item_l2tpv2_type_ctrl,
 			     NEXT_ENTRY(COMMON_UNSIGNED),
 			     item_param),
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -3947,8 +4147,7 @@ static const struct token token_list[] = {
 	[ITEM_L2TPV2_MSG_CTRL_NR] = {
 		.name = "nr",
 		.help = "sequence number for next receive message",
-		.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_NS,
-					ITEM_L2TPV2_COMMON, ITEM_NEXT),
+		.next = NEXT(item_l2tpv2_type_ctrl,
 			     NEXT_ENTRY(COMMON_UNSIGNED),
 			     item_param),
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -5889,11 +6088,23 @@ parse_vc_item_l2tpv2_type(struct context *ctx, const struct token *token,
 	if (parse_default(ctx, token, str, len, NULL, 0) < 0)
 		return -1;
 	switch (ctx->curr) {
-	case ITEM_L2TPV2_COMMON_TYPE_DATA_L:
-		msg_type |= 0x4000;
+	case ITEM_L2TPV2_TYPE_DATA:
+		msg_type |= RTE_L2TPV2_MSG_TYPE_DATA;
+		break;
+	case ITEM_L2TPV2_TYPE_DATA_L:
+		msg_type |= RTE_L2TPV2_MSG_TYPE_DATA_L;
+		break;
+	case ITEM_L2TPV2_TYPE_DATA_S:
+		msg_type |= RTE_L2TPV2_MSG_TYPE_DATA_S;
+		break;
+	case ITEM_L2TPV2_TYPE_DATA_O:
+		msg_type |= RTE_L2TPV2_MSG_TYPE_DATA_O;
+		break;
+	case ITEM_L2TPV2_TYPE_DATA_L_S:
+		msg_type |= RTE_L2TPV2_MSG_TYPE_DATA_L_S;
 		break;
-	case ITEM_L2TPV2_COMMON_TYPE_CTRL:
-		msg_type |= 0xC800;
+	case ITEM_L2TPV2_TYPE_CTRL:
+		msg_type |= RTE_L2TPV2_MSG_TYPE_CONTROL;
 		break;
 	default:
 		return -1;
lib/net/rte_l2tpv2.h +13 -0
index 1f3ad3f03c..d41123a504 100644
@@ -78,6 +78,19 @@
 extern "C" {
 #endif
 
+/*
+ * L2TPv2 Message Type
+ */
+#define RTE_L2TPV2_MSG_TYPE_CONTROL	0xC802
+#define RTE_L2TPV2_MSG_TYPE_DATA	0x0002
+#define RTE_L2TPV2_MSG_TYPE_DATA_L	0x4002
+#define RTE_L2TPV2_MSG_TYPE_DATA_S	0x0802
+#define RTE_L2TPV2_MSG_TYPE_DATA_O	0x0202
+#define RTE_L2TPV2_MSG_TYPE_DATA_L_S	0x4802
+#define RTE_L2TPV2_MSG_TYPE_DATA_L_O	0x4202
+#define RTE_L2TPV2_MSG_TYPE_DATA_S_O	0x0A02
+#define RTE_L2TPV2_MSG_TYPE_DATA_L_S_O	0x4A02
+
 /**
  * L2TPv2 Common Header
  */
Signature · 1 line
2.25.1
Acked-by on v3 3/6
#8 lore raw

RE: [PATCH v3 3/6] app/testpmd: add 6 types of L2TPv2 message

Quoted 18 lines

-----Original Message-----
From: Jie Wang <[email protected]>
Sent: Saturday, January 29, 2022 8:25 AM
Subject: [PATCH v3 3/6] app/testpmd: add 6 types of L2TPv2 message

This patch adds L2TPv2 control message and 5 types of data message support for testpmd.

The added L2TPv2 message types are listed below:
1. L2TPv2 control
2. L2TPv2
3. L2TPv2 + length option
4. L2TPv2 + sequence option
5. L2TPv2 + offset option
6. L2TPv2 + length option + sequence option

Quoted 2 lines

---

Best,
Ori

author
#9 lore raw

PATCH v3 4/6 common/iavf: add session ID fields for L2TPv2

In reply to Jie Wang

Add virtchnl fields session ID of L2TPv2 for AVF HASH.

---
 drivers/common/iavf/virtchnl.h | 4 ++++
 1 file changed, 4 insertions(+)
drivers/common/iavf/virtchnl.h +4 -0
index 80e754a1b2..3e44eca7d8 100644
@@ -1653,6 +1653,10 @@ enum virtchnl_proto_hdr_field {
 		PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_GTPU_EH_PDU_DWN),
 	VIRTCHNL_PROTO_HDR_GTPU_UP_QFI =
 		PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_GTPU_EH_PDU_UP),
+	/* L2TPv2 */
+	VIRTCHNL_PROTO_HDR_L2TPV2_SESS_ID =
+		PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_L2TPV2),
+	VIRTCHNL_PROTO_HDR_L2TPV2_LEN_SESS_ID,
 };
 
 struct virtchnl_proto_hdr {
Signature · 1 line
2.25.1
author
#10 lore raw

PATCH v3 5/6 net/iavf: support L2TPv2 for AVF HASH

In reply to Jie Wang

Add support for PPP over L2TPv2 over UDP protocol and L2TPv2 protocol RSS hash based on outer MAC src address and L2TPv2 session ID.

Patterns are listed below:
eth/ipv4/udp/l2tpv2
eth/ipv4/udp/l2tpv2/ppp
eth/ipv6/udp/l2tpv2
eth/ipv6/udp/l2tpv2/ppp

---
 doc/guides/rel_notes/release_22_03.rst |  6 ++
 drivers/net/iavf/iavf.h                |  2 +
 drivers/net/iavf/iavf_generic_flow.c   | 34 +++++++++++
 drivers/net/iavf/iavf_generic_flow.h   |  6 ++
 drivers/net/iavf/iavf_hash.c           | 83 ++++++++++++++++++++++++--
 5 files changed, 127 insertions(+), 4 deletions(-)
doc/guides/rel_notes/release_22_03.rst +6 -0
index 9a507ab9ea..0d1e4a0b61 100644
@@ -64,6 +64,12 @@ New Features
 
   * Added rte_flow support for matching GENEVE packets.
 
+* **Updated Intel iavf driver.**
+
+  Added L2TPv2(include PPP over L2TPv2) RSS hash distribute packets
+  based on outer MAC src address and L2TPv2 session ID.
+
+
 Removed Items
 -------------
 
drivers/net/iavf/iavf.h +2 -0
index 0bb5698583..a01d18e61b 100644
@@ -93,6 +93,8 @@
 
 #define IAVF_VLAN_TAG_PCP_OFFSET 13
 
+#define IAVF_L2TPV2_FLAGS_LEN	0x4000
+
 struct iavf_adapter;
 struct iavf_rx_queue;
 struct iavf_tx_queue;
drivers/net/iavf/iavf_generic_flow.c +34 -0
index 2befa125ac..1de4187e67 100644
@@ -1611,6 +1611,40 @@ enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_udp[] = {
 	RTE_FLOW_ITEM_TYPE_END,
 };
 
+enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_L2TPV2,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp[] = {
+	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_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_L2TPV2,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2_ppp[] = {
+	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_END,
+};
+
 /* PPPoL2TPv2oUDP */
 enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4[] = {
 	RTE_FLOW_ITEM_TYPE_ETH,
drivers/net/iavf/iavf_generic_flow.h +6 -0
index 3681a96b31..107bbc1a23 100644
@@ -410,6 +410,12 @@ 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[];
 
+/* L2TPv2 */
+extern enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2_ppp[];
+
 /* 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[];
drivers/net/iavf/iavf_hash.c +79 -4

152 lines not on this page · raw message

Signature · 1 line
2.25.1
author
#11 lore raw

PATCH v3 6/6 net/iavf: support L2TPv2 for AVF FDIR

In reply to Jie Wang

Add support for L2TPv2(include PPP over L2TPv2) protocols FDIR based on outer MAC src address and L2TPv2 session ID.

Add support for PPPoL2TPv2oUDP protocols FDIR based on inner IP src/dst address and UDP/TCP src/dst port.

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

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

---
 doc/guides/rel_notes/release_22_03.rst |   8 +-
 drivers/net/iavf/iavf_fdir.c           | 174 +++++++++++++++++++++----
 drivers/net/iavf/iavf_generic_flow.h   |   4 +
 3 files changed, 156 insertions(+), 30 deletions(-)
doc/guides/rel_notes/release_22_03.rst +6 -2
index 0d1e4a0b61..5a73ccc14e 100644
@@ -66,8 +66,12 @@ New Features
 
 * **Updated Intel iavf driver.**
 
-  Added L2TPv2(include PPP over L2TPv2) RSS hash distribute packets
-  based on outer MAC src address and L2TPv2 session ID.
+  * Added L2TPv2(include PPP over L2TPv2) RSS hash distribute packets
+    based on outer MAC src address and L2TPv2 session ID.
+  * Added L2TPv2(include PPP over L2TPv2) FDIR distribute packets
+    based on outer MAC src address and L2TPv2 session ID.
+  * Added PPPoL2TPv2oUDP FDIR distribute packets based on inner IP
+    src/dst address and UDP/TCP src/dst port.
 
 
 Removed Items
drivers/net/iavf/iavf_fdir.c +146 -28

214 lines not on this page · raw message

drivers/net/iavf/iavf_generic_flow.h +4 -0
index 107bbc1a23..f6af176073 100644
@@ -35,6 +35,7 @@
 #define IAVF_PROT_L2TPV3OIP	    (1ULL << 24)
 #define IAVF_PROT_PFCP		    (1ULL << 25)
 #define IAVF_PROT_ECPRI		    (1ULL << 26)
+#define IAVF_PROT_L2TPV2	    (1ULL << 27)
 
 
 /* field */
@@ -62,6 +63,7 @@
 #define IAVF_PFCP_SEID		    (1ULL << 43)
 #define IAVF_ECPRI_PC_RTC_ID	    (1ULL << 42)
 #define IAVF_IP_PKID		    (1ULL << 41)
+#define IAVF_L2TPV2_SESSION_ID	    (1ULL << 40)
 
 /* input set */
 
@@ -175,6 +177,8 @@
 	(IAVF_PROT_PFCP | IAVF_PFCP_S_FIELD | IAVF_PFCP_SEID)
 #define IAVF_INSET_ECPRI \
 	(IAVF_PROT_ECPRI | IAVF_ECPRI_PC_RTC_ID)
+#define IAVF_INSET_L2TPV2 \
+	(IAVF_PROT_L2TPV2 | IAVF_L2TPV2_SESSION_ID)
 
 /* empty pattern */
 extern enum rte_flow_item_type iavf_pattern_empty[];
Signature · 1 line
2.25.1
#12 lore raw
In reply to Jie Wang
Quoted 18 lines · Jie Wang

Support IAVF L2TPv2(include PPP over L2tpv2) RSS hash and flow director. Required to distribute packets based on outer MAC src address and L2TPv2 session ID.

Support IAVF PPPoL2TPv2oUDP flow director. Required to distribute packets based on inner IP src+dest address and TCP/UDP src+dest port.

---
v3:
* update new macros in ethdev.
* update commit log.
* rebase the main branch code.
v2:
* upadte release notes.
* add comment for RTE_ETH_RSS_L2TPV2.
* update ipv6 l2tpv2 flow item.
* rebase the main branch code.

Quoted 8 lines

Jie Wang (6):
ethdev: add L2TPv2 RSS offload type
net: fix L2TPv2 common header
app/testpmd: add 6 types of L2TPv2 message
common/iavf: add session ID fields for L2TPv2
net/iavf: support L2TPv2 for AVF HASH
net/iavf: support L2TPv2 for AVF FDIR

Hi Jingjing, Beilei,

Can you please review the iavf patches, so we can proceed with the set?

author
#13 lore raw

v4 cover support L2TPv2 for AVF RSS hash and FDIR

In reply to Jie Wang

Support IAVF L2TPv2(include PPP over L2tpv2) RSS hash and flow director. Required to distribute packets based on outer MAC src address and L2TPv2 session ID.

Support IAVF PPPoL2TPv2oUDP flow director. Required to distribute packets based on inner IP src+dest address and TCP/UDP src+dest port.

---
v4:
* update new macros in ethdev.
* update commit log.
* rebase the main branch code.
v3:
* update new macros in ethdev.
* update commit log.
* rebase the main branch code.
v2:
* upadte release notes.
* add comment for RTE_ETH_RSS_L2TPV2.
* update ipv6 l2tpv2 flow item.
* rebase the main branch code.

Jie Wang (6):
ethdev: add L2TPv2 RSS offload type
net: fix L2TPv2 common header
app/testpmd: add 6 types of L2TPv2 message
common/iavf: add session ID fields for L2TPv2
net/iavf: support L2TPv2 for AVF HASH
net/iavf: support L2TPv2 for AVF FDIR

 app/test-pmd/cmdline.c                 |  10 +-
 app/test-pmd/cmdline_flow.c            | 313 +++++++++++++++++++++----
 app/test-pmd/config.c                  |   3 +-
 doc/guides/rel_notes/release_22_03.rst |  15 ++
 drivers/common/iavf/virtchnl.h         |   4 +
 drivers/net/iavf/iavf.h                |   2 +
 drivers/net/iavf/iavf_fdir.c           | 174 +++++++++++---
 drivers/net/iavf/iavf_generic_flow.c   |  34 +++
 drivers/net/iavf/iavf_generic_flow.h   |  10 +
 drivers/net/iavf/iavf_hash.c           |  83 ++++++-
 lib/ethdev/rte_ethdev.h                |   6 +
 lib/net/rte_l2tpv2.h                   |  33 ++-
 12 files changed, 589 insertions(+), 98 deletions(-)
Signature · 1 line
2.25.1
author
#14 lore raw

PATCH v4 1/6 ethdev: add L2TPv2 RSS offload type

This patch defines new RSS offload type for L2TPv2, which is required when users want to distribute packets based on the L2TPv2 session ID field.

---
 app/test-pmd/cmdline.c                 | 10 ++++++----
 app/test-pmd/config.c                  |  3 ++-
 doc/guides/rel_notes/release_22_03.rst |  5 +++++
 lib/ethdev/rte_ethdev.h                |  6 ++++++
 4 files changed, 19 insertions(+), 5 deletions(-)
app/test-pmd/cmdline.c +6 -4
index e626b1c7d9..d535311f21 100644
@@ -2178,7 +2178,7 @@ cmd_config_rss_parsed(void *parsed_result,
 			RTE_ETH_RSS_TCP | RTE_ETH_RSS_UDP | RTE_ETH_RSS_SCTP |
 			RTE_ETH_RSS_L2_PAYLOAD | RTE_ETH_RSS_L2TPV3 | RTE_ETH_RSS_ESP |
 			RTE_ETH_RSS_AH | RTE_ETH_RSS_PFCP | RTE_ETH_RSS_GTPU |
-			RTE_ETH_RSS_ECPRI;
+			RTE_ETH_RSS_ECPRI | RTE_ETH_RSS_L2TPV2;
 	else if (!strcmp(res->value, "eth"))
 		rss_conf.rss_hf = RTE_ETH_RSS_ETH;
 	else if (!strcmp(res->value, "vlan"))
@@ -2256,6 +2256,8 @@ cmd_config_rss_parsed(void *parsed_result,
 		rss_conf.rss_hf = (rss_hf | RTE_ETH_RSS_LEVEL_INNERMOST);
 	} else if (!strcmp(res->value, "default"))
 		use_default = 1;
+	else if (!strcmp(res->value, "l2tpv2"))
+		rss_conf.rss_hf = RTE_ETH_RSS_L2TPV2;
 	else if (isdigit(res->value[0]) && atoi(res->value) > 0 &&
 						atoi(res->value) < 64)
 		rss_conf.rss_hf = 1ULL << atoi(res->value);
@@ -2314,7 +2316,7 @@ cmdline_parse_inst_t cmd_config_rss = {
 	.help_str = "port config all rss "
 		"all|default|eth|vlan|ip|tcp|udp|sctp|ether|port|vxlan|geneve|"
 		"nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|ecpri|mpls|none|level-default|"
-		"level-outer|level-inner|ipv4-chksum|<flowtype_id>",
+		"level-outer|level-inner|ipv4-chksum|l2tpv2|<flowtype_id>",
 	.tokens = {
 		(void *)&cmd_config_rss_port,
 		(void *)&cmd_config_rss_keyword,
@@ -2429,7 +2431,7 @@ cmdline_parse_token_string_t cmd_config_rss_hash_key_rss_type =
 				 "ipv6-tcp-ex#ipv6-udp-ex#"
 				 "l3-src-only#l3-dst-only#l4-src-only#l4-dst-only#"
 				 "l2-src-only#l2-dst-only#s-vlan#c-vlan#"
-				 "l2tpv3#esp#ah#pfcp#pppoe#gtpu#ecpri#mpls");
+				 "l2tpv3#esp#ah#pfcp#pppoe#gtpu#ecpri#mpls#l2tpv2");
 cmdline_parse_token_string_t cmd_config_rss_hash_key_value =
 	TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_key, key, NULL);
 
@@ -2442,7 +2444,7 @@ cmdline_parse_inst_t cmd_config_rss_hash_key = {
 		"l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex|"
 		"l3-src-only|l3-dst-only|l4-src-only|l4-dst-only|"
 		"l2-src-only|l2-dst-only|s-vlan|c-vlan|"
-		"l2tpv3|esp|ah|pfcp|pppoe|gtpu|ecpri|mpls "
+		"l2tpv3|esp|ah|pfcp|pppoe|gtpu|ecpri|mpls|l2tpv2 "
 		"<string of hex digits (variable length, NIC dependent)>",
 	.tokens = {
 		(void *)&cmd_config_rss_hash_key_port,
app/test-pmd/config.c +2 -1
index 1722d6c8f8..ec922bd304 100644
@@ -90,7 +90,7 @@ const struct rss_type_info rss_type_table[] = {
 	{ "all", RTE_ETH_RSS_ETH | RTE_ETH_RSS_VLAN | RTE_ETH_RSS_IP | RTE_ETH_RSS_TCP |
 		RTE_ETH_RSS_UDP | RTE_ETH_RSS_SCTP | RTE_ETH_RSS_L2_PAYLOAD |
 		RTE_ETH_RSS_L2TPV3 | RTE_ETH_RSS_ESP | RTE_ETH_RSS_AH | RTE_ETH_RSS_PFCP |
-		RTE_ETH_RSS_GTPU | RTE_ETH_RSS_ECPRI | RTE_ETH_RSS_MPLS},
+		RTE_ETH_RSS_GTPU | RTE_ETH_RSS_ECPRI | RTE_ETH_RSS_MPLS | RTE_ETH_RSS_L2TPV2},
 	{ "none", 0 },
 	{ "eth", RTE_ETH_RSS_ETH },
 	{ "l2-src-only", RTE_ETH_RSS_L2_SRC_ONLY },
@@ -143,6 +143,7 @@ const struct rss_type_info rss_type_table[] = {
 	{ "mpls", RTE_ETH_RSS_MPLS },
 	{ "ipv4-chksum", RTE_ETH_RSS_IPV4_CHKSUM },
 	{ "l4-chksum", RTE_ETH_RSS_L4_CHKSUM },
+	{ "l2tpv2", RTE_ETH_RSS_L2TPV2 },
 	{ NULL, 0 },
 };
 
doc/guides/rel_notes/release_22_03.rst +5 -0
index 33be3241b9..9a507ab9ea 100644
@@ -55,6 +55,11 @@ New Features
      Also, make sure to start the actual text at the margin.
      =======================================================
 
+* **Added new RSS offload types for L2TPv2 in RSS flow.**
+
+  Added macro RTE_ETH_RSS_L2TPV2, now L2TPv2 session ID field can be used as
+  input set for RSS.
+
 * **Updated Cisco enic driver.**
 
   * Added rte_flow support for matching GENEVE packets.
lib/ethdev/rte_ethdev.h +6 -0
index 147cc1ced3..b7e78618c8 100644
@@ -651,6 +651,12 @@ struct rte_eth_rss_conf {
 #define RTE_ETH_RSS_L4_CHKSUM          RTE_BIT64(35)
 #define ETH_RSS_L4_CHKSUM RTE_DEPRECATED(ETH_RSS_L4_CHKSUM) RTE_ETH_RSS_L4_CHKSUM
 
+/*
+ * Below macro is defined for RSS offload type, it can be used to
+ * fill rte_eth_rss_conf.rss_hf or rte_flow_action_rss.types.
+ */
+#define RTE_ETH_RSS_L2TPV2            RTE_BIT64(36)
+
 /*
  * We use the following macros to combine with above RTE_ETH_RSS_* for
  * more specific input set selection. These bits are defined starting
Signature · 1 line
2.25.1
#15 lore raw

Re: [PATCH v4 1/6] ethdev: add L2TPv2 RSS offload type

Quoted 103 lines · Jie Wang

This patch defines new RSS offload type for L2TPv2, which is required when users want to distribute packets based on the L2TPv2 session ID field.

---
  app/test-pmd/cmdline.c                 | 10 ++++++----
  app/test-pmd/config.c                  |  3 ++-
  doc/guides/rel_notes/release_22_03.rst |  5 +++++
  lib/ethdev/rte_ethdev.h                |  6 ++++++
  4 files changed, 19 insertions(+), 5 deletions(-)
app/test-pmd/cmdline.c +6 -4
index e626b1c7d9..d535311f21 100644
@@ -2178,7 +2178,7 @@ cmd_config_rss_parsed(void *parsed_result,
  			RTE_ETH_RSS_TCP | RTE_ETH_RSS_UDP | RTE_ETH_RSS_SCTP |
  			RTE_ETH_RSS_L2_PAYLOAD | RTE_ETH_RSS_L2TPV3 | RTE_ETH_RSS_ESP |
  			RTE_ETH_RSS_AH | RTE_ETH_RSS_PFCP | RTE_ETH_RSS_GTPU |
-			RTE_ETH_RSS_ECPRI;
+			RTE_ETH_RSS_ECPRI | RTE_ETH_RSS_L2TPV2;
  	else if (!strcmp(res->value, "eth"))
  		rss_conf.rss_hf = RTE_ETH_RSS_ETH;
  	else if (!strcmp(res->value, "vlan"))
@@ -2256,6 +2256,8 @@ cmd_config_rss_parsed(void *parsed_result,
  		rss_conf.rss_hf = (rss_hf | RTE_ETH_RSS_LEVEL_INNERMOST);
  	} else if (!strcmp(res->value, "default"))
  		use_default = 1;
+	else if (!strcmp(res->value, "l2tpv2"))
+		rss_conf.rss_hf = RTE_ETH_RSS_L2TPV2;
  	else if (isdigit(res->value[0]) && atoi(res->value) > 0 &&
  						atoi(res->value) < 64)
  		rss_conf.rss_hf = 1ULL << atoi(res->value);
@@ -2314,7 +2316,7 @@ cmdline_parse_inst_t cmd_config_rss = {
  	.help_str = "port config all rss "
  		"all|default|eth|vlan|ip|tcp|udp|sctp|ether|port|vxlan|geneve|"
  		"nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|ecpri|mpls|none|level-default|"
-		"level-outer|level-inner|ipv4-chksum|<flowtype_id>",
+		"level-outer|level-inner|ipv4-chksum|l2tpv2|<flowtype_id>",
  	.tokens = {
  		(void *)&cmd_config_rss_port,
  		(void *)&cmd_config_rss_keyword,
@@ -2429,7 +2431,7 @@ cmdline_parse_token_string_t cmd_config_rss_hash_key_rss_type =
  				 "ipv6-tcp-ex#ipv6-udp-ex#"
  				 "l3-src-only#l3-dst-only#l4-src-only#l4-dst-only#"
  				 "l2-src-only#l2-dst-only#s-vlan#c-vlan#"
-				 "l2tpv3#esp#ah#pfcp#pppoe#gtpu#ecpri#mpls");
+				 "l2tpv3#esp#ah#pfcp#pppoe#gtpu#ecpri#mpls#l2tpv2");
  cmdline_parse_token_string_t cmd_config_rss_hash_key_value =
  	TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_key, key, NULL);
 
@@ -2442,7 +2444,7 @@ cmdline_parse_inst_t cmd_config_rss_hash_key = {
  		"l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex|"
  		"l3-src-only|l3-dst-only|l4-src-only|l4-dst-only|"
  		"l2-src-only|l2-dst-only|s-vlan|c-vlan|"
-		"l2tpv3|esp|ah|pfcp|pppoe|gtpu|ecpri|mpls "
+		"l2tpv3|esp|ah|pfcp|pppoe|gtpu|ecpri|mpls|l2tpv2 "
  		"<string of hex digits (variable length, NIC dependent)>",
  	.tokens = {
  		(void *)&cmd_config_rss_hash_key_port,
app/test-pmd/config.c +2 -1
index 1722d6c8f8..ec922bd304 100644
@@ -90,7 +90,7 @@ const struct rss_type_info rss_type_table[] = {
  	{ "all", RTE_ETH_RSS_ETH | RTE_ETH_RSS_VLAN | RTE_ETH_RSS_IP | RTE_ETH_RSS_TCP |
  		RTE_ETH_RSS_UDP | RTE_ETH_RSS_SCTP | RTE_ETH_RSS_L2_PAYLOAD |
  		RTE_ETH_RSS_L2TPV3 | RTE_ETH_RSS_ESP | RTE_ETH_RSS_AH | RTE_ETH_RSS_PFCP |
-		RTE_ETH_RSS_GTPU | RTE_ETH_RSS_ECPRI | RTE_ETH_RSS_MPLS},
+		RTE_ETH_RSS_GTPU | RTE_ETH_RSS_ECPRI | RTE_ETH_RSS_MPLS | RTE_ETH_RSS_L2TPV2},
  	{ "none", 0 },
  	{ "eth", RTE_ETH_RSS_ETH },
  	{ "l2-src-only", RTE_ETH_RSS_L2_SRC_ONLY },
@@ -143,6 +143,7 @@ const struct rss_type_info rss_type_table[] = {
  	{ "mpls", RTE_ETH_RSS_MPLS },
  	{ "ipv4-chksum", RTE_ETH_RSS_IPV4_CHKSUM },
  	{ "l4-chksum", RTE_ETH_RSS_L4_CHKSUM },
+	{ "l2tpv2", RTE_ETH_RSS_L2TPV2 },
  	{ NULL, 0 },
  };
 
doc/guides/rel_notes/release_22_03.rst +5 -0
index 33be3241b9..9a507ab9ea 100644
@@ -55,6 +55,11 @@ New Features
       Also, make sure to start the actual text at the margin.
       =======================================================
 
+* **Added new RSS offload types for L2TPv2 in RSS flow.**
+
+  Added macro RTE_ETH_RSS_L2TPV2, now L2TPv2 session ID field can be used as
+  input set for RSS.
+
  * **Updated Cisco enic driver.**
 
    * Added rte_flow support for matching GENEVE packets.
lib/ethdev/rte_ethdev.h +0 -0
index 147cc1ced3..b7e78618c8 100644

lib/ethdev/rte_ethdev.h struct rte_eth_rss_conf { · line 657

Quoted 7 lines
lib/ethdev/rte_ethdev.h +4 -0
@@ -651,6 +651,12 @@ struct rte_eth_rss_conf {
  #define RTE_ETH_RSS_L4_CHKSUM          RTE_BIT64(35)
  #define ETH_RSS_L4_CHKSUM RTE_DEPRECATED(ETH_RSS_L4_CHKSUM) RTE_ETH_RSS_L4_CHKSUM
 
+/*
+ * Below macro is defined for RSS offload type, it can be used to
+ * fill rte_eth_rss_conf.rss_hf or rte_flow_action_rss.types.
+ */

Why this comment is duplicated here? (There is exact same above, and it is wrong to have it here.)

If this is the only comment, I can remove it while merging.

Quoted 5 lines
lib/ethdev/rte_ethdev.h +2 -0
+#define RTE_ETH_RSS_L2TPV2            RTE_BIT64(36)
+
  /*
   * We use the following macros to combine with above RTE_ETH_RSS_* for
   * more specific input set selection. These bits are defined starting
#16 lore raw

Re: [PATCH v4 1/6] ethdev: add L2TPv2 RSS offload type

Quoted 24 lines · Ferruh Yigit
Quoted 23 lines · Jie Wang

This patch defines new RSS offload type for L2TPv2, which is required when users want to distribute packets based on the L2TPv2 session ID field.

---
  app/test-pmd/cmdline.c                 | 10 ++++++---- app/test-pmd/config.c                  |  3 ++- doc/guides/rel_notes/release_22_03.rst |  5 +++++ lib/ethdev/rte_ethdev.h                |  6 ++++++

  4 files changed, 19 insertions(+), 5 deletions(-)
app/test-pmd/cmdline.c +0 -0
index e626b1c7d9..d535311f21 100644
@@ -2178,7 +2178,7 @@ cmd_config_rss_parsed(void *parsed_result,

              RTE_ETH_RSS_TCP | RTE_ETH_RSS_UDP | RTE_ETH_RSS_SCTP | RTE_ETH_RSS_L2_PAYLOAD | RTE_ETH_RSS_L2TPV3 | RTE_ETH_RSS_ESP | RTE_ETH_RSS_AH | RTE_ETH_RSS_PFCP | RTE_ETH_RSS_GTPU | -            RTE_ETH_RSS_ECPRI;
+            RTE_ETH_RSS_ECPRI | RTE_ETH_RSS_L2TPV2;
      else if (!strcmp(res->value, "eth"))

Quoted 8 lines

app/test-pmd/cmdline.c cmd_config_rss_parsed(void *parsed_result, · line 2260

Quoted 8 lines

          rss_conf.rss_hf = RTE_ETH_RSS_ETH;
      else if (!strcmp(res->value, "vlan"))

app/test-pmd/cmdline.c +2 -0
@@ -2256,6 +2256,8 @@ cmd_config_rss_parsed(void *parsed_result,
           rss_conf.rss_hf = (rss_hf | RTE_ETH_RSS_LEVEL_INNERMOST);
       } else if (!strcmp(res->value, "default"))
           use_default = 1;
+    else if (!strcmp(res->value, "l2tpv2"))
+        rss_conf.rss_hf = RTE_ETH_RSS_L2TPV2;

I think better to keep 'default' as last check, can you please add new one above the 'default' check?

Quoted 9 lines
Quoted 9 lines

      else if (isdigit(res->value[0]) && atoi(res->value) > 0 && atoi(res->value) < 64) rss_conf.rss_hf = 1ULL << atoi(res->value);

app/test-pmd/cmdline.c +0 -0
@@ -2314,7 +2316,7 @@ cmdline_parse_inst_t cmd_config_rss = {

      .help_str = "port config all rss " "all|default|eth|vlan|ip|tcp|udp|sctp|ether|port|vxlan|geneve|" "nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|ecpri|mpls|none|level-default|"

-        "level-outer|level-inner|ipv4-chksum|<flowtype_id>",
+        "level-outer|level-inner|ipv4-chksum|l2tpv2|<flowtype_id>",

Can you please update

- cmd_help_long_parsed() in same file
- documentation, doc/guides/testpmd_app_ug/testpmd_funcs.rst

Quoted 9 lines
Quoted 9 lines

      .tokens = {
          (void *)&cmd_config_rss_port,
          (void *)&cmd_config_rss_keyword,

app/test-pmd/cmdline.c +0 -0
@@ -2429,7 +2431,7 @@ cmdline_parse_token_string_t cmd_config_rss_hash_key_rss_type =

                   "ipv6-tcp-ex#ipv6-udp-ex#" "l3-src-only#l3-dst-only#l4-src-only#l4-dst-only#" "l2-src-only#l2-dst-only#s-vlan#c-vlan#" -                 "l2tpv3#esp#ah#pfcp#pppoe#gtpu#ecpri#mpls"); +                 "l2tpv3#esp#ah#pfcp#pppoe#gtpu#ecpri#mpls#l2tpv2");

Quoted 8 lines
Quoted 8 lines

  cmdline_parse_token_string_t cmd_config_rss_hash_key_value = TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_key, key, NULL);

app/test-pmd/cmdline.c +0 -0
@@ -2442,7 +2444,7 @@ cmdline_parse_inst_t cmd_config_rss_hash_key = {

          "l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex|"

          "l3-src-only|l3-dst-only|l4-src-only|l4-dst-only|"
          "l2-src-only|l2-dst-only|s-vlan|c-vlan|"
-        "l2tpv3|esp|ah|pfcp|pppoe|gtpu|ecpri|mpls "
+        "l2tpv3|esp|ah|pfcp|pppoe|gtpu|ecpri|mpls|l2tpv2 "

Same for this command

Quoted 43 lines
Quoted 43 lines

          "<string of hex digits (variable length, NIC dependent)>", .tokens = {
          (void *)&cmd_config_rss_hash_key_port,

app/test-pmd/config.c +0 -0
index 1722d6c8f8..ec922bd304 100644
@@ -90,7 +90,7 @@ const struct rss_type_info rss_type_table[] = {

      { "all", RTE_ETH_RSS_ETH | RTE_ETH_RSS_VLAN | RTE_ETH_RSS_IP | RTE_ETH_RSS_TCP | RTE_ETH_RSS_UDP | RTE_ETH_RSS_SCTP | RTE_ETH_RSS_L2_PAYLOAD | RTE_ETH_RSS_L2TPV3 | RTE_ETH_RSS_ESP | RTE_ETH_RSS_AH | RTE_ETH_RSS_PFCP |

-        RTE_ETH_RSS_GTPU | RTE_ETH_RSS_ECPRI | RTE_ETH_RSS_MPLS},
+        RTE_ETH_RSS_GTPU | RTE_ETH_RSS_ECPRI | RTE_ETH_RSS_MPLS | RTE_ETH_RSS_L2TPV2},

      { "none", 0 },
      { "eth", RTE_ETH_RSS_ETH },
      { "l2-src-only", RTE_ETH_RSS_L2_SRC_ONLY },

app/test-pmd/config.c +1 -0
@@ -143,6 +143,7 @@ const struct rss_type_info rss_type_table[] = {
       { "mpls", RTE_ETH_RSS_MPLS },
       { "ipv4-chksum", RTE_ETH_RSS_IPV4_CHKSUM },
       { "l4-chksum", RTE_ETH_RSS_L4_CHKSUM },
+    { "l2tpv2", RTE_ETH_RSS_L2TPV2 },
       { NULL, 0 },
   };
doc/guides/rel_notes/release_22_03.rst +0 -0
index 33be3241b9..9a507ab9ea 100644
@@ -55,6 +55,11 @@ New Features

       Also, make sure to start the actual text at the margin.
       =======================================================

doc/guides/rel_notes/release_22_03.rst +5 -0
+* **Added new RSS offload types for L2TPv2 in RSS flow.**
+
+  Added macro RTE_ETH_RSS_L2TPV2, now L2TPv2 session ID field can be used as
+  input set for RSS.
+

  * **Updated Cisco enic driver.**
    * Added rte_flow support for matching GENEVE packets.

lib/ethdev/rte_ethdev.h +0 -0
index 147cc1ced3..b7e78618c8 100644
@@ -651,6 +651,12 @@ struct rte_eth_rss_conf {
   #define RTE_ETH_RSS_L4_CHKSUM          RTE_BIT64(35)
Quoted 9 lines

lib/ethdev/rte_ethdev.h struct rte_eth_rss_conf { · line 657

Quoted 5 lines
lib/ethdev/rte_ethdev.h +4 -0
   #define ETH_RSS_L4_CHKSUM RTE_DEPRECATED(ETH_RSS_L4_CHKSUM) RTE_ETH_RSS_L4_CHKSUM
+/*
+ * Below macro is defined for RSS offload type, it can be used to
+ * fill rte_eth_rss_conf.rss_hf or rte_flow_action_rss.types.
+ */

Why this comment is duplicated here? (There is exact same above, and it is wrong to have it here.)

Please remove above comment too

Quoted 8 lines

If this is the only comment, I can remove it while merging.

Quoted 5 lines
lib/ethdev/rte_ethdev.h +2 -0
+#define RTE_ETH_RSS_L2TPV2            RTE_BIT64(36)
+
   /*
    * We use the following macros to combine with above RTE_ETH_RSS_* for
    * more specific input set selection. These bits are defined starting
author
#17 lore raw

PATCH v4 2/6 net: fix L2TPv2 common header

In reply to Jie Wang

The fields of L2TPv2 common header were reversed in big endian and little endian.

This patch fixes this error to ensure L2TPv2 can be parsed correctly.

For L2TP reference:
https://datatracker.ietf.org/doc/html/rfc2661#section-3.1

Fixes 3a929df1f286 ("ethdev: support L2TPv2 and PPP procotol")
---
 lib/net/rte_l2tpv2.h | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
lib/net/rte_l2tpv2.h +10 -10
index 938a993b48..1f3ad3f03c 100644
@@ -89,16 +89,6 @@ struct rte_l2tpv2_common_hdr {
 		__extension__
 		struct {
 #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
-			uint16_t t:1;		/**< message Type */
-			uint16_t l:1;		/**< length option bit */
-			uint16_t res1:2;	/**< reserved */
-			uint16_t s:1;		/**< ns/nr option bit */
-			uint16_t res2:1;	/**< reserved */
-			uint16_t o:1;		/**< offset option bit */
-			uint16_t p:1;		/**< priority option bit */
-			uint16_t res3:4;	/**< reserved */
-			uint16_t ver:4;		/**< protocol version */
-#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
 			uint16_t ver:4;		/**< protocol version */
 			uint16_t res3:4;	/**< reserved */
 			uint16_t p:1;		/**< priority option bit */
@@ -108,6 +98,16 @@ struct rte_l2tpv2_common_hdr {
 			uint16_t res1:2;	/**< reserved */
 			uint16_t l:1;		/**< length option bit */
 			uint16_t t:1;		/**< message Type */
+#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
+			uint16_t t:1;		/**< message Type */
+			uint16_t l:1;		/**< length option bit */
+			uint16_t res1:2;	/**< reserved */
+			uint16_t s:1;		/**< ns/nr option bit */
+			uint16_t res2:1;	/**< reserved */
+			uint16_t o:1;		/**< offset option bit */
+			uint16_t p:1;		/**< priority option bit */
+			uint16_t res3:4;	/**< reserved */
+			uint16_t ver:4;		/**< protocol version */
 #endif
 		};
 	};
Signature · 1 line
2.25.1
author
#18 lore raw

PATCH v4 3/6 app/testpmd: add 6 types of L2TPv2 message

In reply to Jie Wang

This patch adds L2TPv2 control message and 5 types of data message support for testpmd.

The added L2TPv2 message types are listed below:
1. L2TPv2 control
2. L2TPv2
3. L2TPv2 + length option
4. L2TPv2 + sequence option
5. L2TPv2 + offset option
6. L2TPv2 + length option + sequence option

---
 app/test-pmd/cmdline_flow.c | 313 ++++++++++++++++++++++++++++++------
 lib/net/rte_l2tpv2.h        |  13 ++
 2 files changed, 275 insertions(+), 51 deletions(-)
app/test-pmd/cmdline_flow.c +262 -51
index bbaf18d76e..4e2ed3d6a3 100644
@@ -322,13 +322,30 @@ enum index {
 	ITEM_FLEX_ITEM_HANDLE,
 	ITEM_FLEX_PATTERN_HANDLE,
 	ITEM_L2TPV2,
-	ITEM_L2TPV2_COMMON,
-	ITEM_L2TPV2_COMMON_TYPE,
-	ITEM_L2TPV2_COMMON_TYPE_DATA_L,
-	ITEM_L2TPV2_COMMON_TYPE_CTRL,
+	ITEM_L2TPV2_TYPE,
+	ITEM_L2TPV2_TYPE_DATA,
+	ITEM_L2TPV2_TYPE_DATA_L,
+	ITEM_L2TPV2_TYPE_DATA_S,
+	ITEM_L2TPV2_TYPE_DATA_O,
+	ITEM_L2TPV2_TYPE_DATA_L_S,
+	ITEM_L2TPV2_TYPE_CTRL,
+	ITEM_L2TPV2_MSG_DATA_TUNNEL_ID,
+	ITEM_L2TPV2_MSG_DATA_SESSION_ID,
 	ITEM_L2TPV2_MSG_DATA_L_LENGTH,
 	ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID,
 	ITEM_L2TPV2_MSG_DATA_L_SESSION_ID,
+	ITEM_L2TPV2_MSG_DATA_S_TUNNEL_ID,
+	ITEM_L2TPV2_MSG_DATA_S_SESSION_ID,
+	ITEM_L2TPV2_MSG_DATA_S_NS,
+	ITEM_L2TPV2_MSG_DATA_S_NR,
+	ITEM_L2TPV2_MSG_DATA_O_TUNNEL_ID,
+	ITEM_L2TPV2_MSG_DATA_O_SESSION_ID,
+	ITEM_L2TPV2_MSG_DATA_O_OFFSET,
+	ITEM_L2TPV2_MSG_DATA_L_S_LENGTH,
+	ITEM_L2TPV2_MSG_DATA_L_S_TUNNEL_ID,
+	ITEM_L2TPV2_MSG_DATA_L_S_SESSION_ID,
+	ITEM_L2TPV2_MSG_DATA_L_S_NS,
+	ITEM_L2TPV2_MSG_DATA_L_S_NR,
 	ITEM_L2TPV2_MSG_CTRL_LENGTH,
 	ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID,
 	ITEM_L2TPV2_MSG_CTRL_SESSION_ID,
@@ -1449,19 +1466,70 @@ static const enum index item_flex[] = {
 };
 
 static const enum index item_l2tpv2[] = {
-	ITEM_L2TPV2_COMMON,
+	ITEM_L2TPV2_TYPE,
 	ITEM_NEXT,
 	ZERO,
 };
 
-static const enum index item_l2tpv2_common[] = {
-	ITEM_L2TPV2_COMMON_TYPE,
+static const enum index item_l2tpv2_type[] = {
+	ITEM_L2TPV2_TYPE_DATA,
+	ITEM_L2TPV2_TYPE_DATA_L,
+	ITEM_L2TPV2_TYPE_DATA_S,
+	ITEM_L2TPV2_TYPE_DATA_O,
+	ITEM_L2TPV2_TYPE_DATA_L_S,
+	ITEM_L2TPV2_TYPE_CTRL,
 	ZERO,
 };
 
-static const enum index item_l2tpv2_common_type[] = {
-	ITEM_L2TPV2_COMMON_TYPE_DATA_L,
-	ITEM_L2TPV2_COMMON_TYPE_CTRL,
+static const enum index item_l2tpv2_type_data[] = {
+	ITEM_L2TPV2_MSG_DATA_TUNNEL_ID,
+	ITEM_L2TPV2_MSG_DATA_SESSION_ID,
+	ITEM_NEXT,
+	ZERO,
+};
+
+static const enum index item_l2tpv2_type_data_l[] = {
+	ITEM_L2TPV2_MSG_DATA_L_LENGTH,
+	ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID,
+	ITEM_L2TPV2_MSG_DATA_L_SESSION_ID,
+	ITEM_NEXT,
+	ZERO,
+};
+
+static const enum index item_l2tpv2_type_data_s[] = {
+	ITEM_L2TPV2_MSG_DATA_S_TUNNEL_ID,
+	ITEM_L2TPV2_MSG_DATA_S_SESSION_ID,
+	ITEM_L2TPV2_MSG_DATA_S_NS,
+	ITEM_L2TPV2_MSG_DATA_S_NR,
+	ITEM_NEXT,
+	ZERO,
+};
+
+static const enum index item_l2tpv2_type_data_o[] = {
+	ITEM_L2TPV2_MSG_DATA_O_TUNNEL_ID,
+	ITEM_L2TPV2_MSG_DATA_O_SESSION_ID,
+	ITEM_L2TPV2_MSG_DATA_O_OFFSET,
+	ITEM_NEXT,
+	ZERO,
+};
+
+static const enum index item_l2tpv2_type_data_l_s[] = {
+	ITEM_L2TPV2_MSG_DATA_L_S_LENGTH,
+	ITEM_L2TPV2_MSG_DATA_L_S_TUNNEL_ID,
+	ITEM_L2TPV2_MSG_DATA_L_S_SESSION_ID,
+	ITEM_L2TPV2_MSG_DATA_L_S_NS,
+	ITEM_L2TPV2_MSG_DATA_L_S_NR,
+	ITEM_NEXT,
+	ZERO,
+};
+
+static const enum index item_l2tpv2_type_ctrl[] = {
+	ITEM_L2TPV2_MSG_CTRL_LENGTH,
+	ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID,
+	ITEM_L2TPV2_MSG_CTRL_SESSION_ID,
+	ITEM_L2TPV2_MSG_CTRL_NS,
+	ITEM_L2TPV2_MSG_CTRL_NR,
+	ITEM_NEXT,
 	ZERO,
 };
 
@@ -3843,31 +3911,46 @@ static const struct token token_list[] = {
 		.next = NEXT(item_l2tpv2),
 		.call = parse_vc,
 	},
-	[ITEM_L2TPV2_COMMON] = {
-		.name = "common",
-		.help = "L2TPv2 common header",
-		.next = NEXT(item_l2tpv2_common),
-	},
-	[ITEM_L2TPV2_COMMON_TYPE] = {
+	[ITEM_L2TPV2_TYPE] = {
 		.name = "type",
-		.help = "type of common header",
-		.next = NEXT(item_l2tpv2_common_type),
+		.help = "type of l2tpv2",
+		.next = NEXT(item_l2tpv2_type),
 		.args = ARGS(ARG_ENTRY_HTON(struct rte_flow_item_l2tpv2)),
 	},
-	[ITEM_L2TPV2_COMMON_TYPE_DATA_L] = {
+	[ITEM_L2TPV2_TYPE_DATA] = {
+		.name = "data",
+		.help = "Type #7: data message without any options",
+		.next = NEXT(item_l2tpv2_type_data),
+		.call = parse_vc_item_l2tpv2_type,
+	},
+	[ITEM_L2TPV2_MSG_DATA_TUNNEL_ID] = {
+		.name = "tunnel_id",
+		.help = "tunnel identifier",
+		.next = NEXT(item_l2tpv2_type_data,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type7.tunnel_id)),
+	},
+	[ITEM_L2TPV2_MSG_DATA_SESSION_ID] = {
+		.name = "session_id",
+		.help = "session identifier",
+		.next = NEXT(item_l2tpv2_type_data,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type7.session_id)),
+	},
+	[ITEM_L2TPV2_TYPE_DATA_L] = {
 		.name = "data_l",
 		.help = "Type #6: data message with length option",
-		.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_DATA_L_LENGTH,
-					ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID,
-					ITEM_L2TPV2_MSG_DATA_L_SESSION_ID,
-					ITEM_NEXT)),
+		.next = NEXT(item_l2tpv2_type_data_l),
 		.call = parse_vc_item_l2tpv2_type,
 	},
 	[ITEM_L2TPV2_MSG_DATA_L_LENGTH] = {
 		.name = "length",
 		.help = "message length",
-		.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_DATA_L_LENGTH,
-					ITEM_L2TPV2_COMMON, ITEM_NEXT),
+		.next = NEXT(item_l2tpv2_type_data_l,
 			     NEXT_ENTRY(COMMON_UNSIGNED),
 			     item_param),
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -3876,8 +3959,7 @@ static const struct token token_list[] = {
 	[ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID] = {
 		.name = "tunnel_id",
 		.help = "tunnel identifier",
-		.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID,
-					ITEM_L2TPV2_COMMON, ITEM_NEXT),
+		.next = NEXT(item_l2tpv2_type_data_l,
 			     NEXT_ENTRY(COMMON_UNSIGNED),
 			     item_param),
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -3886,29 +3968,150 @@ static const struct token token_list[] = {
 	[ITEM_L2TPV2_MSG_DATA_L_SESSION_ID] = {
 		.name = "session_id",
 		.help = "session identifier",
-		.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_DATA_L_SESSION_ID,
-					ITEM_L2TPV2_COMMON, ITEM_NEXT),
+		.next = NEXT(item_l2tpv2_type_data_l,
 			     NEXT_ENTRY(COMMON_UNSIGNED),
 			     item_param),
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
 					     hdr.type6.session_id)),
 	},
-	[ITEM_L2TPV2_COMMON_TYPE_CTRL] = {
+	[ITEM_L2TPV2_TYPE_DATA_S] = {
+		.name = "data_s",
+		.help = "Type #5: data message with ns, nr option",
+		.next = NEXT(item_l2tpv2_type_data_s),
+		.call = parse_vc_item_l2tpv2_type,
+	},
+	[ITEM_L2TPV2_MSG_DATA_S_TUNNEL_ID] = {
+		.name = "tunnel_id",
+		.help = "tunnel identifier",
+		.next = NEXT(item_l2tpv2_type_data_s,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type5.tunnel_id)),
+	},
+	[ITEM_L2TPV2_MSG_DATA_S_SESSION_ID] = {
+		.name = "session_id",
+		.help = "session identifier",
+		.next = NEXT(item_l2tpv2_type_data_s,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type5.session_id)),
+	},
+	[ITEM_L2TPV2_MSG_DATA_S_NS] = {
+		.name = "ns",
+		.help = "sequence number for message",
+		.next = NEXT(item_l2tpv2_type_data_s,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type5.ns)),
+	},
+	[ITEM_L2TPV2_MSG_DATA_S_NR] = {
+		.name = "nr",
+		.help = "sequence number for next receive message",
+		.next = NEXT(item_l2tpv2_type_data_s,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type5.nr)),
+	},
+	[ITEM_L2TPV2_TYPE_DATA_O] = {
+		.name = "data_o",
+		.help = "Type #4: data message with offset option",
+		.next = NEXT(item_l2tpv2_type_data_o),
+		.call = parse_vc_item_l2tpv2_type,
+	},
+	[ITEM_L2TPV2_MSG_DATA_O_TUNNEL_ID] = {
+		.name = "tunnel_id",
+		.help = "tunnel identifier",
+		.next = NEXT(item_l2tpv2_type_data_o,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type4.tunnel_id)),
+	},
+	[ITEM_L2TPV2_MSG_DATA_O_SESSION_ID] = {
+		.name = "session_id",
+		.help = "session identifier",
+		.next = NEXT(item_l2tpv2_type_data_o,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type5.session_id)),
+	},
+	[ITEM_L2TPV2_MSG_DATA_O_OFFSET] = {
+		.name = "offset_size",
+		.help = "the size of offset padding",
+		.next = NEXT(item_l2tpv2_type_data_o,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type4.offset_size)),
+	},
+	[ITEM_L2TPV2_TYPE_DATA_L_S] = {
+		.name = "data_l_s",
+		.help = "Type #3: data message contains length, ns, nr "
+			"options",
+		.next = NEXT(item_l2tpv2_type_data_l_s),
+		.call = parse_vc_item_l2tpv2_type,
+	},
+	[ITEM_L2TPV2_MSG_DATA_L_S_LENGTH] = {
+		.name = "length",
+		.help = "message length",
+		.next = NEXT(item_l2tpv2_type_data_l_s,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type3.length)),
+	},
+	[ITEM_L2TPV2_MSG_DATA_L_S_TUNNEL_ID] = {
+		.name = "tunnel_id",
+		.help = "tunnel identifier",
+		.next = NEXT(item_l2tpv2_type_data_l_s,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type3.tunnel_id)),
+	},
+	[ITEM_L2TPV2_MSG_DATA_L_S_SESSION_ID] = {
+		.name = "session_id",
+		.help = "session identifier",
+		.next = NEXT(item_l2tpv2_type_data_l_s,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type3.session_id)),
+	},
+	[ITEM_L2TPV2_MSG_DATA_L_S_NS] = {
+		.name = "ns",
+		.help = "sequence number for message",
+		.next = NEXT(item_l2tpv2_type_data_l_s,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type3.ns)),
+	},
+	[ITEM_L2TPV2_MSG_DATA_L_S_NR] = {
+		.name = "nr",
+		.help = "sequence number for next receive message",
+		.next = NEXT(item_l2tpv2_type_data_l_s,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type3.nr)),
+	},
+	[ITEM_L2TPV2_TYPE_CTRL] = {
 		.name = "control",
-		.help = "Type #3: conrtol message contains length, ns, nr options",
-		.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_LENGTH,
-					ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID,
-					ITEM_L2TPV2_MSG_CTRL_SESSION_ID,
-					ITEM_L2TPV2_MSG_CTRL_NS,
-					ITEM_L2TPV2_MSG_CTRL_NR,
-					ITEM_NEXT)),
+		.help = "Type #3: conrtol message contains length, ns, nr "
+			"options",
+		.next = NEXT(item_l2tpv2_type_ctrl),
 		.call = parse_vc_item_l2tpv2_type,
 	},
 	[ITEM_L2TPV2_MSG_CTRL_LENGTH] = {
 		.name = "length",
 		.help = "message length",
-		.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_LENGTH,
-					ITEM_L2TPV2_COMMON, ITEM_NEXT),
+		.next = NEXT(item_l2tpv2_type_ctrl,
 			     NEXT_ENTRY(COMMON_UNSIGNED),
 			     item_param),
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -3917,8 +4120,7 @@ static const struct token token_list[] = {
 	[ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID] = {
 		.name = "tunnel_id",
 		.help = "tunnel identifier",
-		.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID,
-					ITEM_L2TPV2_COMMON, ITEM_NEXT),
+		.next = NEXT(item_l2tpv2_type_ctrl,
 			     NEXT_ENTRY(COMMON_UNSIGNED),
 			     item_param),
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -3927,8 +4129,7 @@ static const struct token token_list[] = {
 	[ITEM_L2TPV2_MSG_CTRL_SESSION_ID] = {
 		.name = "session_id",
 		.help = "session identifier",
-		.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_SESSION_ID,
-					ITEM_L2TPV2_COMMON, ITEM_NEXT),
+		.next = NEXT(item_l2tpv2_type_ctrl,
 			     NEXT_ENTRY(COMMON_UNSIGNED),
 			     item_param),
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -3937,8 +4138,7 @@ static const struct token token_list[] = {
 	[ITEM_L2TPV2_MSG_CTRL_NS] = {
 		.name = "ns",
 		.help = "sequence number for message",
-		.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_NS,
-					ITEM_L2TPV2_COMMON, ITEM_NEXT),
+		.next = NEXT(item_l2tpv2_type_ctrl,
 			     NEXT_ENTRY(COMMON_UNSIGNED),
 			     item_param),
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -3947,8 +4147,7 @@ static const struct token token_list[] = {
 	[ITEM_L2TPV2_MSG_CTRL_NR] = {
 		.name = "nr",
 		.help = "sequence number for next receive message",
-		.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_NS,
-					ITEM_L2TPV2_COMMON, ITEM_NEXT),
+		.next = NEXT(item_l2tpv2_type_ctrl,
 			     NEXT_ENTRY(COMMON_UNSIGNED),
 			     item_param),
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -5889,11 +6088,23 @@ parse_vc_item_l2tpv2_type(struct context *ctx, const struct token *token,
 	if (parse_default(ctx, token, str, len, NULL, 0) < 0)
 		return -1;
 	switch (ctx->curr) {
-	case ITEM_L2TPV2_COMMON_TYPE_DATA_L:
-		msg_type |= 0x4000;
+	case ITEM_L2TPV2_TYPE_DATA:
+		msg_type |= RTE_L2TPV2_MSG_TYPE_DATA;
+		break;
+	case ITEM_L2TPV2_TYPE_DATA_L:
+		msg_type |= RTE_L2TPV2_MSG_TYPE_DATA_L;
+		break;
+	case ITEM_L2TPV2_TYPE_DATA_S:
+		msg_type |= RTE_L2TPV2_MSG_TYPE_DATA_S;
+		break;
+	case ITEM_L2TPV2_TYPE_DATA_O:
+		msg_type |= RTE_L2TPV2_MSG_TYPE_DATA_O;
+		break;
+	case ITEM_L2TPV2_TYPE_DATA_L_S:
+		msg_type |= RTE_L2TPV2_MSG_TYPE_DATA_L_S;
 		break;
-	case ITEM_L2TPV2_COMMON_TYPE_CTRL:
-		msg_type |= 0xC800;
+	case ITEM_L2TPV2_TYPE_CTRL:
+		msg_type |= RTE_L2TPV2_MSG_TYPE_CONTROL;
 		break;
 	default:
 		return -1;
lib/net/rte_l2tpv2.h +13 -0
index 1f3ad3f03c..d41123a504 100644
@@ -78,6 +78,19 @@
 extern "C" {
 #endif
 
+/*
+ * L2TPv2 Message Type
+ */
+#define RTE_L2TPV2_MSG_TYPE_CONTROL	0xC802
+#define RTE_L2TPV2_MSG_TYPE_DATA	0x0002
+#define RTE_L2TPV2_MSG_TYPE_DATA_L	0x4002
+#define RTE_L2TPV2_MSG_TYPE_DATA_S	0x0802
+#define RTE_L2TPV2_MSG_TYPE_DATA_O	0x0202
+#define RTE_L2TPV2_MSG_TYPE_DATA_L_S	0x4802
+#define RTE_L2TPV2_MSG_TYPE_DATA_L_O	0x4202
+#define RTE_L2TPV2_MSG_TYPE_DATA_S_O	0x0A02
+#define RTE_L2TPV2_MSG_TYPE_DATA_L_S_O	0x4A02
+
 /**
  * L2TPv2 Common Header
  */
Signature · 1 line
2.25.1
author
#19 lore raw

PATCH v4 4/6 common/iavf: add session ID fields for L2TPv2

In reply to Jie Wang

Add virtchnl fields session ID of L2TPv2 for AVF HASH.

---
 drivers/common/iavf/virtchnl.h | 4 ++++
 1 file changed, 4 insertions(+)
drivers/common/iavf/virtchnl.h +4 -0
index 80e754a1b2..3e44eca7d8 100644
@@ -1653,6 +1653,10 @@ enum virtchnl_proto_hdr_field {
 		PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_GTPU_EH_PDU_DWN),
 	VIRTCHNL_PROTO_HDR_GTPU_UP_QFI =
 		PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_GTPU_EH_PDU_UP),
+	/* L2TPv2 */
+	VIRTCHNL_PROTO_HDR_L2TPV2_SESS_ID =
+		PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_L2TPV2),
+	VIRTCHNL_PROTO_HDR_L2TPV2_LEN_SESS_ID,
 };
 
 struct virtchnl_proto_hdr {
Signature · 1 line
2.25.1
author
#20 lore raw

PATCH v4 5/6 net/iavf: support L2TPv2 for AVF HASH

In reply to Jie Wang

Add support for PPP over L2TPv2 over UDP protocol and L2TPv2 protocol RSS hash based on outer MAC src address and L2TPv2 session ID.

Patterns are listed below:
eth/ipv4/udp/l2tpv2
eth/ipv4/udp/l2tpv2/ppp
eth/ipv6/udp/l2tpv2
eth/ipv6/udp/l2tpv2/ppp

---
 doc/guides/rel_notes/release_22_03.rst |  6 ++
 drivers/net/iavf/iavf.h                |  2 +
 drivers/net/iavf/iavf_generic_flow.c   | 34 +++++++++++
 drivers/net/iavf/iavf_generic_flow.h   |  6 ++
 drivers/net/iavf/iavf_hash.c           | 83 ++++++++++++++++++++++++--
 5 files changed, 127 insertions(+), 4 deletions(-)
doc/guides/rel_notes/release_22_03.rst +6 -0
index 9a507ab9ea..0d1e4a0b61 100644
@@ -64,6 +64,12 @@ New Features
 
   * Added rte_flow support for matching GENEVE packets.
 
+* **Updated Intel iavf driver.**
+
+  Added L2TPv2(include PPP over L2TPv2) RSS hash distribute packets
+  based on outer MAC src address and L2TPv2 session ID.
+
+
 Removed Items
 -------------
 
drivers/net/iavf/iavf.h +2 -0
index 0bb5698583..a01d18e61b 100644
@@ -93,6 +93,8 @@
 
 #define IAVF_VLAN_TAG_PCP_OFFSET 13
 
+#define IAVF_L2TPV2_FLAGS_LEN	0x4000
+
 struct iavf_adapter;
 struct iavf_rx_queue;
 struct iavf_tx_queue;
drivers/net/iavf/iavf_generic_flow.c +34 -0
index 2befa125ac..1de4187e67 100644
@@ -1611,6 +1611,40 @@ enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_udp[] = {
 	RTE_FLOW_ITEM_TYPE_END,
 };
 
+enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_L2TPV2,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp[] = {
+	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_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_L2TPV2,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2_ppp[] = {
+	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_END,
+};
+
 /* PPPoL2TPv2oUDP */
 enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4[] = {
 	RTE_FLOW_ITEM_TYPE_ETH,
drivers/net/iavf/iavf_generic_flow.h +6 -0
index 3681a96b31..107bbc1a23 100644
@@ -410,6 +410,12 @@ 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[];
 
+/* L2TPv2 */
+extern enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2_ppp[];
+
 /* 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[];
drivers/net/iavf/iavf_hash.c +79 -4

152 lines not on this page · raw message

Signature · 1 line
2.25.1
#21 lore raw

RE: [PATCH v4 5/6] net/iavf: support L2TPv2 for AVF HASH

Quoted 38 lines

-----Original Message-----
From: Wang, Jie1X <[email protected]>
Sent: Tuesday, February 8, 2022 4:39 PM
To: [email protected]
Cc: Yang, SteveX <[email protected]>; [email protected]; Singh, Aman Deep <[email protected]>; Yigit, Ferruh <[email protected]>; [email protected]; [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>; [email protected]; Wang, Jie1X <[email protected]>
Subject: [PATCH v4 5/6] net/iavf: support L2TPv2 for AVF HASH

Add support for PPP over L2TPv2 over UDP protocol and L2TPv2 protocol RSS hash based on outer MAC src address and L2TPv2 session ID.

Patterns are listed below:
eth/ipv4/udp/l2tpv2
eth/ipv4/udp/l2tpv2/ppp
eth/ipv6/udp/l2tpv2
eth/ipv6/udp/l2tpv2/ppp

---
 doc/guides/rel_notes/release_22_03.rst |  6 ++
 drivers/net/iavf/iavf.h                |  2 +
 drivers/net/iavf/iavf_generic_flow.c   | 34 +++++++++++
 drivers/net/iavf/iavf_generic_flow.h   |  6 ++
 drivers/net/iavf/iavf_hash.c           | 83 ++++++++++++++++++++++++--
 5 files changed, 127 insertions(+), 4 deletions(-)
doc/guides/rel_notes/release_22_03.rst +0 -0
index 9a507ab9ea..0d1e4a0b61 100644

doc/guides/rel_notes/release_22_03.rst New Features · line 70

Quoted 7 lines
doc/guides/rel_notes/release_22_03.rst +4 -0
@@ -64,6 +64,12 @@ New Features
 
   * Added rte_flow support for matching GENEVE packets.
 
+* **Updated Intel iavf driver.**
+
+  Added L2TPv2(include PPP over L2TPv2) RSS hash distribute packets
+ based on outer MAC src address and L2TPv2 session ID.

Add * on the front.

Quoted 13 lines
doc/guides/rel_notes/release_22_03.rst +2 -0
+
+
 Removed Items
 -------------
 
drivers/net/iavf/iavf.h index renamed from drivers/net/iavf/iavf.h +0 -0

0bb5698583..a01d18e61b 100644

drivers/net/iavf/iavf.h +0 -0
@@ -93,6 +93,8 @@
 
 #define IAVF_VLAN_TAG_PCP_OFFSET 13
 

<...>

drivers/net/iavf/iavf.h

Quoted 4 lines
drivers/net/iavf/iavf.h +4 -0
+/* L2TPv2 */
+#define IAVF_RSS_TYPE_ETH_L2TPV2	(RTE_ETH_RSS_L2TPV2 | \
+					 RTE_ETH_RSS_ETH | \
+					 RTE_ETH_RSS_L2_SRC_ONLY)

Should we limit with L2_SRC_ONLY?

Quoted 5 lines

+
/**
* Supported pattern for hash.
* The first member is pattern item type, @@ -547,6 +589,8 @@ static struct
iavf_pattern_match_item iavf_hash_pattern_list[] = {

<...>

Quoted 2 lines

--
2.25.1

#22 lore raw

RE: [PATCH v4 5/6] net/iavf: support L2TPv2 for AVF HASH

Quoted 53 lines

-----Original Message-----
From: Xing, Beilei <[email protected]>
Sent: Wednesday, February 9, 2022 3:02 PM
To: Wang, Jie1X <[email protected]>; [email protected]
Cc: Yang, SteveX <[email protected]>; [email protected]; Singh, Aman Deep <[email protected]>; Yigit, Ferruh <[email protected]>; [email protected]; [email protected]; Wu, Jingjing <[email protected]>; Zhang, Qi Z <[email protected]>; [email protected]
Subject: RE: [PATCH v4 5/6] net/iavf: support L2TPv2 for AVF HASH

Quoted 38 lines

-----Original Message-----
From: Wang, Jie1X <[email protected]>
Sent: Tuesday, February 8, 2022 4:39 PM
To: [email protected]
Cc: Yang, SteveX <[email protected]>; [email protected]; Singh, Aman Deep <[email protected]>; Yigit, Ferruh <[email protected]>; [email protected]; [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>; [email protected]; Wang, Jie1X <[email protected]>
Subject: [PATCH v4 5/6] net/iavf: support L2TPv2 for AVF HASH

Add support for PPP over L2TPv2 over UDP protocol and L2TPv2 protocol RSS hash based on outer MAC src address and L2TPv2 session ID.

Patterns are listed below:
eth/ipv4/udp/l2tpv2
eth/ipv4/udp/l2tpv2/ppp
eth/ipv6/udp/l2tpv2
eth/ipv6/udp/l2tpv2/ppp

---
 doc/guides/rel_notes/release_22_03.rst |  6 ++
 drivers/net/iavf/iavf.h                |  2 +
 drivers/net/iavf/iavf_generic_flow.c   | 34 +++++++++++
 drivers/net/iavf/iavf_generic_flow.h   |  6 ++
 drivers/net/iavf/iavf_hash.c           | 83 ++++++++++++++++++++++++--
 5 files changed, 127 insertions(+), 4 deletions(-)
doc/guides/rel_notes/release_22_03.rst +0 -0
index 9a507ab9ea..0d1e4a0b61 100644
@@ -64,6 +64,12 @@ New Features
 
Quoted 9 lines

doc/guides/rel_notes/release_22_03.rst New Features · line 70

Quoted 6 lines
doc/guides/rel_notes/release_22_03.rst +4 -0
   * Added rte_flow support for matching GENEVE packets.
 
+* **Updated Intel iavf driver.**
+
+  Added L2TPv2(include PPP over L2TPv2) RSS hash distribute packets
+ based on outer MAC src address and L2TPv2 session ID.

Add * on the front.

I'll update it.

Quoted 17 lines
Quoted 13 lines
doc/guides/rel_notes/release_22_03.rst +2 -0
+
+
 Removed Items
 -------------
 
drivers/net/iavf/iavf.h index renamed from drivers/net/iavf/iavf.h +0 -0

0bb5698583..a01d18e61b 100644

drivers/net/iavf/iavf.h +0 -0
@@ -93,6 +93,8 @@
 
 #define IAVF_VLAN_TAG_PCP_OFFSET 13
 

<...>

Quoted 7 lines

drivers/net/iavf/iavf.h

Quoted 4 lines
drivers/net/iavf/iavf.h +4 -0
+/* L2TPv2 */
+#define IAVF_RSS_TYPE_ETH_L2TPV2	(RTE_ETH_RSS_L2TPV2 | \
+					 RTE_ETH_RSS_ETH | \
+					 RTE_ETH_RSS_L2_SRC_ONLY)

Should we limit with L2_SRC_ONLY?

In the requirement, it only requires MAC SA to be used as RSS hash input set.

Quoted 12 lines
Quoted 5 lines

+
/**
* Supported pattern for hash.
* The first member is pattern item type, @@ -547,6 +589,8 @@ static
struct iavf_pattern_match_item iavf_hash_pattern_list[] = {

<...>

Quoted 2 lines

--
2.25.1

#23 lore raw

RE: [PATCH v4 5/6] net/iavf: support L2TPv2 for AVF HASH

In reply to Xing, Beilei
Quoted 79 lines

-----Original Message-----
From: Xing, Beilei <[email protected]>
Sent: Wednesday, February 9, 2022 3:02 PM
To: Wang, Jie1X <[email protected]>; [email protected]
Cc: Yang, SteveX <[email protected]>; [email protected]; Singh, Aman Deep <[email protected]>; Yigit, Ferruh <[email protected]>; [email protected]; [email protected]; Wu, Jingjing <[email protected]>; Zhang, Qi Z <[email protected]>; [email protected]
Subject: RE: [PATCH v4 5/6] net/iavf: support L2TPv2 for AVF HASH

Quoted 37 lines

-----Original Message-----
From: Wang, Jie1X <[email protected]>
Sent: Tuesday, February 8, 2022 4:39 PM
To: [email protected]
Cc: Yang, SteveX <[email protected]>; [email protected]; Singh, Aman Deep <[email protected]>; Yigit, Ferruh <[email protected]>; [email protected]; [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>; [email protected]; Wang, Jie1X <[email protected]>
Subject: [PATCH v4 5/6] net/iavf: support L2TPv2 for AVF HASH

Add support for PPP over L2TPv2 over UDP protocol and L2TPv2 protocol RSS hash based on outer MAC src address and L2TPv2 session ID.

Patterns are listed below:
eth/ipv4/udp/l2tpv2
eth/ipv4/udp/l2tpv2/ppp
eth/ipv6/udp/l2tpv2
eth/ipv6/udp/l2tpv2/ppp

---
 doc/guides/rel_notes/release_22_03.rst |  6 ++
 drivers/net/iavf/iavf.h                |  2 +
 drivers/net/iavf/iavf_generic_flow.c   | 34 +++++++++++
 drivers/net/iavf/iavf_generic_flow.h   |  6 ++
 drivers/net/iavf/iavf_hash.c           | 83 ++++++++++++++++++++++++--
 5 files changed, 127 insertions(+), 4 deletions(-)
doc/guides/rel_notes/release_22_03.rst +0 -0
index 9a507ab9ea..0d1e4a0b61 100644

doc/guides/rel_notes/release_22_03.rst New Features · line 70

Quoted 7 lines
doc/guides/rel_notes/release_22_03.rst +4 -0
@@ -64,6 +64,12 @@ New Features
 
   * Added rte_flow support for matching GENEVE packets.
 
+* **Updated Intel iavf driver.**
+
+  Added L2TPv2(include PPP over L2TPv2) RSS hash distribute packets
+ based on outer MAC src address and L2TPv2 session ID.

Add * on the front.

Quoted 13 lines
doc/guides/rel_notes/release_22_03.rst +2 -0
+
+
 Removed Items
 -------------
 
drivers/net/iavf/iavf.h index renamed from drivers/net/iavf/iavf.h +0 -0

0bb5698583..a01d18e61b 100644

drivers/net/iavf/iavf.h +0 -0
@@ -93,6 +93,8 @@
 
 #define IAVF_VLAN_TAG_PCP_OFFSET 13
 

<...>

Quoted 6 lines

drivers/net/iavf/iavf.h

Quoted 4 lines
drivers/net/iavf/iavf.h +4 -0
+/* L2TPv2 */
+#define IAVF_RSS_TYPE_ETH_L2TPV2	(RTE_ETH_RSS_L2TPV2 | \
+					 RTE_ETH_RSS_ETH | \
+					 RTE_ETH_RSS_L2_SRC_ONLY)

Should we limit with L2_SRC_ONLY?

+1, no need to intent to limit the driver's capability, src/dst could be enabled at the same time.

Quoted 14 lines
Quoted 6 lines

+
/**
* Supported pattern for hash.
* The first member is pattern item type, @@ -547,6 +589,8 @@ static
struct iavf_pattern_match_item iavf_hash_pattern_list[] = {

<...>

Quoted 2 lines

--
2.25.1

author
#24 lore raw

PATCH v4 6/6 net/iavf: support L2TPv2 for AVF FDIR

In reply to Jie Wang

Add support for L2TPv2(include PPP over L2TPv2) protocols FDIR based on outer MAC src address and L2TPv2 session ID.

Add support for PPPoL2TPv2oUDP protocols FDIR based on inner IP src/dst address and UDP/TCP src/dst port.

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

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

---
 doc/guides/rel_notes/release_22_03.rst |   8 +-
 drivers/net/iavf/iavf_fdir.c           | 174 +++++++++++++++++++++----
 drivers/net/iavf/iavf_generic_flow.h   |   4 +
 3 files changed, 156 insertions(+), 30 deletions(-)
doc/guides/rel_notes/release_22_03.rst +6 -2
index 0d1e4a0b61..5a73ccc14e 100644
@@ -66,8 +66,12 @@ New Features
 
 * **Updated Intel iavf driver.**
 
-  Added L2TPv2(include PPP over L2TPv2) RSS hash distribute packets
-  based on outer MAC src address and L2TPv2 session ID.
+  * Added L2TPv2(include PPP over L2TPv2) RSS hash distribute packets
+    based on outer MAC src address and L2TPv2 session ID.
+  * Added L2TPv2(include PPP over L2TPv2) FDIR distribute packets
+    based on outer MAC src address and L2TPv2 session ID.
+  * Added PPPoL2TPv2oUDP FDIR distribute packets based on inner IP
+    src/dst address and UDP/TCP src/dst port.
 
 
 Removed Items
drivers/net/iavf/iavf_fdir.c +146 -28

214 lines not on this page · raw message

drivers/net/iavf/iavf_generic_flow.h +4 -0
index 107bbc1a23..f6af176073 100644
@@ -35,6 +35,7 @@
 #define IAVF_PROT_L2TPV3OIP	    (1ULL << 24)
 #define IAVF_PROT_PFCP		    (1ULL << 25)
 #define IAVF_PROT_ECPRI		    (1ULL << 26)
+#define IAVF_PROT_L2TPV2	    (1ULL << 27)
 
 
 /* field */
@@ -62,6 +63,7 @@
 #define IAVF_PFCP_SEID		    (1ULL << 43)
 #define IAVF_ECPRI_PC_RTC_ID	    (1ULL << 42)
 #define IAVF_IP_PKID		    (1ULL << 41)
+#define IAVF_L2TPV2_SESSION_ID	    (1ULL << 40)
 
 /* input set */
 
@@ -175,6 +177,8 @@
 	(IAVF_PROT_PFCP | IAVF_PFCP_S_FIELD | IAVF_PFCP_SEID)
 #define IAVF_INSET_ECPRI \
 	(IAVF_PROT_ECPRI | IAVF_ECPRI_PC_RTC_ID)
+#define IAVF_INSET_L2TPV2 \
+	(IAVF_PROT_L2TPV2 | IAVF_L2TPV2_SESSION_ID)
 
 /* empty pattern */
 extern enum rte_flow_item_type iavf_pattern_empty[];
Signature · 1 line
2.25.1
#25 lore raw

RE: [PATCH v4 6/6] net/iavf: support L2TPv2 for AVF FDIR

Quoted 41 lines

-----Original Message-----
From: Wang, Jie1X <[email protected]>
Sent: Tuesday, February 8, 2022 4:39 PM
To: [email protected]
Cc: Yang, SteveX <[email protected]>; [email protected]; Singh, Aman Deep <[email protected]>; Yigit, Ferruh <[email protected]>; [email protected]; [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>; [email protected]; Wang, Jie1X <[email protected]>
Subject: [PATCH v4 6/6] net/iavf: support L2TPv2 for AVF FDIR

Add support for L2TPv2(include PPP over L2TPv2) protocols FDIR based on outer MAC src address and L2TPv2 session ID.

Add support for PPPoL2TPv2oUDP protocols FDIR based on inner IP src/dst address and UDP/TCP src/dst port.

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

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

---
 doc/guides/rel_notes/release_22_03.rst |   8 +-
 drivers/net/iavf/iavf_fdir.c           | 174 +++++++++++++++++++++----
 drivers/net/iavf/iavf_generic_flow.h   |   4 +
 3 files changed, 156 insertions(+), 30 deletions(-)
doc/guides/rel_notes/release_22_03.rst +0 -0
index 0d1e4a0b61..5a73ccc14e 100644

doc/guides/rel_notes/release_22_03.rst New Features · line 70

Quoted 7 lines
doc/guides/rel_notes/release_22_03.rst +2 -2
@@ -66,8 +66,12 @@ New Features
 
 * **Updated Intel iavf driver.**
 
-  Added L2TPv2(include PPP over L2TPv2) RSS hash distribute packets
-  based on outer MAC src address and L2TPv2 session ID.
+  * Added L2TPv2(include PPP over L2TPv2) RSS hash distribute packets
+    based on outer MAC src address and L2TPv2 session ID.

Should fix in the patch 5/6.

Quoted 12 lines
doc/guides/rel_notes/release_22_03.rst +4 -0
+  * Added L2TPv2(include PPP over L2TPv2) FDIR distribute packets
+    based on outer MAC src address and L2TPv2 session ID.
+  * Added PPPoL2TPv2oUDP FDIR distribute packets based on inner IP
+    src/dst address and UDP/TCP src/dst port.
 
 
 Removed Items
drivers/net/iavf/iavf_fdir.c index renamed from drivers/net/iavf/iavf_fdir.c +0 -0

b63aaca91d..2583b899aa 100644

drivers/net/iavf/iavf_fdir.c line 172

Quoted 5 lines
drivers/net/iavf/iavf_fdir.c +2 -0
@@ -168,6 +168,31 @@
 	IAVF_FDIR_INSET_GRE_IPV6 | IAVF_INSET_TUN_UDP_SRC_PORT | \
 	IAVF_INSET_TUN_UDP_DST_PORT)
 
+#define IAVF_FDIR_INSET_L2TPV2 (\
+	IAVF_INSET_SMAC | IAVF_INSET_L2TPV2)

The same comment for FDIR: should we limit with source MAC?

drivers/net/iavf/iavf_fdir.c line 176

Quoted 4 lines
drivers/net/iavf/iavf_fdir.c +4 -0
+
+#define IAVF_FDIR_INSET_L2TPV2_PPP_IPV4 (\
+	IAVF_INSET_TUN_IPV4_SRC | IAVF_INSET_TUN_IPV4_DST)
+

<...>

BR,
Beilei

#26 lore raw

RE: [PATCH v4 6/6] net/iavf: support L2TPv2 for AVF FDIR

Quoted 80 lines

-----Original Message-----
From: Xing, Beilei <[email protected]>
Sent: Wednesday, February 9, 2022 3:31 PM
To: Wang, Jie1X <[email protected]>; [email protected]
Cc: Yang, SteveX <[email protected]>; [email protected]; Singh, Aman Deep <[email protected]>; Yigit, Ferruh <[email protected]>; [email protected]; [email protected]; Wu, Jingjing <[email protected]>; Zhang, Qi Z <[email protected]>; [email protected]
Subject: RE: [PATCH v4 6/6] net/iavf: support L2TPv2 for AVF FDIR

Quoted 40 lines

-----Original Message-----
From: Wang, Jie1X <[email protected]>
Sent: Tuesday, February 8, 2022 4:39 PM
To: [email protected]
Cc: Yang, SteveX <[email protected]>; [email protected]; Singh, Aman Deep <[email protected]>; Yigit, Ferruh <[email protected]>; [email protected]; [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>; [email protected]; Wang, Jie1X <[email protected]>
Subject: [PATCH v4 6/6] net/iavf: support L2TPv2 for AVF FDIR

Add support for L2TPv2(include PPP over L2TPv2) protocols FDIR based on outer MAC src address and L2TPv2 session ID.

Add support for PPPoL2TPv2oUDP protocols FDIR based on inner IP src/dst address and UDP/TCP src/dst port.

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

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

---
 doc/guides/rel_notes/release_22_03.rst |   8 +-
 drivers/net/iavf/iavf_fdir.c           | 174 +++++++++++++++++++++----
 drivers/net/iavf/iavf_generic_flow.h   |   4 +
 3 files changed, 156 insertions(+), 30 deletions(-)
doc/guides/rel_notes/release_22_03.rst +0 -0
index 0d1e4a0b61..5a73ccc14e 100644

doc/guides/rel_notes/release_22_03.rst New Features · line 70

Quoted 7 lines
doc/guides/rel_notes/release_22_03.rst +2 -2
@@ -66,8 +66,12 @@ New Features
 
 * **Updated Intel iavf driver.**
 
-  Added L2TPv2(include PPP over L2TPv2) RSS hash distribute packets
-  based on outer MAC src address and L2TPv2 session ID.
+  * Added L2TPv2(include PPP over L2TPv2) RSS hash distribute packets
+    based on outer MAC src address and L2TPv2 session ID.

Should fix in the patch 5/6.

Quoted 15 lines
doc/guides/rel_notes/release_22_03.rst +4 -0
+  * Added L2TPv2(include PPP over L2TPv2) FDIR distribute packets
+    based on outer MAC src address and L2TPv2 session ID.
+  * Added PPPoL2TPv2oUDP FDIR distribute packets based on inner IP
+    src/dst address and UDP/TCP src/dst port.
 
 
 Removed Items
(quoted diff) +0 -0

b/drivers/net/iavf/iavf_fdir.c index b63aaca91d..2583b899aa 100644

drivers/net/iavf/iavf_fdir.c +0 -0
@@ -168,6 +168,31 @@
 	IAVF_FDIR_INSET_GRE_IPV6 | IAVF_INSET_TUN_UDP_SRC_PORT | \
 	IAVF_INSET_TUN_UDP_DST_PORT)
 
Quoted 5 lines

drivers/net/iavf/iavf_fdir.c line 172

Quoted 2 lines
drivers/net/iavf/iavf_fdir.c +2 -0
+#define IAVF_FDIR_INSET_L2TPV2 (\
+	IAVF_INSET_SMAC | IAVF_INSET_L2TPV2)

The same comment for FDIR: should we limit with source MAC?

It is same as the RSS hash input set.

Quoted 9 lines

drivers/net/iavf/iavf_fdir.c line 176

Quoted 4 lines
drivers/net/iavf/iavf_fdir.c +4 -0
+
+#define IAVF_FDIR_INSET_L2TPV2_PPP_IPV4 (\
+	IAVF_INSET_TUN_IPV4_SRC | IAVF_INSET_TUN_IPV4_DST)
+

<...>

BR,
Beilei

#27 lore raw
In reply to Jie Wang
Quoted 22 lines · Jie Wang

Support IAVF L2TPv2(include PPP over L2tpv2) RSS hash and flow director. Required to distribute packets based on outer MAC src address and L2TPv2 session ID.

Support IAVF PPPoL2TPv2oUDP flow director. Required to distribute packets based on inner IP src+dest address and TCP/UDP src+dest port.

---
v4:
* update new macros in ethdev.
* update commit log.
* rebase the main branch code.
v3:
* update new macros in ethdev.
* update commit log.
* rebase the main branch code.
v2:
* upadte release notes.
* add comment for RTE_ETH_RSS_L2TPV2.
* update ipv6 l2tpv2 flow item.
* rebase the main branch code.

Quoted 8 lines

Jie Wang (6):
ethdev: add L2TPv2 RSS offload type
net: fix L2TPv2 common header
app/testpmd: add 6 types of L2TPv2 message
common/iavf: add session ID fields for L2TPv2
net/iavf: support L2TPv2 for AVF HASH
net/iavf: support L2TPv2 for AVF FDIR

Hi Jie, Qi,

Can you please make iavf patches reviewed, so the set can be merged as whole, or driver changes will block the ethdev changes.

#28 lore raw
Quoted 45 lines

-----Original Message-----
From: Yigit, Ferruh <[email protected]>
Sent: Tuesday, February 8, 2022 10:45 PM
To: Wang, Jie1X <[email protected]>; [email protected]; Zhang, Qi Z <[email protected]>
Cc: Yang, SteveX <[email protected]>; [email protected]; Singh, Aman Deep <[email protected]>; [email protected]; [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; [email protected]
Subject: Re: [PATCH v4 0/6] support L2TPv2 for AVF RSS hash and FDIR

Quoted 22 lines · Jie Wang

Support IAVF L2TPv2(include PPP over L2tpv2) RSS hash and flow director. Required to distribute packets based on outer MAC src address and L2TPv2 session ID.

Support IAVF PPPoL2TPv2oUDP flow director. Required to distribute packets based on inner IP src+dest address and TCP/UDP src+dest port.

---
v4:
* update new macros in ethdev.
* update commit log.
* rebase the main branch code.
v3:
* update new macros in ethdev.
* update commit log.
* rebase the main branch code.
v2:
* upadte release notes.
* add comment for RTE_ETH_RSS_L2TPV2.
* update ipv6 l2tpv2 flow item.
* rebase the main branch code.

Quoted 8 lines

Jie Wang (6):
ethdev: add L2TPv2 RSS offload type
net: fix L2TPv2 common header
app/testpmd: add 6 types of L2TPv2 message
common/iavf: add session ID fields for L2TPv2
net/iavf: support L2TPv2 for AVF HASH
net/iavf: support L2TPv2 for AVF FDIR

Quoted 4 lines

Hi Jie, Qi,

Can you please make iavf patches reviewed, so the set can be merged as whole, or driver changes will block the ethdev changes.

Hi Ferruh:

The pmd part overall looks ok for me, but still need some rework, I think it should not block the part of ethdev merge, if we are close to deadline.

Thanks
Qi

author
#29 lore raw

v5 cover support L2TPv2 for AVF RSS hash and FDIR

In reply to Jie Wang

Support IAVF L2TPv2(include PPP over L2tpv2) RSS hash and flow director. Required to distribute packets based on outer MAC src address and L2TPv2 session ID.

Support IAVF PPPoL2TPv2oUDP flow director. Required to distribute packets based on inner IP src+dest address and TCP/UDP src+dest port.

---
v5:
* remove the comment of new macros.
* update cmd_help_long_parsed() and testpmd_funcs.rst.
* update RSS hash/FDIR input set.
* rebase the main branch code.
v4:
* update new macros in ethdev.
* update commit log.
* rebase the main branch code.
v3:
* update new macros in ethdev.
* update commit log.
* rebase the main branch code.
v2:
* upadte release notes.
* add comment for RTE_ETH_RSS_L2TPV2.
* update ipv6 l2tpv2 flow item.
* rebase the main branch code.

Jie Wang (6):
ethdev: add L2TPv2 RSS offload type
net: fix L2TPv2 common header
app/testpmd: add 6 types of L2TPv2 message
common/iavf: add session ID fields for L2TPv2
net/iavf: support L2TPv2 for AVF HASH
net/iavf: support L2TPv2 for AVF FDIR

 app/test-pmd/cmdline.c                      |  16 +-
 app/test-pmd/cmdline_flow.c                 | 313 ++++++++++++++++----
 app/test-pmd/config.c                       |   3 +-
 doc/guides/rel_notes/release_22_03.rst      |  14 +
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  39 ++-
 drivers/common/iavf/virtchnl.h              |   4 +
 drivers/net/iavf/iavf.h                     |   2 +
 drivers/net/iavf/iavf_fdir.c                | 169 +++++++++--
 drivers/net/iavf/iavf_generic_flow.c        |  34 +++
 drivers/net/iavf/iavf_generic_flow.h        |  10 +
 drivers/net/iavf/iavf_hash.c                |  81 ++++-
 lib/ethdev/rte_ethdev.h                     |   2 +
 lib/net/rte_l2tpv2.h                        |  33 ++-
 13 files changed, 615 insertions(+), 105 deletions(-)
Signature · 1 line
2.25.1
author
#30 lore raw

PATCH v5 1/6 ethdev: add L2TPv2 RSS offload type

This patch defines new RSS offload type for L2TPv2, which is required when users want to distribute packets based on the L2TPv2 session ID field.

---
 app/test-pmd/cmdline.c                      | 16 +++++++++-------
 app/test-pmd/config.c                       |  3 ++-
 doc/guides/rel_notes/release_22_03.rst      |  5 +++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  4 ++--
 lib/ethdev/rte_ethdev.h                     |  2 ++
 5 files changed, 20 insertions(+), 10 deletions(-)
app/test-pmd/cmdline.c +9 -7
index 9f10f35b40..e2fb7c9905 100644
@@ -798,8 +798,8 @@ static void cmd_help_long_parsed(void *parsed_result,
 			"receive buffers available.\n\n"
 
 			"port config all rss (all|default|ip|tcp|udp|sctp|"
-			"ether|port|vxlan|geneve|nvgre|vxlan-gpe|ecpri|mpls|none|level-default|"
-			"level-outer|level-inner|<flowtype_id>)\n"
+			"ether|port|vxlan|geneve|nvgre|vxlan-gpe|ecpri|mpls|ipv4-chksum|l2tpv2|"
+			"none|level-default|level-outer|level-inner|<flowtype_id>)\n"
 			"    Set the RSS mode.\n\n"
 
 			"port config port-id rss reta (hash,queue)[,(hash,queue)]\n"
@@ -2183,7 +2183,7 @@ cmd_config_rss_parsed(void *parsed_result,
 			RTE_ETH_RSS_TCP | RTE_ETH_RSS_UDP | RTE_ETH_RSS_SCTP |
 			RTE_ETH_RSS_L2_PAYLOAD | RTE_ETH_RSS_L2TPV3 | RTE_ETH_RSS_ESP |
 			RTE_ETH_RSS_AH | RTE_ETH_RSS_PFCP | RTE_ETH_RSS_GTPU |
-			RTE_ETH_RSS_ECPRI;
+			RTE_ETH_RSS_ECPRI | RTE_ETH_RSS_L2TPV2;
 	else if (!strcmp(res->value, "eth"))
 		rss_conf.rss_hf = RTE_ETH_RSS_ETH;
 	else if (!strcmp(res->value, "vlan"))
@@ -2248,6 +2248,8 @@ cmd_config_rss_parsed(void *parsed_result,
 		rss_conf.rss_hf = RTE_ETH_RSS_MPLS;
 	else if (!strcmp(res->value, "ipv4-chksum"))
 		rss_conf.rss_hf = RTE_ETH_RSS_IPV4_CHKSUM;
+	else if (!strcmp(res->value, "l2tpv2"))
+		rss_conf.rss_hf = RTE_ETH_RSS_L2TPV2;
 	else if (!strcmp(res->value, "none"))
 		rss_conf.rss_hf = 0;
 	else if (!strcmp(res->value, "level-default")) {
@@ -2318,8 +2320,8 @@ cmdline_parse_inst_t cmd_config_rss = {
 	.data = NULL,
 	.help_str = "port config all rss "
 		"all|default|eth|vlan|ip|tcp|udp|sctp|ether|port|vxlan|geneve|"
-		"nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|ecpri|mpls|none|level-default|"
-		"level-outer|level-inner|ipv4-chksum|<flowtype_id>",
+		"nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|ecpri|mpls|ipv4-chksum|l2tpv2|"
+		"none|level-default|level-outer|level-inner|<flowtype_id>",
 	.tokens = {
 		(void *)&cmd_config_rss_port,
 		(void *)&cmd_config_rss_keyword,
@@ -2434,7 +2436,7 @@ cmdline_parse_token_string_t cmd_config_rss_hash_key_rss_type =
 				 "ipv6-tcp-ex#ipv6-udp-ex#"
 				 "l3-src-only#l3-dst-only#l4-src-only#l4-dst-only#"
 				 "l2-src-only#l2-dst-only#s-vlan#c-vlan#"
-				 "l2tpv3#esp#ah#pfcp#pppoe#gtpu#ecpri#mpls");
+				 "l2tpv3#esp#ah#pfcp#pppoe#gtpu#ecpri#mpls#l2tpv2");
 cmdline_parse_token_string_t cmd_config_rss_hash_key_value =
 	TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_key, key, NULL);
 
@@ -2447,7 +2449,7 @@ cmdline_parse_inst_t cmd_config_rss_hash_key = {
 		"l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex|"
 		"l3-src-only|l3-dst-only|l4-src-only|l4-dst-only|"
 		"l2-src-only|l2-dst-only|s-vlan|c-vlan|"
-		"l2tpv3|esp|ah|pfcp|pppoe|gtpu|ecpri|mpls "
+		"l2tpv3|esp|ah|pfcp|pppoe|gtpu|ecpri|mpls|l2tpv2 "
 		"<string of hex digits (variable length, NIC dependent)>",
 	.tokens = {
 		(void *)&cmd_config_rss_hash_key_port,
app/test-pmd/config.c +2 -1
index e812f57151..de1ec14bc7 100644
@@ -90,7 +90,7 @@ const struct rss_type_info rss_type_table[] = {
 	{ "all", RTE_ETH_RSS_ETH | RTE_ETH_RSS_VLAN | RTE_ETH_RSS_IP | RTE_ETH_RSS_TCP |
 		RTE_ETH_RSS_UDP | RTE_ETH_RSS_SCTP | RTE_ETH_RSS_L2_PAYLOAD |
 		RTE_ETH_RSS_L2TPV3 | RTE_ETH_RSS_ESP | RTE_ETH_RSS_AH | RTE_ETH_RSS_PFCP |
-		RTE_ETH_RSS_GTPU | RTE_ETH_RSS_ECPRI | RTE_ETH_RSS_MPLS},
+		RTE_ETH_RSS_GTPU | RTE_ETH_RSS_ECPRI | RTE_ETH_RSS_MPLS | RTE_ETH_RSS_L2TPV2},
 	{ "none", 0 },
 	{ "eth", RTE_ETH_RSS_ETH },
 	{ "l2-src-only", RTE_ETH_RSS_L2_SRC_ONLY },
@@ -143,6 +143,7 @@ const struct rss_type_info rss_type_table[] = {
 	{ "mpls", RTE_ETH_RSS_MPLS },
 	{ "ipv4-chksum", RTE_ETH_RSS_IPV4_CHKSUM },
 	{ "l4-chksum", RTE_ETH_RSS_L4_CHKSUM },
+	{ "l2tpv2", RTE_ETH_RSS_L2TPV2 },
 	{ NULL, 0 },
 };
 
doc/guides/rel_notes/release_22_03.rst +5 -0
index f03183ee86..17c25d899c 100644
@@ -64,6 +64,11 @@ New Features
     - ``rte_ipv6_udptcp_cksum_mbuf()``
     - ``rte_ipv6_udptcp_cksum_mbuf_verify()``
 
+* **Added new RSS offload types for L2TPv2 in RSS flow.**
+
+  Added macro RTE_ETH_RSS_L2TPV2, now L2TPv2 session ID field can be used as
+  input set for RSS.
+
 * **Added an API to enable queue based priority flow ctrl(PFC).**
 
   New APIs, ``rte_eth_dev_priority_flow_ctrl_queue_info_get()`` and
doc/guides/testpmd_app_ug/testpmd_funcs.rst +2 -2
index b2e98df6e1..f8adcb0a40 100644
@@ -2308,11 +2308,11 @@ port config - RSS
 
 Set the RSS (Receive Side Scaling) mode on or off::
 
-   testpmd> port config all rss (all|default|eth|vlan|ip|tcp|udp|sctp|ether|port|vxlan|geneve|nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|ecpri|mpls|none)
+   testpmd> port config all rss (all|default|eth|vlan|ip|tcp|udp|sctp|ether|port|vxlan|geneve|nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|ecpri|mpls|l2tpv2|none)
 
 RSS is on by default.
 
-The ``all`` option is equivalent to eth|vlan|ip|tcp|udp|sctp|ether|l2tpv3|esp|ah|pfcp.
+The ``all`` option is equivalent to eth|vlan|ip|tcp|udp|sctp|ether|l2tpv3|esp|ah|pfcp|l2tpv2.
 
 The ``default`` option enables all supported RSS types reported by device info.
 
lib/ethdev/rte_ethdev.h +2 -0
index 2660e4f374..e6bc1c808a 100644
@@ -651,6 +651,8 @@ struct rte_eth_rss_conf {
 #define RTE_ETH_RSS_L4_CHKSUM          RTE_BIT64(35)
 #define ETH_RSS_L4_CHKSUM RTE_DEPRECATED(ETH_RSS_L4_CHKSUM) RTE_ETH_RSS_L4_CHKSUM
 
+#define RTE_ETH_RSS_L2TPV2            RTE_BIT64(36)
+
 /*
  * We use the following macros to combine with above RTE_ETH_RSS_* for
  * more specific input set selection. These bits are defined starting
Signature · 1 line
2.25.1
author
#32 lore raw

PATCH v5 2/6 net: fix L2TPv2 common header

In reply to Jie Wang

The fields of L2TPv2 common header were reversed in big endian and little endian.

This patch fixes this error to ensure L2TPv2 can be parsed correctly.

For L2TP reference:
https://datatracker.ietf.org/doc/html/rfc2661#section-3.1

Fixes 3a929df1f286 ("ethdev: support L2TPv2 and PPP procotol")
---
 lib/net/rte_l2tpv2.h | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
lib/net/rte_l2tpv2.h +10 -10
index 938a993b48..1f3ad3f03c 100644
@@ -89,16 +89,6 @@ struct rte_l2tpv2_common_hdr {
 		__extension__
 		struct {
 #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
-			uint16_t t:1;		/**< message Type */
-			uint16_t l:1;		/**< length option bit */
-			uint16_t res1:2;	/**< reserved */
-			uint16_t s:1;		/**< ns/nr option bit */
-			uint16_t res2:1;	/**< reserved */
-			uint16_t o:1;		/**< offset option bit */
-			uint16_t p:1;		/**< priority option bit */
-			uint16_t res3:4;	/**< reserved */
-			uint16_t ver:4;		/**< protocol version */
-#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
 			uint16_t ver:4;		/**< protocol version */
 			uint16_t res3:4;	/**< reserved */
 			uint16_t p:1;		/**< priority option bit */
@@ -108,6 +98,16 @@ struct rte_l2tpv2_common_hdr {
 			uint16_t res1:2;	/**< reserved */
 			uint16_t l:1;		/**< length option bit */
 			uint16_t t:1;		/**< message Type */
+#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
+			uint16_t t:1;		/**< message Type */
+			uint16_t l:1;		/**< length option bit */
+			uint16_t res1:2;	/**< reserved */
+			uint16_t s:1;		/**< ns/nr option bit */
+			uint16_t res2:1;	/**< reserved */
+			uint16_t o:1;		/**< offset option bit */
+			uint16_t p:1;		/**< priority option bit */
+			uint16_t res3:4;	/**< reserved */
+			uint16_t ver:4;		/**< protocol version */
 #endif
 		};
 	};
Signature · 1 line
2.25.1
author
#33 lore raw

PATCH v5 3/6 app/testpmd: add 6 types of L2TPv2 message

In reply to Jie Wang

This patch adds L2TPv2 control message and 5 types of data message support for testpmd.

The added L2TPv2 message types are listed below:
1. L2TPv2 control
2. L2TPv2
3. L2TPv2 + length option
4. L2TPv2 + sequence option
5. L2TPv2 + offset option
6. L2TPv2 + length option + sequence option

---
 app/test-pmd/cmdline_flow.c                 | 313 ++++++++++++++++----
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  35 ++-
 lib/net/rte_l2tpv2.h                        |  13 +
 3 files changed, 308 insertions(+), 53 deletions(-)
app/test-pmd/cmdline_flow.c +262 -51
index 7b56b1b0ff..e0c79d57a3 100644
@@ -323,13 +323,30 @@ enum index {
 	ITEM_FLEX_ITEM_HANDLE,
 	ITEM_FLEX_PATTERN_HANDLE,
 	ITEM_L2TPV2,
-	ITEM_L2TPV2_COMMON,
-	ITEM_L2TPV2_COMMON_TYPE,
-	ITEM_L2TPV2_COMMON_TYPE_DATA_L,
-	ITEM_L2TPV2_COMMON_TYPE_CTRL,
+	ITEM_L2TPV2_TYPE,
+	ITEM_L2TPV2_TYPE_DATA,
+	ITEM_L2TPV2_TYPE_DATA_L,
+	ITEM_L2TPV2_TYPE_DATA_S,
+	ITEM_L2TPV2_TYPE_DATA_O,
+	ITEM_L2TPV2_TYPE_DATA_L_S,
+	ITEM_L2TPV2_TYPE_CTRL,
+	ITEM_L2TPV2_MSG_DATA_TUNNEL_ID,
+	ITEM_L2TPV2_MSG_DATA_SESSION_ID,
 	ITEM_L2TPV2_MSG_DATA_L_LENGTH,
 	ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID,
 	ITEM_L2TPV2_MSG_DATA_L_SESSION_ID,
+	ITEM_L2TPV2_MSG_DATA_S_TUNNEL_ID,
+	ITEM_L2TPV2_MSG_DATA_S_SESSION_ID,
+	ITEM_L2TPV2_MSG_DATA_S_NS,
+	ITEM_L2TPV2_MSG_DATA_S_NR,
+	ITEM_L2TPV2_MSG_DATA_O_TUNNEL_ID,
+	ITEM_L2TPV2_MSG_DATA_O_SESSION_ID,
+	ITEM_L2TPV2_MSG_DATA_O_OFFSET,
+	ITEM_L2TPV2_MSG_DATA_L_S_LENGTH,
+	ITEM_L2TPV2_MSG_DATA_L_S_TUNNEL_ID,
+	ITEM_L2TPV2_MSG_DATA_L_S_SESSION_ID,
+	ITEM_L2TPV2_MSG_DATA_L_S_NS,
+	ITEM_L2TPV2_MSG_DATA_L_S_NR,
 	ITEM_L2TPV2_MSG_CTRL_LENGTH,
 	ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID,
 	ITEM_L2TPV2_MSG_CTRL_SESSION_ID,
@@ -1451,19 +1468,70 @@ static const enum index item_flex[] = {
 };
 
 static const enum index item_l2tpv2[] = {
-	ITEM_L2TPV2_COMMON,
+	ITEM_L2TPV2_TYPE,
 	ITEM_NEXT,
 	ZERO,
 };
 
-static const enum index item_l2tpv2_common[] = {
-	ITEM_L2TPV2_COMMON_TYPE,
+static const enum index item_l2tpv2_type[] = {
+	ITEM_L2TPV2_TYPE_DATA,
+	ITEM_L2TPV2_TYPE_DATA_L,
+	ITEM_L2TPV2_TYPE_DATA_S,
+	ITEM_L2TPV2_TYPE_DATA_O,
+	ITEM_L2TPV2_TYPE_DATA_L_S,
+	ITEM_L2TPV2_TYPE_CTRL,
 	ZERO,
 };
 
-static const enum index item_l2tpv2_common_type[] = {
-	ITEM_L2TPV2_COMMON_TYPE_DATA_L,
-	ITEM_L2TPV2_COMMON_TYPE_CTRL,
+static const enum index item_l2tpv2_type_data[] = {
+	ITEM_L2TPV2_MSG_DATA_TUNNEL_ID,
+	ITEM_L2TPV2_MSG_DATA_SESSION_ID,
+	ITEM_NEXT,
+	ZERO,
+};
+
+static const enum index item_l2tpv2_type_data_l[] = {
+	ITEM_L2TPV2_MSG_DATA_L_LENGTH,
+	ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID,
+	ITEM_L2TPV2_MSG_DATA_L_SESSION_ID,
+	ITEM_NEXT,
+	ZERO,
+};
+
+static const enum index item_l2tpv2_type_data_s[] = {
+	ITEM_L2TPV2_MSG_DATA_S_TUNNEL_ID,
+	ITEM_L2TPV2_MSG_DATA_S_SESSION_ID,
+	ITEM_L2TPV2_MSG_DATA_S_NS,
+	ITEM_L2TPV2_MSG_DATA_S_NR,
+	ITEM_NEXT,
+	ZERO,
+};
+
+static const enum index item_l2tpv2_type_data_o[] = {
+	ITEM_L2TPV2_MSG_DATA_O_TUNNEL_ID,
+	ITEM_L2TPV2_MSG_DATA_O_SESSION_ID,
+	ITEM_L2TPV2_MSG_DATA_O_OFFSET,
+	ITEM_NEXT,
+	ZERO,
+};
+
+static const enum index item_l2tpv2_type_data_l_s[] = {
+	ITEM_L2TPV2_MSG_DATA_L_S_LENGTH,
+	ITEM_L2TPV2_MSG_DATA_L_S_TUNNEL_ID,
+	ITEM_L2TPV2_MSG_DATA_L_S_SESSION_ID,
+	ITEM_L2TPV2_MSG_DATA_L_S_NS,
+	ITEM_L2TPV2_MSG_DATA_L_S_NR,
+	ITEM_NEXT,
+	ZERO,
+};
+
+static const enum index item_l2tpv2_type_ctrl[] = {
+	ITEM_L2TPV2_MSG_CTRL_LENGTH,
+	ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID,
+	ITEM_L2TPV2_MSG_CTRL_SESSION_ID,
+	ITEM_L2TPV2_MSG_CTRL_NS,
+	ITEM_L2TPV2_MSG_CTRL_NR,
+	ITEM_NEXT,
 	ZERO,
 };
 
@@ -3858,31 +3926,46 @@ static const struct token token_list[] = {
 		.next = NEXT(item_l2tpv2),
 		.call = parse_vc,
 	},
-	[ITEM_L2TPV2_COMMON] = {
-		.name = "common",
-		.help = "L2TPv2 common header",
-		.next = NEXT(item_l2tpv2_common),
-	},
-	[ITEM_L2TPV2_COMMON_TYPE] = {
+	[ITEM_L2TPV2_TYPE] = {
 		.name = "type",
-		.help = "type of common header",
-		.next = NEXT(item_l2tpv2_common_type),
+		.help = "type of l2tpv2",
+		.next = NEXT(item_l2tpv2_type),
 		.args = ARGS(ARG_ENTRY_HTON(struct rte_flow_item_l2tpv2)),
 	},
-	[ITEM_L2TPV2_COMMON_TYPE_DATA_L] = {
+	[ITEM_L2TPV2_TYPE_DATA] = {
+		.name = "data",
+		.help = "Type #7: data message without any options",
+		.next = NEXT(item_l2tpv2_type_data),
+		.call = parse_vc_item_l2tpv2_type,
+	},
+	[ITEM_L2TPV2_MSG_DATA_TUNNEL_ID] = {
+		.name = "tunnel_id",
+		.help = "tunnel identifier",
+		.next = NEXT(item_l2tpv2_type_data,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type7.tunnel_id)),
+	},
+	[ITEM_L2TPV2_MSG_DATA_SESSION_ID] = {
+		.name = "session_id",
+		.help = "session identifier",
+		.next = NEXT(item_l2tpv2_type_data,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type7.session_id)),
+	},
+	[ITEM_L2TPV2_TYPE_DATA_L] = {
 		.name = "data_l",
 		.help = "Type #6: data message with length option",
-		.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_DATA_L_LENGTH,
-					ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID,
-					ITEM_L2TPV2_MSG_DATA_L_SESSION_ID,
-					ITEM_NEXT)),
+		.next = NEXT(item_l2tpv2_type_data_l),
 		.call = parse_vc_item_l2tpv2_type,
 	},
 	[ITEM_L2TPV2_MSG_DATA_L_LENGTH] = {
 		.name = "length",
 		.help = "message length",
-		.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_DATA_L_LENGTH,
-					ITEM_L2TPV2_COMMON, ITEM_NEXT),
+		.next = NEXT(item_l2tpv2_type_data_l,
 			     NEXT_ENTRY(COMMON_UNSIGNED),
 			     item_param),
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -3891,8 +3974,7 @@ static const struct token token_list[] = {
 	[ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID] = {
 		.name = "tunnel_id",
 		.help = "tunnel identifier",
-		.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID,
-					ITEM_L2TPV2_COMMON, ITEM_NEXT),
+		.next = NEXT(item_l2tpv2_type_data_l,
 			     NEXT_ENTRY(COMMON_UNSIGNED),
 			     item_param),
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -3901,29 +3983,150 @@ static const struct token token_list[] = {
 	[ITEM_L2TPV2_MSG_DATA_L_SESSION_ID] = {
 		.name = "session_id",
 		.help = "session identifier",
-		.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_DATA_L_SESSION_ID,
-					ITEM_L2TPV2_COMMON, ITEM_NEXT),
+		.next = NEXT(item_l2tpv2_type_data_l,
 			     NEXT_ENTRY(COMMON_UNSIGNED),
 			     item_param),
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
 					     hdr.type6.session_id)),
 	},
-	[ITEM_L2TPV2_COMMON_TYPE_CTRL] = {
+	[ITEM_L2TPV2_TYPE_DATA_S] = {
+		.name = "data_s",
+		.help = "Type #5: data message with ns, nr option",
+		.next = NEXT(item_l2tpv2_type_data_s),
+		.call = parse_vc_item_l2tpv2_type,
+	},
+	[ITEM_L2TPV2_MSG_DATA_S_TUNNEL_ID] = {
+		.name = "tunnel_id",
+		.help = "tunnel identifier",
+		.next = NEXT(item_l2tpv2_type_data_s,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type5.tunnel_id)),
+	},
+	[ITEM_L2TPV2_MSG_DATA_S_SESSION_ID] = {
+		.name = "session_id",
+		.help = "session identifier",
+		.next = NEXT(item_l2tpv2_type_data_s,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type5.session_id)),
+	},
+	[ITEM_L2TPV2_MSG_DATA_S_NS] = {
+		.name = "ns",
+		.help = "sequence number for message",
+		.next = NEXT(item_l2tpv2_type_data_s,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type5.ns)),
+	},
+	[ITEM_L2TPV2_MSG_DATA_S_NR] = {
+		.name = "nr",
+		.help = "sequence number for next receive message",
+		.next = NEXT(item_l2tpv2_type_data_s,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type5.nr)),
+	},
+	[ITEM_L2TPV2_TYPE_DATA_O] = {
+		.name = "data_o",
+		.help = "Type #4: data message with offset option",
+		.next = NEXT(item_l2tpv2_type_data_o),
+		.call = parse_vc_item_l2tpv2_type,
+	},
+	[ITEM_L2TPV2_MSG_DATA_O_TUNNEL_ID] = {
+		.name = "tunnel_id",
+		.help = "tunnel identifier",
+		.next = NEXT(item_l2tpv2_type_data_o,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type4.tunnel_id)),
+	},
+	[ITEM_L2TPV2_MSG_DATA_O_SESSION_ID] = {
+		.name = "session_id",
+		.help = "session identifier",
+		.next = NEXT(item_l2tpv2_type_data_o,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type5.session_id)),
+	},
+	[ITEM_L2TPV2_MSG_DATA_O_OFFSET] = {
+		.name = "offset_size",
+		.help = "the size of offset padding",
+		.next = NEXT(item_l2tpv2_type_data_o,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type4.offset_size)),
+	},
+	[ITEM_L2TPV2_TYPE_DATA_L_S] = {
+		.name = "data_l_s",
+		.help = "Type #3: data message contains length, ns, nr "
+			"options",
+		.next = NEXT(item_l2tpv2_type_data_l_s),
+		.call = parse_vc_item_l2tpv2_type,
+	},
+	[ITEM_L2TPV2_MSG_DATA_L_S_LENGTH] = {
+		.name = "length",
+		.help = "message length",
+		.next = NEXT(item_l2tpv2_type_data_l_s,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type3.length)),
+	},
+	[ITEM_L2TPV2_MSG_DATA_L_S_TUNNEL_ID] = {
+		.name = "tunnel_id",
+		.help = "tunnel identifier",
+		.next = NEXT(item_l2tpv2_type_data_l_s,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type3.tunnel_id)),
+	},
+	[ITEM_L2TPV2_MSG_DATA_L_S_SESSION_ID] = {
+		.name = "session_id",
+		.help = "session identifier",
+		.next = NEXT(item_l2tpv2_type_data_l_s,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type3.session_id)),
+	},
+	[ITEM_L2TPV2_MSG_DATA_L_S_NS] = {
+		.name = "ns",
+		.help = "sequence number for message",
+		.next = NEXT(item_l2tpv2_type_data_l_s,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type3.ns)),
+	},
+	[ITEM_L2TPV2_MSG_DATA_L_S_NR] = {
+		.name = "nr",
+		.help = "sequence number for next receive message",
+		.next = NEXT(item_l2tpv2_type_data_l_s,
+			     NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+					     hdr.type3.nr)),
+	},
+	[ITEM_L2TPV2_TYPE_CTRL] = {
 		.name = "control",
-		.help = "Type #3: conrtol message contains length, ns, nr options",
-		.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_LENGTH,
-					ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID,
-					ITEM_L2TPV2_MSG_CTRL_SESSION_ID,
-					ITEM_L2TPV2_MSG_CTRL_NS,
-					ITEM_L2TPV2_MSG_CTRL_NR,
-					ITEM_NEXT)),
+		.help = "Type #3: conrtol message contains length, ns, nr "
+			"options",
+		.next = NEXT(item_l2tpv2_type_ctrl),
 		.call = parse_vc_item_l2tpv2_type,
 	},
 	[ITEM_L2TPV2_MSG_CTRL_LENGTH] = {
 		.name = "length",
 		.help = "message length",
-		.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_LENGTH,
-					ITEM_L2TPV2_COMMON, ITEM_NEXT),
+		.next = NEXT(item_l2tpv2_type_ctrl,
 			     NEXT_ENTRY(COMMON_UNSIGNED),
 			     item_param),
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -3932,8 +4135,7 @@ static const struct token token_list[] = {
 	[ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID] = {
 		.name = "tunnel_id",
 		.help = "tunnel identifier",
-		.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID,
-					ITEM_L2TPV2_COMMON, ITEM_NEXT),
+		.next = NEXT(item_l2tpv2_type_ctrl,
 			     NEXT_ENTRY(COMMON_UNSIGNED),
 			     item_param),
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -3942,8 +4144,7 @@ static const struct token token_list[] = {
 	[ITEM_L2TPV2_MSG_CTRL_SESSION_ID] = {
 		.name = "session_id",
 		.help = "session identifier",
-		.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_SESSION_ID,
-					ITEM_L2TPV2_COMMON, ITEM_NEXT),
+		.next = NEXT(item_l2tpv2_type_ctrl,
 			     NEXT_ENTRY(COMMON_UNSIGNED),
 			     item_param),
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -3952,8 +4153,7 @@ static const struct token token_list[] = {
 	[ITEM_L2TPV2_MSG_CTRL_NS] = {
 		.name = "ns",
 		.help = "sequence number for message",
-		.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_NS,
-					ITEM_L2TPV2_COMMON, ITEM_NEXT),
+		.next = NEXT(item_l2tpv2_type_ctrl,
 			     NEXT_ENTRY(COMMON_UNSIGNED),
 			     item_param),
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -3962,8 +4162,7 @@ static const struct token token_list[] = {
 	[ITEM_L2TPV2_MSG_CTRL_NR] = {
 		.name = "nr",
 		.help = "sequence number for next receive message",
-		.next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_NS,
-					ITEM_L2TPV2_COMMON, ITEM_NEXT),
+		.next = NEXT(item_l2tpv2_type_ctrl,
 			     NEXT_ENTRY(COMMON_UNSIGNED),
 			     item_param),
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -5904,11 +6103,23 @@ parse_vc_item_l2tpv2_type(struct context *ctx, const struct token *token,
 	if (parse_default(ctx, token, str, len, NULL, 0) < 0)
 		return -1;
 	switch (ctx->curr) {
-	case ITEM_L2TPV2_COMMON_TYPE_DATA_L:
-		msg_type |= 0x4000;
+	case ITEM_L2TPV2_TYPE_DATA:
+		msg_type |= RTE_L2TPV2_MSG_TYPE_DATA;
+		break;
+	case ITEM_L2TPV2_TYPE_DATA_L:
+		msg_type |= RTE_L2TPV2_MSG_TYPE_DATA_L;
+		break;
+	case ITEM_L2TPV2_TYPE_DATA_S:
+		msg_type |= RTE_L2TPV2_MSG_TYPE_DATA_S;
+		break;
+	case ITEM_L2TPV2_TYPE_DATA_O:
+		msg_type |= RTE_L2TPV2_MSG_TYPE_DATA_O;
+		break;
+	case ITEM_L2TPV2_TYPE_DATA_L_S:
+		msg_type |= RTE_L2TPV2_MSG_TYPE_DATA_L_S;
 		break;
-	case ITEM_L2TPV2_COMMON_TYPE_CTRL:
-		msg_type |= 0xC800;
+	case ITEM_L2TPV2_TYPE_CTRL:
+		msg_type |= RTE_L2TPV2_MSG_TYPE_CONTROL;
 		break;
 	default:
 		return -1;
doc/guides/testpmd_app_ug/testpmd_funcs.rst +33 -2
index f8adcb0a40..f957f2b0ab 100644
@@ -3857,6 +3857,7 @@ This section lists supported pattern items and their attributes, if any.
   - ``session_id {unsigned}``: L2TPv2 session identifier.
   - ``ns {unsigned}``: L2TPv2 option ns.
   - ``nr {unsigned}``: L2TPv2 option nr.
+  - ``offset_size {unsigned}``: L2TPv2 option offset.
 
 - ``ppp``: match PPP header.
 
@@ -5090,11 +5091,19 @@ The meter policy action list: ``green -> green, yellow -> yellow, red -> red``.
    testpmd> create port meter 0 1 13 1 yes 0xffff 0 0
    testpmd> flow create 0 priority 0 ingress group 1 pattern eth / end actions meter mtr_id 1 / end
 
-Sample PPPoL2TPv2oUDP RSS rules
+Sample L2TPv2 RSS rules
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-PPPoL2TPv2oUDP RSS rules can be created by the following commands::
+L2TPv2 RSS rules can be created by the following commands:
 
+::
+
+ testpmd> flow create 0 ingress pattern eth / ipv4 / udp / l2tpv2 type control
+          / end actions rss types l2tpv2 end queues end / end
+ testpmd> flow create 0 ingress pattern eth / ipv4 / udp / l2tpv2 / end
+          actions rss types eth l2-src-only end queues end / end
+ testpmd> flow create 0 ingress pattern eth / ipv4 / udp / l2tpv2 / ppp / end
+          actions rss types l2tpv2 end queues end / end
  testpmd> flow create 0 ingress pattern eth / ipv4 / udp / l2tpv2 / ppp / ipv4
           / end actions rss types ipv4 end queues end / end
  testpmd> flow create 0 ingress pattern eth / ipv4 / udp / l2tpv2 / ppp / ipv6
@@ -5104,6 +5113,28 @@ PPPoL2TPv2oUDP RSS rules can be created by the following commands::
  testpmd> flow create 0 ingress pattern eth / ipv6 / udp / l2tpv2 / ppp / ipv6
           / end actions rss types ipv6 end queues end / end
 
+Sample L2TPv2 FDIR rules
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+L2TPv2 FDIR rules can be created by the following commands:
+
+::
+
+ testpmd> flow create 0 ingress pattern eth / ipv4 / udp / l2tpv2 type control
+          session_id is 0x1111 / end actions queue index 3 / end
+ testpmd> flow create 0 ingress pattern eth src is 00:00:00:00:00:01 / ipv4
+          / udp / l2tpv2 type data / end actions queue index 3 / end
+ testpmd> flow create 0 ingress pattern eth / ipv4 / udp / l2tpv2 type data
+          session_id is 0x1111 / ppp / end actions queue index 3 / end
+ testpmd> flow create 0 ingress pattern eth / ipv4 / udp / l2tpv2 / ppp / ipv4
+          src is 10.0.0.1 / end actions queue index 3 / end
+ testpmd> flow create 0 ingress pattern eth / ipv6 / udp / l2tpv2 / ppp / ipv6
+          dst is ABAB:910B:6666:3457:8295:3333:1800:2929 / end actions queue index 3 / end
+ testpmd> flow create 0 ingress pattern eth / ipv4 / udp / l2tpv2 / ppp / ipv4
+          / udp src is 22 / end actions queue index 3 / end
+ testpmd> flow create 0 ingress pattern eth / ipv4 / udp / l2tpv2 / ppp / ipv4
+          / tcp dst is 23 / end actions queue index 3 / end
+
 Sample RAW rule
 ~~~~~~~~~~~~~~~
 
lib/net/rte_l2tpv2.h +13 -0
index 1f3ad3f03c..d41123a504 100644
@@ -78,6 +78,19 @@
 extern "C" {
 #endif
 
+/*
+ * L2TPv2 Message Type
+ */
+#define RTE_L2TPV2_MSG_TYPE_CONTROL	0xC802
+#define RTE_L2TPV2_MSG_TYPE_DATA	0x0002
+#define RTE_L2TPV2_MSG_TYPE_DATA_L	0x4002
+#define RTE_L2TPV2_MSG_TYPE_DATA_S	0x0802
+#define RTE_L2TPV2_MSG_TYPE_DATA_O	0x0202
+#define RTE_L2TPV2_MSG_TYPE_DATA_L_S	0x4802
+#define RTE_L2TPV2_MSG_TYPE_DATA_L_O	0x4202
+#define RTE_L2TPV2_MSG_TYPE_DATA_S_O	0x0A02
+#define RTE_L2TPV2_MSG_TYPE_DATA_L_S_O	0x4A02
+
 /**
  * L2TPv2 Common Header
  */
Signature · 1 line
2.25.1
author
#34 lore raw

PATCH v5 4/6 common/iavf: add session ID fields for L2TPv2

In reply to Jie Wang

Add virtchnl fields session ID of L2TPv2 for AVF HASH.

---
 drivers/common/iavf/virtchnl.h | 4 ++++
 1 file changed, 4 insertions(+)
drivers/common/iavf/virtchnl.h +4 -0
index 80e754a1b2..3e44eca7d8 100644
@@ -1653,6 +1653,10 @@ enum virtchnl_proto_hdr_field {
 		PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_GTPU_EH_PDU_DWN),
 	VIRTCHNL_PROTO_HDR_GTPU_UP_QFI =
 		PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_GTPU_EH_PDU_UP),
+	/* L2TPv2 */
+	VIRTCHNL_PROTO_HDR_L2TPV2_SESS_ID =
+		PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_L2TPV2),
+	VIRTCHNL_PROTO_HDR_L2TPV2_LEN_SESS_ID,
 };
 
 struct virtchnl_proto_hdr {
Signature · 1 line
2.25.1
Acked-by on v5 4/6 Applied
#35 lore raw

RE: [PATCH v5 4/6] common/iavf: add session ID fields for L2TPv2

Quoted 14 lines

-----Original Message-----
From: Wang, Jie1X <[email protected]>
Sent: Wednesday, February 9, 2022 5:39 PM
To: [email protected]
Cc: Yang, SteveX <[email protected]>; [email protected]; Singh, Aman Deep <[email protected]>; Yigit, Ferruh <[email protected]>; [email protected]; [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>; [email protected]; Wang, Jie1X <[email protected]>
Subject: [PATCH v5 4/6] common/iavf: add session ID fields for L2TPv2

Quoted 3 lines

Add virtchnl fields session ID of L2TPv2 for AVF HASH.

Applied to dpdk-next-net-intel.

Thanks
Qi

author
#36 lore raw

PATCH v5 5/6 net/iavf: support L2TPv2 for AVF HASH

In reply to Jie Wang

Add support for PPP over L2TPv2 over UDP protocol and L2TPv2 protocol RSS hash based on outer MAC src address and L2TPv2 session ID.

Patterns are listed below:
eth/ipv4/udp/l2tpv2
eth/ipv4/udp/l2tpv2/ppp
eth/ipv6/udp/l2tpv2
eth/ipv6/udp/l2tpv2/ppp

---
 doc/guides/rel_notes/release_22_03.rst |  5 ++
 drivers/net/iavf/iavf.h                |  2 +
 drivers/net/iavf/iavf_generic_flow.c   | 34 +++++++++++
 drivers/net/iavf/iavf_generic_flow.h   |  6 ++
 drivers/net/iavf/iavf_hash.c           | 81 ++++++++++++++++++++++++--
 5 files changed, 124 insertions(+), 4 deletions(-)
doc/guides/rel_notes/release_22_03.rst +5 -0
index 17c25d899c..37921fc44f 100644
@@ -83,6 +83,11 @@ New Features
   * Added rte_flow support for matching GENEVE packets.
   * Added rte_flow support for matching eCPRI packets.
 
+* **Updated Intel iavf driver.**
+
+  * Added L2TPv2(include PPP over L2TPv2) RSS hash distribute packets
+    based on outer MAC src address and L2TPv2 session ID.
+
 * **Updated Marvell cnxk crypto PMD.**
 
   * Added SHA256-HMAC support in lookaside protocol (IPsec) for CN10K.
drivers/net/iavf/iavf.h +2 -0
index 0bb5698583..a01d18e61b 100644
@@ -93,6 +93,8 @@
 
 #define IAVF_VLAN_TAG_PCP_OFFSET 13
 
+#define IAVF_L2TPV2_FLAGS_LEN	0x4000
+
 struct iavf_adapter;
 struct iavf_rx_queue;
 struct iavf_tx_queue;
drivers/net/iavf/iavf_generic_flow.c +34 -0
index 2befa125ac..1de4187e67 100644
@@ -1611,6 +1611,40 @@ enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_udp[] = {
 	RTE_FLOW_ITEM_TYPE_END,
 };
 
+enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_L2TPV2,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp[] = {
+	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_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_L2TPV2,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2_ppp[] = {
+	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_END,
+};
+
 /* PPPoL2TPv2oUDP */
 enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4[] = {
 	RTE_FLOW_ITEM_TYPE_ETH,
drivers/net/iavf/iavf_generic_flow.h +6 -0
index 3681a96b31..107bbc1a23 100644
@@ -410,6 +410,12 @@ 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[];
 
+/* L2TPv2 */
+extern enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2_ppp[];
+
 /* 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[];
drivers/net/iavf/iavf_hash.c +77 -4

150 lines not on this page · raw message

Signature · 1 line
2.25.1
#37 lore raw

RE: [PATCH v5 5/6] net/iavf: support L2TPv2 for AVF HASH

Quoted 14 lines

-----Original Message-----
From: Wang, Jie1X <[email protected]>
Sent: Wednesday, February 9, 2022 5:39 PM
To: [email protected]
Cc: Yang, SteveX <[email protected]>; [email protected]; Singh, Aman Deep <[email protected]>; Yigit, Ferruh <[email protected]>; [email protected]; [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>; [email protected]; Wang, Jie1X <[email protected]>
Subject: [PATCH v5 5/6] net/iavf: support L2TPv2 for AVF HASH

Quoted 2 lines

Add support for PPP over L2TPv2 over UDP protocol and L2TPv2 protocol RSS hash based on outer MAC src address and L2TPv2 session ID.

The commit log and the release notes for RSS/FDIR should be changed, too.

Quoted 318 lines

Patterns are listed below:
eth/ipv4/udp/l2tpv2
eth/ipv4/udp/l2tpv2/ppp
eth/ipv6/udp/l2tpv2
eth/ipv6/udp/l2tpv2/ppp

---
 doc/guides/rel_notes/release_22_03.rst |  5 ++
 drivers/net/iavf/iavf.h                |  2 +
 drivers/net/iavf/iavf_generic_flow.c   | 34 +++++++++++
 drivers/net/iavf/iavf_generic_flow.h   |  6 ++
 drivers/net/iavf/iavf_hash.c           | 81 ++++++++++++++++++++++++--
 5 files changed, 124 insertions(+), 4 deletions(-)
doc/guides/rel_notes/release_22_03.rst +5 -0
index 17c25d899c..37921fc44f 100644
@@ -83,6 +83,11 @@ New Features
   * Added rte_flow support for matching GENEVE packets.
   * Added rte_flow support for matching eCPRI packets.
 
+* **Updated Intel iavf driver.**
+
+  * Added L2TPv2(include PPP over L2TPv2) RSS hash distribute packets
+    based on outer MAC src address and L2TPv2 session ID.
+
 * **Updated Marvell cnxk crypto PMD.**
 
   * Added SHA256-HMAC support in lookaside protocol (IPsec) for CN10K.
drivers/net/iavf/iavf.h index renamed from drivers/net/iavf/iavf.h +0 -0

0bb5698583..a01d18e61b 100644

drivers/net/iavf/iavf.h +2 -0
@@ -93,6 +93,8 @@
 
 #define IAVF_VLAN_TAG_PCP_OFFSET 13
 
+#define IAVF_L2TPV2_FLAGS_LEN	0x4000
+
 struct iavf_adapter;
 struct iavf_rx_queue;
 struct iavf_tx_queue;
drivers/net/iavf/iavf_generic_flow.c +34 -0
index 2befa125ac..1de4187e67 100644
@@ -1611,6 +1611,40 @@ enum rte_flow_item_type
 iavf_pattern_eth_ipv6_gre_ipv6_udp[] = {
 	RTE_FLOW_ITEM_TYPE_END,
 };
 
+enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_L2TPV2,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp[] = {
+	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_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_L2TPV2,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2_ppp[] = {
+	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_END,
+};
+
 /* PPPoL2TPv2oUDP */
 enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4[] = {
drivers/net/iavf/iavf_generic_flow.c +0 -0
 	RTE_FLOW_ITEM_TYPE_ETH,
drivers/net/iavf/iavf_generic_flow.h +6 -0
index 3681a96b31..107bbc1a23 100644
@@ -410,6 +410,12 @@ 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[];
 
+/* L2TPv2 */
+extern enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2_ppp[];
+
 /* 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[];

drivers/net/iavf/iavf_hash.c index renamed from drivers/net/iavf/iavf_hash.c +0 -0

5e0888ea68..f35a07653b 100644

drivers/net/iavf/iavf_hash.c +4 -1
@@ -36,6 +36,7 @@
 #define IAVF_PHINT_MID_IPV6			BIT_ULL(8)
 /* L2TPv2 */
 #define IAVF_PHINT_L2TPV2			BIT_ULL(9)
+#define IAVF_PHINT_L2TPV2_LEN			BIT_ULL(10)
 
 #define IAVF_PHINT_GTPU_MSK	(IAVF_PHINT_GTPU	| \
 				 IAVF_PHINT_GTPU_EH	| \
@@ -167,7 +168,9 @@ iavf_hash_parse_pattern_action(struct iavf_adapter
 *ad,
 	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_ECPRI_PC_RTC_ID),
 {BUFF_NOUSED} }
 
 #define proto_hdr_l2tpv2 { \
-	VIRTCHNL_PROTO_HDR_L2TPV2, 0, {BUFF_NOUSED} }
+	VIRTCHNL_PROTO_HDR_L2TPV2, \
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_L2TPV2_SESS_ID) | \
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_L2TPV2_LEN_SESS_ID),
 {BUFF_NOUSED} }

#define proto_hdr_ppp { \
VIRTCHNL_PROTO_HDR_PPP, 0, {BUFF_NOUSED} } @@ -392,6 +395,40
@@ struct virtchnl_proto_hdrs udp_l2tpv2_ppp_ipv6_tcp_tmplt = {

drivers/net/iavf/iavf_hash.c +36 -0
 	 proto_hdr_tcp}
 };
 
+struct virtchnl_proto_hdrs ipv4_l2tpv2_tmplt = {
+	TUNNEL_LEVEL_OUTER, 4,
+	{proto_hdr_eth,
+	 proto_hdr_ipv4,
+	 proto_hdr_udp,
+	 proto_hdr_l2tpv2}
+};
+
+struct virtchnl_proto_hdrs ipv6_l2tpv2_tmplt = {
+	TUNNEL_LEVEL_OUTER, 4,
+	{proto_hdr_eth,
+	 proto_hdr_ipv6,
+	 proto_hdr_udp,
+	 proto_hdr_l2tpv2}
+};
+
+struct virtchnl_proto_hdrs ipv4_l2tpv2_ppp_tmplt = {
+	TUNNEL_LEVEL_OUTER, 5,
+	{proto_hdr_eth,
+	 proto_hdr_ipv4,
+	 proto_hdr_udp,
+	 proto_hdr_l2tpv2,
+	 proto_hdr_ppp}
+};
+
+struct virtchnl_proto_hdrs ipv6_l2tpv2_ppp_tmplt = {
+	TUNNEL_LEVEL_OUTER, 5,
+	{proto_hdr_eth,
+	 proto_hdr_ipv6,
+	 proto_hdr_udp,
+	 proto_hdr_l2tpv2,
+	 proto_hdr_ppp}
+};
+
 /* rss type super set */
 
 /* IPv4 outer */
@@ -480,6 +517,9 @@ struct virtchnl_proto_hdrs
 udp_l2tpv2_ppp_ipv6_tcp_tmplt = {
 #define IAVF_RSS_TYPE_IPV4_PFCP		(RTE_ETH_RSS_PFCP |
 RTE_ETH_RSS_IPV4)
 #define IAVF_RSS_TYPE_IPV6_PFCP		(RTE_ETH_RSS_PFCP |
 RTE_ETH_RSS_IPV6)
 
+/* L2TPv2 */
+#define IAVF_RSS_TYPE_ETH_L2TPV2	(RTE_ETH_RSS_ETH |

RTE_ETH_RSS_L2TPV2)
+
/**
* Supported pattern for hash.
* The first member is pattern item type, @@ -547,6 +587,8 @@ 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},
drivers/net/iavf/iavf_hash.c +1 -0
+	{iavf_pattern_eth_ipv4_udp_l2tpv2,
	IAVF_RSS_TYPE_ETH_L2TPV2,	&ipv4_l2tpv2_tmplt},
drivers/net/iavf/iavf_hash.c +1 -0
+	{iavf_pattern_eth_ipv4_udp_l2tpv2_ppp,
	IAVF_RSS_TYPE_ETH_L2TPV2,	&ipv4_l2tpv2_ppp_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},
drivers/net/iavf/iavf_hash.c +0 -0
@@ -614,6 +656,8 @@ 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},
drivers/net/iavf/iavf_hash.c +1 -0
+	{iavf_pattern_eth_ipv6_udp_l2tpv2,
	IAVF_RSS_TYPE_ETH_L2TPV2,	&ipv6_l2tpv2_tmplt},
drivers/net/iavf/iavf_hash.c +1 -0
+	{iavf_pattern_eth_ipv6_udp_l2tpv2_ppp,
	IAVF_RSS_TYPE_ETH_L2TPV2,	&ipv6_l2tpv2_ppp_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},
drivers/net/iavf/iavf_hash.c +2 -0
@@ -744,6 +788,8 @@ iavf_hash_parse_pattern(const struct rte_flow_item
 pattern[], uint64_t *phint,
 	const struct rte_flow_item_gtp_psc *psc;
 	const struct rte_flow_item_ecpri *ecpri;
 	struct rte_ecpri_common_hdr ecpri_common;
+	const struct rte_flow_item_l2tpv2 *l2tpv2;
+	uint16_t flags_version;
 
 	for (item = pattern; item->type != RTE_FLOW_ITEM_TYPE_END; item++)

{

drivers/net/iavf/iavf_hash.c +12 -1
 		if (item->last) {
@@ -802,7 +848,18 @@ iavf_hash_parse_pattern(const struct rte_flow_item
 pattern[], uint64_t *phint,
 			*phint |= IAVF_PHINT_GRE;
 			break;
 		case RTE_FLOW_ITEM_TYPE_L2TPV2:
-			*phint |= IAVF_PHINT_L2TPV2;
+			l2tpv2 = item->spec;
+
+			if (l2tpv2) {
+				flags_version =
+					rte_be_to_cpu_16(l2tpv2-
 >hdr.common.flags_version);
+				if (flags_version & IAVF_L2TPV2_FLAGS_LEN)
+					*phint |= IAVF_PHINT_L2TPV2_LEN;
+				else
+					*phint |= IAVF_PHINT_L2TPV2;
+			} else {
+				*phint |= IAVF_PHINT_L2TPV2;
+			}
 			break;
drivers/net/iavf/iavf_hash.c +4 -0
 		default:
 			break;
@@ -1024,6 +1081,10 @@ iavf_refine_proto_hdrs_l234(struct
 virtchnl_proto_hdrs *proto_hdrs,
 			if (!(rss_type & RTE_ETH_RSS_ECPRI))
 				hdr->field_selector = 0;
 			break;
+		case VIRTCHNL_PROTO_HDR_L2TPV2:
+			if (!(rss_type & RTE_ETH_RSS_L2TPV2))
+				hdr->field_selector = 0;
+			break;
 		default:
 			break;
drivers/net/iavf/iavf_hash.c +2 -2
 		}
@@ -1130,10 +1191,10 @@ static void
 iavf_refine_proto_hdrs_l2tpv2(struct virtchnl_proto_hdrs *proto_hdrs,
 			      uint64_t phint)
 {
-	struct virtchnl_proto_hdr *hdr1;
+	struct virtchnl_proto_hdr *hdr, *hdr1;
 	int i;
 
-	if (!(phint & IAVF_PHINT_L2TPV2))
+	if (!(phint & IAVF_PHINT_L2TPV2) && !(phint &
 IAVF_PHINT_L2TPV2_LEN))
 		return;
 

if (proto_hdrs->tunnel_level == TUNNEL_LEVEL_INNER) { @@ -1150,7
+1211,19 @@ iavf_refine_proto_hdrs_l2tpv2(struct virtchnl_proto_hdrs *proto_hdrs,

drivers/net/iavf/iavf_hash.c +6 -0
 			VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, IPV4);
 		else if (phint & IAVF_PHINT_OUTER_IPV6)
 			VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, IPV6);
+	} else {
+		for (i = 0; i < proto_hdrs->count; i++) {
+			hdr = &proto_hdrs->proto_hdr[i];
+			if (hdr->type == VIRTCHNL_PROTO_HDR_L2TPV2) {
+				if (phint & IAVF_PHINT_L2TPV2) {
+					REFINE_PROTO_FLD(DEL,

L2TPV2_LEN_SESS_ID);

drivers/net/iavf/iavf_hash.c +2 -0
+				} else if (phint & IAVF_PHINT_L2TPV2_LEN) {
+					REFINE_PROTO_FLD(DEL,

L2TPV2_SESS_ID);

drivers/net/iavf/iavf_hash.c +4 -1
+				}
+			}
+		}
 	}
+
 }
 
 static void iavf_refine_proto_hdrs(struct virtchnl_proto_hdrs *proto_hdrs,
--

2.25.1

author
#38 lore raw

PATCH v5 6/6 net/iavf: support L2TPv2 for AVF FDIR

In reply to Jie Wang

Add support for L2TPv2(include PPP over L2TPv2) protocols FDIR based on outer MAC src address and L2TPv2 session ID.

Add support for PPPoL2TPv2oUDP protocols FDIR based on inner IP src/dst address and UDP/TCP src/dst port.

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

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

---
 doc/guides/rel_notes/release_22_03.rst |   4 +
 drivers/net/iavf/iavf_fdir.c           | 169 +++++++++++++++++++++----
 drivers/net/iavf/iavf_generic_flow.h   |   4 +
 3 files changed, 149 insertions(+), 28 deletions(-)
doc/guides/rel_notes/release_22_03.rst +4 -0
index 37921fc44f..a05a07dd52 100644
@@ -87,6 +87,10 @@ New Features
 
   * Added L2TPv2(include PPP over L2TPv2) RSS hash distribute packets
     based on outer MAC src address and L2TPv2 session ID.
+  * Added L2TPv2(include PPP over L2TPv2) FDIR distribute packets
+    based on outer MAC src address and L2TPv2 session ID.
+  * Added PPPoL2TPv2oUDP FDIR distribute packets based on inner IP
+    src/dst address and UDP/TCP src/dst port.
 
 * **Updated Marvell cnxk crypto PMD.**
 
drivers/net/iavf/iavf_fdir.c +141 -28

209 lines not on this page · raw message

drivers/net/iavf/iavf_generic_flow.h +4 -0
index 107bbc1a23..f6af176073 100644
@@ -35,6 +35,7 @@
 #define IAVF_PROT_L2TPV3OIP	    (1ULL << 24)
 #define IAVF_PROT_PFCP		    (1ULL << 25)
 #define IAVF_PROT_ECPRI		    (1ULL << 26)
+#define IAVF_PROT_L2TPV2	    (1ULL << 27)
 
 
 /* field */
@@ -62,6 +63,7 @@
 #define IAVF_PFCP_SEID		    (1ULL << 43)
 #define IAVF_ECPRI_PC_RTC_ID	    (1ULL << 42)
 #define IAVF_IP_PKID		    (1ULL << 41)
+#define IAVF_L2TPV2_SESSION_ID	    (1ULL << 40)
 
 /* input set */
 
@@ -175,6 +177,8 @@
 	(IAVF_PROT_PFCP | IAVF_PFCP_S_FIELD | IAVF_PFCP_SEID)
 #define IAVF_INSET_ECPRI \
 	(IAVF_PROT_ECPRI | IAVF_ECPRI_PC_RTC_ID)
+#define IAVF_INSET_L2TPV2 \
+	(IAVF_PROT_L2TPV2 | IAVF_L2TPV2_SESSION_ID)
 
 /* empty pattern */
 extern enum rte_flow_item_type iavf_pattern_empty[];
Signature · 1 line
2.25.1
#39 lore raw
In reply to Jie Wang
Quoted 27 lines · Jie Wang

Support IAVF L2TPv2(include PPP over L2tpv2) RSS hash and flow director. Required to distribute packets based on outer MAC src address and L2TPv2 session ID.

Support IAVF PPPoL2TPv2oUDP flow director. Required to distribute packets based on inner IP src+dest address and TCP/UDP src+dest port.

---
v5:
* remove the comment of new macros.
* update cmd_help_long_parsed() and testpmd_funcs.rst.
* update RSS hash/FDIR input set.
* rebase the main branch code.
v4:
* update new macros in ethdev.
* update commit log.
* rebase the main branch code.
v3:
* update new macros in ethdev.
* update commit log.
* rebase the main branch code.
v2:
* upadte release notes.
* add comment for RTE_ETH_RSS_L2TPV2.
* update ipv6 l2tpv2 flow item.
* rebase the main branch code.

Quoted 8 lines

Jie Wang (6):
ethdev: add L2TPv2 RSS offload type
net: fix L2TPv2 common header
app/testpmd: add 6 types of L2TPv2 message
common/iavf: add session ID fields for L2TPv2
net/iavf: support L2TPv2 for AVF HASH
net/iavf: support L2TPv2 for AVF FDIR

Applied first three patch to dpdk-next-net/main, thanks.

Set applied partially to make library (etdev) part in -rc1, last three patches are driver (iavf) patches and can be merged after -rc1.

Can you please send remaining patches as separate patchset, to help maintainer and CI?

#40 lore raw
Quoted 50 lines

-----Original Message-----
From: Yigit, Ferruh <[email protected]>
Sent: Thursday, February 10, 2022 4:45 AM
To: Wang, Jie1X <[email protected]>; [email protected]
Cc: Yang, SteveX <[email protected]>; [email protected]; Singh, Aman Deep <[email protected]>; [email protected]; [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>; [email protected]
Subject: Re: [PATCH v5 0/6] support L2TPv2 for AVF RSS hash and FDIR

Quoted 27 lines · Jie Wang

Support IAVF L2TPv2(include PPP over L2tpv2) RSS hash and flow director. Required to distribute packets based on outer MAC src address and L2TPv2 session ID.

Support IAVF PPPoL2TPv2oUDP flow director. Required to distribute packets based on inner IP src+dest address and TCP/UDP src+dest port.

---
v5:
* remove the comment of new macros.
* update cmd_help_long_parsed() and testpmd_funcs.rst.
* update RSS hash/FDIR input set.
* rebase the main branch code.
v4:
* update new macros in ethdev.
* update commit log.
* rebase the main branch code.
v3:
* update new macros in ethdev.
* update commit log.
* rebase the main branch code.
v2:
* upadte release notes.
* add comment for RTE_ETH_RSS_L2TPV2.
* update ipv6 l2tpv2 flow item.
* rebase the main branch code.

Quoted 8 lines

Jie Wang (6):
ethdev: add L2TPv2 RSS offload type
net: fix L2TPv2 common header
app/testpmd: add 6 types of L2TPv2 message
common/iavf: add session ID fields for L2TPv2
net/iavf: support L2TPv2 for AVF HASH
net/iavf: support L2TPv2 for AVF FDIR

Quoted 7 lines

Applied first three patch to dpdk-next-net/main, thanks.

Set applied partially to make library (etdev) part in -rc1, last three patches are driver (iavf) patches and can be merged after -rc1.

Can you please send remaining patches as separate patchset, to help maintainer and CI?

Yes, I'll send remaining patches as new patch set.