[dpdk-dev,v2,1/2] ethdev: add tunnel and port RSS offload types

Message ID 1459250409-5123-2-git-send-email-jerin.jacob@caviumnetworks.com (mailing list archive)
State Superseded, archived
Headers

Commit Message

Jerin Jacob March 29, 2016, 11:20 a.m. UTC
  - added VXLAN, GENEVE and NVGRE tunnel flow types
- added PORT flow type for accounting physical/virtual
port or channel number in flow creation

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
 app/test-pmd/cmdline.c          | 18 +++++++++++++++---
 app/test-pmd/config.c           |  9 +++++++++
 lib/librte_ether/rte_eth_ctrl.h |  6 +++++-
 lib/librte_ether/rte_ethdev.h   | 16 +++++++++++++++-
 4 files changed, 44 insertions(+), 5 deletions(-)
  

Comments

John McNamara March 29, 2016, 11:26 a.m. UTC | #1
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jerin Jacob
> Sent: Tuesday, March 29, 2016 12:20 PM
> To: dev@dpdk.org
> Cc: thomas.monjalon@6wind.com; Richardson, Bruce
> <bruce.richardson@intel.com>; Jerin Jacob <jerin.jacob@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH v2 1/2] ethdev: add tunnel and port RSS offload
> types
> 
> ...
>
> -			"port config all rss (all|ip|tcp|udp|sctp|ether|none)\n"
> +			"port config all rss (all|ip|tcp|udp|sctp|ether|port|vxlan|geneve|nvgre|none)\n"

Hi,

Just a reminder that if the testpmd interface is changed you need to update the testpmd documentation as well.

John
  
