[dpdk-stable] patch 'app/testpmd: fix displaying RSS hash functions' has been queued to LTS release 16.11.9

Luca Boccassi bluca at debian.org
Mon Oct 15 13:51:40 CEST 2018


Hi,

FYI, your patch has been queued to LTS release 16.11.9

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 10/17/18. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the patch applied
to the branch. If the code is different (ie: not only metadata diffs), due for example to
a change in context or macro names, please double check it.

Thanks.

Luca Boccassi

---
>From fd126c9f6d8535549005e2f312d895b6c1cca939 Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit at intel.com>
Date: Thu, 4 Oct 2018 20:24:44 +0100
Subject: [PATCH] app/testpmd: fix displaying RSS hash functions

[ upstream commit 5b4557ec8d16859215fafe9e24d3fb7722f43b8a ]

Command shouldn't ask RSS hash functions as argument to get supported
RSS hash function, those values will be overwritten by PMD anyway.

To display configured RSS hash functions
"show port (port_id) rss-hash"

To display configured RSS hash functions and hash key
"show port (port_id) rss-hash key"

Fixes: 8205e241b2b0 ("app/testpmd: add missing type to RSS hash commands")

Signed-off-by: Ferruh Yigit <ferruh.yigit at intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger at intel.com>
---
 app/test-pmd/cmdline.c                      | 30 ++++-----------------
 app/test-pmd/config.c                       | 11 ++------
 app/test-pmd/testpmd.h                      |  3 +--
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  2 +-
 4 files changed, 9 insertions(+), 37 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 27e3757330..4c63eb5de6 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -190,11 +190,8 @@ static void cmd_help_long_parsed(void *parsed_result,
 			" by masks on port X. size is used to indicate the"
 			" hardware supported reta size\n\n"
 
-			"show port rss-hash ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|"
-			"ipv4-sctp|ipv4-other|ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|"
-			"ipv6-other|l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex [key]\n"
-			"    Display the RSS hash functions and RSS hash key"
-			" of port X\n\n"
+			"show port (port_id) rss-hash [key]\n"
+			"    Display the RSS hash functions and RSS hash key of port\n\n"
 
 			"clear port (info|stats|xstats|fdir|stat_qmap) (port_id|all)\n"
 			"    Clear information for port_id, or all.\n\n"
@@ -2109,8 +2106,7 @@ static void cmd_showport_rss_hash_parsed(void *parsed_result,
 {
 	struct cmd_showport_rss_hash *res = parsed_result;
 
-	port_rss_hash_conf_show(res->port_id, res->rss_type,
-				show_rss_key != NULL);
+	port_rss_hash_conf_show(res->port_id, show_rss_key != NULL);
 }
 
 cmdline_parse_token_string_t cmd_showport_rss_hash_show =
@@ -2122,29 +2118,18 @@ cmdline_parse_token_num_t cmd_showport_rss_hash_port_id =
 cmdline_parse_token_string_t cmd_showport_rss_hash_rss_hash =
 	TOKEN_STRING_INITIALIZER(struct cmd_showport_rss_hash, rss_hash,
 				 "rss-hash");
-cmdline_parse_token_string_t cmd_showport_rss_hash_rss_hash_info =
-	TOKEN_STRING_INITIALIZER(struct cmd_showport_rss_hash, rss_type,
-				 "ipv4#ipv4-frag#ipv4-tcp#ipv4-udp#ipv4-sctp#"
-				 "ipv4-other#ipv6#ipv6-frag#ipv6-tcp#ipv6-udp#"
-				 "ipv6-sctp#ipv6-other#l2-payload#ipv6-ex#"
-				 "ipv6-tcp-ex#ipv6-udp-ex");
 cmdline_parse_token_string_t cmd_showport_rss_hash_rss_key =
 	TOKEN_STRING_INITIALIZER(struct cmd_showport_rss_hash, key, "key");
 
 cmdline_parse_inst_t cmd_showport_rss_hash = {
 	.f = cmd_showport_rss_hash_parsed,
 	.data = NULL,
-	.help_str =
-		"show port X rss-hash ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|"
-		"ipv4-sctp|ipv4-other|ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|"
-		"ipv6-sctp|ipv6-other|l2-payload|"
-		"ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex (X = port number)\n",
+	.help_str = "show port <port_id> rss-hash",
 	.tokens = {
 		(void *)&cmd_showport_rss_hash_show,
 		(void *)&cmd_showport_rss_hash_port,
 		(void *)&cmd_showport_rss_hash_port_id,
 		(void *)&cmd_showport_rss_hash_rss_hash,
-		(void *)&cmd_showport_rss_hash_rss_hash_info,
 		NULL,
 	},
 };
@@ -2152,17 +2137,12 @@ cmdline_parse_inst_t cmd_showport_rss_hash = {
 cmdline_parse_inst_t cmd_showport_rss_hash_key = {
 	.f = cmd_showport_rss_hash_parsed,
 	.data = (void *)1,
-	.help_str =
-		"show port X rss-hash ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|"
-		"ipv4-sctp|ipv4-other|ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|"
-		"ipv6-sctp|ipv6-other|l2-payload|"
-		"ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex key (X = port number)\n",
+	.help_str = "show port <port_id> rss-hash key",
 	.tokens = {
 		(void *)&cmd_showport_rss_hash_show,
 		(void *)&cmd_showport_rss_hash_port,
 		(void *)&cmd_showport_rss_hash_port_id,
 		(void *)&cmd_showport_rss_hash_rss_hash,
-		(void *)&cmd_showport_rss_hash_rss_hash_info,
 		(void *)&cmd_showport_rss_hash_rss_key,
 		NULL,
 	},
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 130ff14803..f427a83069 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1004,9 +1004,9 @@ port_rss_reta_info(portid_t port_id,
  * key of the port.
  */
 void
-port_rss_hash_conf_show(portid_t port_id, char rss_info[], int show_rss_key)
+port_rss_hash_conf_show(portid_t port_id, int show_rss_key)
 {
-	struct rte_eth_rss_conf rss_conf;
+	struct rte_eth_rss_conf rss_conf = {0};
 	uint8_t rss_key[RSS_HASH_KEY_LENGTH];
 	uint64_t rss_hf;
 	uint8_t i;
@@ -1017,7 +1017,6 @@ port_rss_hash_conf_show(portid_t port_id, char rss_info[], int show_rss_key)
 	if (port_id_is_invalid(port_id, ENABLED_WARN))
 		return;
 
-	memset(&dev_info, 0, sizeof(dev_info));
 	rte_eth_dev_info_get(port_id, &dev_info);
 	if (dev_info.hash_key_size > 0 &&
 			dev_info.hash_key_size <= sizeof(rss_key))
@@ -1027,12 +1026,6 @@ port_rss_hash_conf_show(portid_t port_id, char rss_info[], int show_rss_key)
 		return;
 	}
 
-	rss_conf.rss_hf = 0;
-	for (i = 0; i < RTE_DIM(rss_type_table); i++) {
-		if (!strcmp(rss_info, rss_type_table[i].str))
-			rss_conf.rss_hf = rss_type_table[i].rss_type;
-	}
-
 	/* Get RSS hash key if asked to display it */
 	rss_conf.rss_key = (show_rss_key) ? rss_key : NULL;
 	rss_conf.rss_key_len = hash_key_size;
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index aad598e56c..b52a19d9d4 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -579,8 +579,7 @@ int set_queue_rate_limit(portid_t port_id, uint16_t queue_idx, uint16_t rate);
 int set_vf_rate_limit(portid_t port_id, uint16_t vf, uint16_t rate,
 				uint64_t q_msk);
 
-void port_rss_hash_conf_show(portid_t port_id, char rss_info[],
-			     int show_rss_key);
+void port_rss_hash_conf_show(portid_t port_id, int show_rss_key);
 void port_rss_hash_key_update(portid_t port_id, char rss_type[],
 			      uint8_t *hash_key, uint hash_key_len);
 void get_syn_filter(uint8_t port_id);
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index a906974f72..45280c1c4c 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -201,7 +201,7 @@ show port rss-hash
 
 Display the RSS hash functions and RSS hash key of a port::
 
-   testpmd> show port (port_id) rss-hash ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex [key]
+   testpmd> show port (port_id) rss-hash [key]
 
 clear port
 ~~~~~~~~~~
-- 
2.19.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2018-10-15 12:48:35.115444338 +0100
+++ 0020-app-testpmd-fix-displaying-RSS-hash-functions.patch	2018-10-15 12:48:34.601096017 +0100
@@ -1,8 +1,10 @@
-From 5b4557ec8d16859215fafe9e24d3fb7722f43b8a Mon Sep 17 00:00:00 2001
+From fd126c9f6d8535549005e2f312d895b6c1cca939 Mon Sep 17 00:00:00 2001
 From: Ferruh Yigit <ferruh.yigit at intel.com>
 Date: Thu, 4 Oct 2018 20:24:44 +0100
 Subject: [PATCH] app/testpmd: fix displaying RSS hash functions
 
+[ upstream commit 5b4557ec8d16859215fafe9e24d3fb7722f43b8a ]
+
 Command shouldn't ask RSS hash functions as argument to get supported
 RSS hash function, those values will be overwritten by PMD anyway.
 
@@ -13,22 +15,21 @@
 "show port (port_id) rss-hash key"
 
 Fixes: 8205e241b2b0 ("app/testpmd: add missing type to RSS hash commands")
-Cc: stable at dpdk.org
 
 Signed-off-by: Ferruh Yigit <ferruh.yigit at intel.com>
 Acked-by: Bernard Iremonger <bernard.iremonger at intel.com>
 ---
- app/test-pmd/cmdline.c                      | 28 ++++-----------------
+ app/test-pmd/cmdline.c                      | 30 ++++-----------------
  app/test-pmd/config.c                       | 11 ++------
  app/test-pmd/testpmd.h                      |  3 +--
  doc/guides/testpmd_app_ug/testpmd_funcs.rst |  2 +-
- 4 files changed, 9 insertions(+), 35 deletions(-)
+ 4 files changed, 9 insertions(+), 37 deletions(-)
 
 diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
-index 3376a665cf..6a769bb82a 100644
+index 27e3757330..4c63eb5de6 100644
 --- a/app/test-pmd/cmdline.c
 +++ b/app/test-pmd/cmdline.c
-@@ -175,11 +175,8 @@ static void cmd_help_long_parsed(void *parsed_result,
+@@ -190,11 +190,8 @@ static void cmd_help_long_parsed(void *parsed_result,
  			" by masks on port X. size is used to indicate the"
  			" hardware supported reta size\n\n"
  
@@ -42,7 +43,7 @@
  
  			"clear port (info|stats|xstats|fdir|stat_qmap) (port_id|all)\n"
  			"    Clear information for port_id, or all.\n\n"
-@@ -2904,8 +2901,7 @@ static void cmd_showport_rss_hash_parsed(void *parsed_result,
+@@ -2109,8 +2106,7 @@ static void cmd_showport_rss_hash_parsed(void *parsed_result,
  {
  	struct cmd_showport_rss_hash *res = parsed_result;
  
@@ -52,7 +53,7 @@
  }
  
  cmdline_parse_token_string_t cmd_showport_rss_hash_show =
-@@ -2917,28 +2913,18 @@ cmdline_parse_token_num_t cmd_showport_rss_hash_port_id =
+@@ -2122,29 +2118,18 @@ cmdline_parse_token_num_t cmd_showport_rss_hash_port_id =
  cmdline_parse_token_string_t cmd_showport_rss_hash_rss_hash =
  	TOKEN_STRING_INITIALIZER(struct cmd_showport_rss_hash, rss_hash,
  				 "rss-hash");
@@ -68,10 +69,11 @@
  cmdline_parse_inst_t cmd_showport_rss_hash = {
  	.f = cmd_showport_rss_hash_parsed,
  	.data = NULL,
--	.help_str = "show port <port_id> rss-hash "
--		"ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|"
--		"ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|"
--		"l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex",
+-	.help_str =
+-		"show port X rss-hash ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|"
+-		"ipv4-sctp|ipv4-other|ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|"
+-		"ipv6-sctp|ipv6-other|l2-payload|"
+-		"ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex (X = port number)\n",
 +	.help_str = "show port <port_id> rss-hash",
  	.tokens = {
  		(void *)&cmd_showport_rss_hash_show,
@@ -82,14 +84,15 @@
  		NULL,
  	},
  };
-@@ -2946,16 +2932,12 @@ cmdline_parse_inst_t cmd_showport_rss_hash = {
+@@ -2152,17 +2137,12 @@ cmdline_parse_inst_t cmd_showport_rss_hash = {
  cmdline_parse_inst_t cmd_showport_rss_hash_key = {
  	.f = cmd_showport_rss_hash_parsed,
  	.data = (void *)1,
--	.help_str = "show port <port_id> rss-hash "
--		"ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|"
--		"ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|"
--		"l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex key",
+-	.help_str =
+-		"show port X rss-hash ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|"
+-		"ipv4-sctp|ipv4-other|ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|"
+-		"ipv6-sctp|ipv6-other|l2-payload|"
+-		"ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex key (X = port number)\n",
 +	.help_str = "show port <port_id> rss-hash key",
  	.tokens = {
  		(void *)&cmd_showport_rss_hash_show,
@@ -101,10 +104,10 @@
  		NULL,
  	},
 diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
-index 057457a814..5bd14bce06 100644
+index 130ff14803..f427a83069 100644
 --- a/app/test-pmd/config.c
 +++ b/app/test-pmd/config.c
-@@ -1679,9 +1679,9 @@ port_rss_reta_info(portid_t port_id,
+@@ -1004,9 +1004,9 @@ port_rss_reta_info(portid_t port_id,
   * key of the port.
   */
  void
@@ -116,7 +119,7 @@
  	uint8_t rss_key[RSS_HASH_KEY_LENGTH];
  	uint64_t rss_hf;
  	uint8_t i;
-@@ -1692,7 +1692,6 @@ port_rss_hash_conf_show(portid_t port_id, char rss_info[], int show_rss_key)
+@@ -1017,7 +1017,6 @@ port_rss_hash_conf_show(portid_t port_id, char rss_info[], int show_rss_key)
  	if (port_id_is_invalid(port_id, ENABLED_WARN))
  		return;
  
@@ -124,12 +127,12 @@
  	rte_eth_dev_info_get(port_id, &dev_info);
  	if (dev_info.hash_key_size > 0 &&
  			dev_info.hash_key_size <= sizeof(rss_key))
-@@ -1702,12 +1701,6 @@ port_rss_hash_conf_show(portid_t port_id, char rss_info[], int show_rss_key)
+@@ -1027,12 +1026,6 @@ port_rss_hash_conf_show(portid_t port_id, char rss_info[], int show_rss_key)
  		return;
  	}
  
 -	rss_conf.rss_hf = 0;
--	for (i = 0; rss_type_table[i].str; i++) {
+-	for (i = 0; i < RTE_DIM(rss_type_table); i++) {
 -		if (!strcmp(rss_info, rss_type_table[i].str))
 -			rss_conf.rss_hf = rss_type_table[i].rss_type;
 -	}
@@ -138,10 +141,10 @@
  	rss_conf.rss_key = (show_rss_key) ? rss_key : NULL;
  	rss_conf.rss_key_len = hash_key_size;
 diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
-index ae6a5bd4ef..3cd4bbb3e8 100644
+index aad598e56c..b52a19d9d4 100644
 --- a/app/test-pmd/testpmd.h
 +++ b/app/test-pmd/testpmd.h
-@@ -716,8 +716,7 @@ int set_queue_rate_limit(portid_t port_id, uint16_t queue_idx, uint16_t rate);
+@@ -579,8 +579,7 @@ int set_queue_rate_limit(portid_t port_id, uint16_t queue_idx, uint16_t rate);
  int set_vf_rate_limit(portid_t port_id, uint16_t vf, uint16_t rate,
  				uint64_t q_msk);
  
@@ -150,12 +153,12 @@
 +void port_rss_hash_conf_show(portid_t port_id, int show_rss_key);
  void port_rss_hash_key_update(portid_t port_id, char rss_type[],
  			      uint8_t *hash_key, uint hash_key_len);
- int rx_queue_id_is_invalid(queueid_t rxq_id);
+ void get_syn_filter(uint8_t port_id);
 diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
-index 3a73000a6c..9ef2aca9ba 100644
+index a906974f72..45280c1c4c 100644
 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
 +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
-@@ -231,7 +231,7 @@ show port rss-hash
+@@ -201,7 +201,7 @@ show port rss-hash
  
  Display the RSS hash functions and RSS hash key of a port::
  


More information about the stable mailing list