[dpdk-dev,v1,2/2] app/testpmd: config all supported RSS functions

Message ID 20180409121035.148813-2-xuemingl@mellanox.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation fail Compilation issues

Commit Message

Xueming Li April 9, 2018, 12:10 p.m. UTC
  Only configure RSS hash functions supported by the device.

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
 app/test-pmd/cmdline.c | 6 ++++++
 1 file changed, 6 insertions(+)
  

Comments

Thomas Monjalon April 16, 2018, 10:53 p.m. UTC | #1
09/04/2018 14:10, Xueming Li:
> Only configure RSS hash functions supported by the device.
> 
> Signed-off-by: Xueming Li <xuemingl@mellanox.com>

This commit message is too short.
Please explain what was the behaviour, and why you change it.
  

Patch

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 40b31ad7e..c41dd71ce 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -1879,6 +1879,7 @@  cmd_config_rss_parsed(void *parsed_result,
 {
 	struct cmd_config_rss *res = parsed_result;
 	struct rte_eth_rss_conf rss_conf = { .rss_key_len = 0, };
+	struct rte_eth_dev_info dev_info = {0};
 	int diag;
 	uint8_t i;
 
@@ -1915,6 +1916,11 @@  cmd_config_rss_parsed(void *parsed_result,
 	}
 	rss_conf.rss_key = NULL;
 	for (i = 0; i < rte_eth_dev_count(); i++) {
+		if (!strcmp(res->value, "all")) {
+			rte_eth_dev_info_get(i, &dev_info);
+			if (dev_info.flow_type_rss_offloads)
+			    rss_conf.rss_hf = dev_info.flow_type_rss_offloads;
+		}
 		diag = rte_eth_dev_rss_hash_update(i, &rss_conf);
 		if (diag < 0)
 			printf("Configuration of RSS hash at ethernet port %d "