[dpdk-dev,v3,2/2] app/testpmd: only config supported RSS hash types

Message ID 20180418081106.18074-2-xuemingl@mellanox.com (mailing list archive)
State Superseded, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail apply patch file failure

Commit Message

Xueming Li April 18, 2018, 8:11 a.m. UTC
  "port config all rss all" command will fail on PMD that not support any
of hard coding RSS hash types. This patch changed hard coding hash types
to supported types retrieved from device info.

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

Patch

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 512e3b55e..d357de7e6 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -1998,6 +1998,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;
 
@@ -2034,6 +2035,12 @@  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 "