De Lara Guarch, Pablo March 29, 2016, 11:58 a.m. UTC | #2
Hi Jerin,

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jerin Jacob
> Sent: Tuesday, March 29, 2016 12:20 PM
> To: dev@dpdk.org
> Cc: thomas.monjalon@6wind.com; Richardson, Bruce; Jerin Jacob
> Subject: [dpdk-dev] [PATCH v2 1/2] ethdev: add tunnel and port RSS offload
> types
> 
> - added VXLAN, GENEVE and NVGRE tunnel flow types
> - added PORT flow type for accounting physical/virtual
> port or channel number in flow creation
> 
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> ---
>  app/test-pmd/cmdline.c          | 18 +++++++++++++++---
>  app/test-pmd/config.c           |  9 +++++++++
>  lib/librte_ether/rte_eth_ctrl.h |  6 +++++-
>  lib/librte_ether/rte_ethdev.h   | 16 +++++++++++++++-
>  4 files changed, 44 insertions(+), 5 deletions(-)
> 
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
> index 93203f4..5fe8239 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c
> @@ -565,7 +565,7 @@ static void cmd_help_long_parsed(void
> *parsed_result,
>  			"    Set crc-strip/rx-checksum/hardware-
> vlan/drop_en"
>  			" for ports.\n\n"
> 
> -			"port config all rss
> (all|ip|tcp|udp|sctp|ether|none)\n"
> +			"port config all rss
> (all|ip|tcp|udp|sctp|ether|port|vxlan|geneve|nvgre|none)\n"

Could you update the testpmd document and extend the options in the command line help?

Thanks,
Pablo
  
Jerin Jacob March 30, 2016, 8:47 p.m. UTC | #3
On Tue, Mar 29, 2016 at 11:58:47AM +0000, De Lara Guarch, Pablo wrote:
> Hi Jerin,
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jerin Jacob
> > Sent: Tuesday, March 29, 2016 12:20 PM
> > To: dev@dpdk.org
> > Cc: thomas.monjalon@6wind.com; Richardson, Bruce; Jerin Jacob
> > Subject: [dpdk-dev] [PATCH v2 1/2] ethdev: add tunnel and port RSS offload
> > types
> > 
> > - added VXLAN, GENEVE and NVGRE tunnel flow types
> > - added PORT flow type for accounting physical/virtual
> > port or channel number in flow creation
> > 
> > Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> > ---
> >  app/test-pmd/cmdline.c          | 18 +++++++++++++++---
> >  app/test-pmd/config.c           |  9 +++++++++
> >  lib/librte_ether/rte_eth_ctrl.h |  6 +++++-
> >  lib/librte_ether/rte_ethdev.h   | 16 +++++++++++++++-
> >  4 files changed, 44 insertions(+), 5 deletions(-)
> > 
> > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
> > index 93203f4..5fe8239 100644
> > --- a/app/test-pmd/cmdline.c
> > +++ b/app/test-pmd/cmdline.c
> > @@ -565,7 +565,7 @@ static void cmd_help_long_parsed(void
> > *parsed_result,
> >  			"    Set crc-strip/rx-checksum/hardware-
> > vlan/drop_en"
> >  			" for ports.\n\n"
> > 
> > -			"port config all rss
> > (all|ip|tcp|udp|sctp|ether|none)\n"
> > +			"port config all rss
> > (all|ip|tcp|udp|sctp|ether|port|vxlan|geneve|nvgre|none)\n"
> 
> Could you update the testpmd document and extend the options in the command line help?
Hi John and Pablo,

I will send the V3 with testpmd document update. Command line help is
already part of V2

> 
> Thanks,
> Pablo
> 
>
  
Jerin Jacob March 30, 2016, 8:51 p.m. UTC | #4
v1..v2
- Added cover letter
- Corrected typo in RET_ETH_FLOW_VXLAN name
- Updated test-pmd application to access newly defined RSS offload flags

v2..v3
-testpmd document update(Suggested by John and Pablo)

Jerin Jacob (2):
  ethdev: add tunnel and port RSS offload types
  ethdev: add ETH_RSS_RETA_SIZE_256

 app/test-pmd/cmdline.c                      | 18 +++++++++++++++---
 app/test-pmd/config.c                       |  9 +++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  6 +++++-
 lib/librte_ether/rte_eth_ctrl.h             |  6 +++++-
 lib/librte_ether/rte_ethdev.h               | 17 ++++++++++++++++-
 5 files changed, 50 insertions(+), 6 deletions(-)
  

Patch

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 93203f4..5fe8239 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -565,7 +565,7 @@  static void cmd_help_long_parsed(void *parsed_result,
 			"    Set crc-strip/rx-checksum/hardware-vlan/drop_en"
 			" for ports.\n\n"
 
-			"port config all rss (all|ip|tcp|udp|sctp|ether|none)\n"
+			"port config all rss (all|ip|tcp|udp|sctp|ether|port|vxlan|geneve|nvgre|none)\n"
 			"    Set the RSS mode.\n\n"
 
 			"port config port-id rss reta (hash,queue)[,(hash,queue)]\n"
@@ -1545,6 +1545,14 @@  cmd_config_rss_parsed(void *parsed_result,
 		rss_conf.rss_hf = ETH_RSS_SCTP;
 	else if (!strcmp(res->value, "ether"))
 		rss_conf.rss_hf = ETH_RSS_L2_PAYLOAD;
+	else if (!strcmp(res->value, "port"))
+		rss_conf.rss_hf = ETH_RSS_PORT;
+	else if (!strcmp(res->value, "vxlan"))
+		rss_conf.rss_hf = ETH_RSS_VXLAN;
+	else if (!strcmp(res->value, "geneve"))
+		rss_conf.rss_hf = ETH_RSS_GENEVE;
+	else if (!strcmp(res->value, "nvgre"))
+		rss_conf.rss_hf = ETH_RSS_NVGRE;
 	else if (!strcmp(res->value, "none"))
 		rss_conf.rss_hf = 0;
 	else {
@@ -1566,12 +1574,12 @@  cmdline_parse_token_string_t cmd_config_rss_name =
 	TOKEN_STRING_INITIALIZER(struct cmd_config_rss, name, "rss");
 cmdline_parse_token_string_t cmd_config_rss_value =
 	TOKEN_STRING_INITIALIZER(struct cmd_config_rss, value,
-		"all#ip#tcp#udp#sctp#ether#none");
+		"all#ip#tcp#udp#sctp#ether#port#vxlan#geneve#nvgre#none");
 
 cmdline_parse_inst_t cmd_config_rss = {
 	.f = cmd_config_rss_parsed,
 	.data = NULL,
-	.help_str = "port config all rss all|ip|tcp|udp|sctp|ether|none",
+	.help_str = "port config all rss all|ip|tcp|udp|sctp|ether|port|vxlan|geneve|nvgre|none",
 	.tokens = {
 		(void *)&cmd_config_rss_port,
 		(void *)&cmd_config_rss_keyword,
@@ -9304,6 +9312,10 @@  flowtype_to_str(uint16_t ftype)
 		{"ipv6-sctp", RTE_ETH_FLOW_NONFRAG_IPV6_SCTP},
 		{"ipv6-other", RTE_ETH_FLOW_NONFRAG_IPV6_OTHER},
 		{"l2_payload", RTE_ETH_FLOW_L2_PAYLOAD},
+		{"port", RTE_ETH_FLOW_PORT},
+		{"vxlan", RTE_ETH_FLOW_VXLAN},
+		{"geneve", RTE_ETH_FLOW_GENEVE},
+		{"nvgre", RTE_ETH_FLOW_NVGRE},
 	};
 
 	for (i = 0; i < RTE_DIM(ftype_table); i++) {
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index b1bbec6..0b3619d 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -137,6 +137,11 @@  static const struct rss_type_info rss_type_table[] = {
 	{ "ipv6-ex", ETH_RSS_IPV6_EX },
 	{ "ipv6-tcp-ex", ETH_RSS_IPV6_TCP_EX },
 	{ "ipv6-udp-ex", ETH_RSS_IPV6_UDP_EX },
+	{ "port", ETH_RSS_PORT },
+	{ "vxlan", ETH_RSS_VXLAN },
+	{ "geneve", ETH_RSS_GENEVE },
+	{ "nvgre", ETH_RSS_NVGRE },
+
 };
 
 static void
@@ -2028,6 +2033,10 @@  flowtype_to_str(uint16_t flow_type)
 		{"ipv6-sctp", RTE_ETH_FLOW_NONFRAG_IPV6_SCTP},
 		{"ipv6-other", RTE_ETH_FLOW_NONFRAG_IPV6_OTHER},
 		{"l2_payload", RTE_ETH_FLOW_L2_PAYLOAD},
+		{"port", RTE_ETH_FLOW_PORT},
+		{"vxlan", RTE_ETH_FLOW_VXLAN},
+		{"geneve", RTE_ETH_FLOW_GENEVE},
+		{"nvgre", RTE_ETH_FLOW_NVGRE},
 	};
 
 	for (i = 0; i < RTE_DIM(flowtype_str_table); i++) {
diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h
index aabd724..d57e967 100644
--- a/lib/librte_ether/rte_eth_ctrl.h
+++ b/lib/librte_ether/rte_eth_ctrl.h
@@ -74,7 +74,11 @@  extern "C" {
 #define RTE_ETH_FLOW_IPV6_EX            15
 #define RTE_ETH_FLOW_IPV6_TCP_EX        16
 #define RTE_ETH_FLOW_IPV6_UDP_EX        17
-#define RTE_ETH_FLOW_MAX                18
+#define RTE_ETH_FLOW_PORT               18
+#define RTE_ETH_FLOW_VXLAN              19
+#define RTE_ETH_FLOW_GENEVE             20
+#define RTE_ETH_FLOW_NVGRE              21
+#define RTE_ETH_FLOW_MAX                22
 
 /**
  * Feature filter types
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index e7de34a..a4eeeba 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -406,6 +406,10 @@  struct rte_eth_rss_conf {
 #define ETH_RSS_IPV6_EX            (1ULL << RTE_ETH_FLOW_IPV6_EX)
 #define ETH_RSS_IPV6_TCP_EX        (1ULL << RTE_ETH_FLOW_IPV6_TCP_EX)
 #define ETH_RSS_IPV6_UDP_EX        (1ULL << RTE_ETH_FLOW_IPV6_UDP_EX)
+#define ETH_RSS_PORT               (1ULL << RTE_ETH_FLOW_PORT)
+#define ETH_RSS_VXLAN              (1ULL << RTE_ETH_FLOW_VXLAN)
+#define ETH_RSS_GENEVE             (1ULL << RTE_ETH_FLOW_GENEVE)
+#define ETH_RSS_NVGRE              (1ULL << RTE_ETH_FLOW_NVGRE)
 
 #define ETH_RSS_IP ( \
 	ETH_RSS_IPV4 | \
@@ -430,6 +434,12 @@  struct rte_eth_rss_conf {
 	ETH_RSS_NONFRAG_IPV4_SCTP | \
 	ETH_RSS_NONFRAG_IPV6_SCTP)
 
+#define ETH_RSS_TUNNEL ( \
+	ETH_RSS_VXLAN  | \
+	ETH_RSS_GENEVE | \
+	ETH_RSS_NVGRE)
+
+
 /**< Mask of valid RSS hash protocols */
 #define ETH_RSS_PROTO_MASK ( \
 	ETH_RSS_IPV4 | \
@@ -447,7 +457,11 @@  struct rte_eth_rss_conf {
 	ETH_RSS_L2_PAYLOAD | \
 	ETH_RSS_IPV6_EX | \
 	ETH_RSS_IPV6_TCP_EX | \
-	ETH_RSS_IPV6_UDP_EX)
+	ETH_RSS_IPV6_UDP_EX | \
+	ETH_RSS_PORT  | \
+	ETH_RSS_VXLAN | \
+	ETH_RSS_GENEVE | \
+	ETH_RSS_NVGRE)
 
 /*
  * Definitions used for redirection table entry size.