DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jie Wang <jie1x.wang@intel.com>
To: dev@dpdk.org
Cc: stevex.yang@intel.com, orika@nvidia.com,
	aman.deep.singh@intel.com, ferruh.yigit@intel.com,
	thomas@monjalon.net, andrew.rybchenko@oktetlabs.ru,
	jingjing.wu@intel.com, beilei.xing@intel.com,
	qi.z.zhang@intel.com, olivier.matz@6wind.com,
	Jie Wang <jie1x.wang@intel.com>
Subject: [PATCH v5 1/6] ethdev: add L2TPv2 RSS offload type
Date: Wed,  9 Feb 2022 17:38:52 +0800	[thread overview]
Message-ID: <20220209093857.79364-2-jie1x.wang@intel.com> (raw)
In-Reply-To: <20220209093857.79364-1-jie1x.wang@intel.com>

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.

Signed-off-by: Jie Wang <jie1x.wang@intel.com>
---
 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(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 9f10f35b40..e2fb7c9905 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -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,
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index e812f57151..de1ec14bc7 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -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 },
 };
 
diff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst
index f03183ee86..17c25d899c 100644
--- a/doc/guides/rel_notes/release_22_03.rst
+++ b/doc/guides/rel_notes/release_22_03.rst
@@ -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
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index b2e98df6e1..f8adcb0a40 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -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.
 
diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
index 2660e4f374..e6bc1c808a 100644
--- a/lib/ethdev/rte_ethdev.h
+++ b/lib/ethdev/rte_ethdev.h
@@ -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
-- 
2.25.1


  reply	other threads:[~2022-02-09  9:39 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-29  6:24 [PATCH v3 0/6] support L2TPv2 for AVF RSS hash and FDIR Jie Wang
2022-01-29  6:24 ` [PATCH v3 1/6] ethdev: add L2TPv2 RSS offload type Jie Wang
2022-01-30  9:15   ` Ori Kam
2022-02-01 12:19   ` Ferruh Yigit
2022-01-29  6:24 ` [PATCH v3 2/6] net: fix L2TPv2 common header Jie Wang
2022-01-30  9:17   ` Ori Kam
2022-02-01 12:20     ` Ferruh Yigit
2022-01-29  6:24 ` [PATCH v3 3/6] app/testpmd: add 6 types of L2TPv2 message Jie Wang
2022-01-30  9:19   ` Ori Kam
2022-01-29  6:24 ` [PATCH v3 4/6] common/iavf: add session ID fields for L2TPv2 Jie Wang
2022-01-29  6:24 ` [PATCH v3 5/6] net/iavf: support L2TPv2 for AVF HASH Jie Wang
2022-01-29  6:24 ` [PATCH v3 6/6] net/iavf: support L2TPv2 for AVF FDIR Jie Wang
2022-02-01 12:22 ` [PATCH v3 0/6] support L2TPv2 for AVF RSS hash and FDIR Ferruh Yigit
2022-02-08  8:38 ` [PATCH v4 " Jie Wang
2022-02-08  8:38   ` [PATCH v4 1/6] ethdev: add L2TPv2 RSS offload type Jie Wang
2022-02-08 13:13     ` Ferruh Yigit
2022-02-08 14:43       ` Ferruh Yigit
2022-02-08  8:38   ` [PATCH v4 2/6] net: fix L2TPv2 common header Jie Wang
2022-02-08  8:38   ` [PATCH v4 3/6] app/testpmd: add 6 types of L2TPv2 message Jie Wang
2022-02-08  8:38   ` [PATCH v4 4/6] common/iavf: add session ID fields for L2TPv2 Jie Wang
2022-02-08  8:38   ` [PATCH v4 5/6] net/iavf: support L2TPv2 for AVF HASH Jie Wang
2022-02-09  7:01     ` Xing, Beilei
2022-02-09  7:43       ` Wang, Jie1X
2022-02-09  8:17       ` Zhang, Qi Z
2022-02-08  8:38   ` [PATCH v4 6/6] net/iavf: support L2TPv2 for AVF FDIR Jie Wang
2022-02-09  7:30     ` Xing, Beilei
2022-02-09  7:45       ` Wang, Jie1X
2022-02-08 14:44   ` [PATCH v4 0/6] support L2TPv2 for AVF RSS hash and FDIR Ferruh Yigit
2022-02-09  8:20     ` Zhang, Qi Z
2022-02-09  9:38   ` [PATCH v5 " Jie Wang
2022-02-09  9:38     ` Jie Wang [this message]
2022-02-09 20:42       ` [PATCH v5 1/6] ethdev: add L2TPv2 RSS offload type Ferruh Yigit
2022-02-09  9:38     ` [PATCH v5 2/6] net: fix L2TPv2 common header Jie Wang
2022-02-09  9:38     ` [PATCH v5 3/6] app/testpmd: add 6 types of L2TPv2 message Jie Wang
2022-02-09  9:38     ` [PATCH v5 4/6] common/iavf: add session ID fields for L2TPv2 Jie Wang
2022-02-11  1:37       ` Zhang, Qi Z
2022-02-09  9:38     ` [PATCH v5 5/6] net/iavf: support L2TPv2 for AVF HASH Jie Wang
2022-02-09 12:21       ` Xing, Beilei
2022-02-09  9:38     ` [PATCH v5 6/6] net/iavf: support L2TPv2 for AVF FDIR Jie Wang
2022-02-09 20:44     ` [PATCH v5 0/6] support L2TPv2 for AVF RSS hash and FDIR Ferruh Yigit
2022-02-10  2:13       ` Wang, Jie1X

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=20220209093857.79364-2-jie1x.wang@intel.com \
    --to=jie1x.wang@intel.com \
    --cc=aman.deep.singh@intel.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=jingjing.wu@intel.com \
    --cc=olivier.matz@6wind.com \
    --cc=orika@nvidia.com \
    --cc=qi.z.zhang@intel.com \
    --cc=stevex.yang@intel.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

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

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).