[dpdk-stable] [PATCH 2/3] app/testpmd: fix RSS hash type update

Maxime Coquelin maxime.coquelin at redhat.com
Fri Sep 10 11:17:33 CEST 2021


port_rss_hash_key_update() initializes rss_conf with the
RSS hash type and key provided by the user, but it calls
rte_eth_dev_rss_hash_conf_get() before calling
rte_eth_dev_rss_hash_update(), which overides the parsed
config with current NIC's config.

While the RSS key value is set again after, this is not
the case of the key length and the type of hash.

There is no need to read the RSS config from the NIC, let's
just try to set the user defined one.

Fixes: 8205e241b2b0 ("app/testpmd: add missing type to RSS hash commands")
Cc: stable at dpdk.org
Cc: nelio.laranjeiro at 6wind.com

Signed-off-by: Maxime Coquelin <maxime.coquelin at redhat.com>
---
 app/test-pmd/config.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 31d8ba1b91..451bda53b1 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -2853,18 +2853,14 @@ port_rss_hash_key_update(portid_t port_id, char rss_type[], uint8_t *hash_key,
 	int diag;
 	unsigned int i;
 
-	rss_conf.rss_key = NULL;
+	rss_conf.rss_key = hash_key;
 	rss_conf.rss_key_len = hash_key_len;
 	rss_conf.rss_hf = 0;
 	for (i = 0; rss_type_table[i].str; i++) {
 		if (!strcmp(rss_type_table[i].str, rss_type))
 			rss_conf.rss_hf = rss_type_table[i].rss_type;
 	}
-	diag = rte_eth_dev_rss_hash_conf_get(port_id, &rss_conf);
-	if (diag == 0) {
-		rss_conf.rss_key = hash_key;
-		diag = rte_eth_dev_rss_hash_update(port_id, &rss_conf);
-	}
+	diag = rte_eth_dev_rss_hash_update(port_id, &rss_conf);
 	if (diag == 0)
 		return;
 
-- 
2.31.1



More information about the stable mailing list