DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] app/testpmd: fix displaying RSS hash functions
@ 2018-10-04 19:24 Ferruh Yigit
  2018-10-08 11:12 ` Iremonger, Bernard
  0 siblings, 1 reply; 3+ messages in thread
From: Ferruh Yigit @ 2018-10-04 19:24 UTC (permalink / raw)
  To: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic
  Cc: dev, Ferruh Yigit, stable, nelio.laranjeiro

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")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
Cc: nelio.laranjeiro@6wind.com
This patch is almost like reverting the patch in the Fixes, I wonder
what was the motivation for that change, am I missing something?
---
 app/test-pmd/cmdline.c                      | 28 ++++-----------------
 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(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 3376a665c..6a769bb82 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,
 			" 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"
@@ -2904,8 +2901,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 =
@@ -2917,28 +2913,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 <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 <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,
 	},
 };
@@ -2946,16 +2932,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 <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 009c92c7a..f7b7e70c9 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1678,9 +1678,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;
@@ -1691,7 +1691,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))
@@ -1701,12 +1700,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++) {
-		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 11afb487f..7951fd548 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -705,8 +705,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);
 int rx_queue_id_is_invalid(queueid_t rxq_id);
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 3a73000a6..9ef2aca9b 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
 
 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.17.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: fix displaying RSS hash functions
  2018-10-04 19:24 [dpdk-dev] [PATCH] app/testpmd: fix displaying RSS hash functions Ferruh Yigit
@ 2018-10-08 11:12 ` Iremonger, Bernard
  2018-10-09 10:00   ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Iremonger, Bernard @ 2018-10-08 11:12 UTC (permalink / raw)
  To: Yigit, Ferruh, Lu, Wenzhuo, Wu, Jingjing, Mcnamara, John,
	Kovacevic, Marko
  Cc: dev, stable, nelio.laranjeiro

> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Thursday, October 4, 2018 8:25 PM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Iremonger, Bernard <bernard.iremonger@intel.com>;
> Mcnamara, John <john.mcnamara@intel.com>; Kovacevic, Marko
> <marko.kovacevic@intel.com>
> Cc: dev@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>; stable@dpdk.org;
> nelio.laranjeiro@6wind.com
> Subject: [PATCH] app/testpmd: fix displaying RSS hash functions
> 
> 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")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
> Cc: nelio.laranjeiro@6wind.com

Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: fix displaying RSS hash functions
  2018-10-08 11:12 ` Iremonger, Bernard
@ 2018-10-09 10:00   ` Ferruh Yigit
  0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2018-10-09 10:00 UTC (permalink / raw)
  To: Iremonger, Bernard, Lu, Wenzhuo, Wu, Jingjing, Mcnamara, John,
	Kovacevic, Marko
  Cc: dev, stable, nelio.laranjeiro

On 10/8/2018 12:12 PM, Iremonger, Bernard wrote:
>> -----Original Message-----
>> From: Yigit, Ferruh
>> Sent: Thursday, October 4, 2018 8:25 PM
>> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
>> <jingjing.wu@intel.com>; Iremonger, Bernard <bernard.iremonger@intel.com>;
>> Mcnamara, John <john.mcnamara@intel.com>; Kovacevic, Marko
>> <marko.kovacevic@intel.com>
>> Cc: dev@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>; stable@dpdk.org;
>> nelio.laranjeiro@6wind.com
>> Subject: [PATCH] app/testpmd: fix displaying RSS hash functions
>>
>> 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")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
>> ---
>> Cc: nelio.laranjeiro@6wind.com
> 
> Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-10-09 10:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-04 19:24 [dpdk-dev] [PATCH] app/testpmd: fix displaying RSS hash functions Ferruh Yigit
2018-10-08 11:12 ` Iremonger, Bernard
2018-10-09 10:00   ` Ferruh Yigit

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).