summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorAdrien Mazarguil <adrien.mazarguil@6wind.com>2015-10-30 19:55:14 +0100
committerThomas Monjalon <thomas.monjalon@6wind.com>2015-11-01 11:23:30 +0100
commitf2f954a838f35f5103f93ba4b87aad429eaad406 (patch)
tree1a98845a3ef23a488944beac9b99d625d06fcd27 /app
parent8205e241b2b01c05f2cffe5158c053d614d1f68c (diff)
downloaddpdk-f2f954a838f35f5103f93ba4b87aad429eaad406.zip
dpdk-f2f954a838f35f5103f93ba4b87aad429eaad406.tar.gz
dpdk-f2f954a838f35f5103f93ba4b87aad429eaad406.tar.xz
app/testpmd: fix missing init in RSS hash show command
The "show port X rss-hash" command sometimes displays garbage instead of the expected RSS hash key because the maximum key length is undefined. When the requested key is too large to fit in the buffer, rte_eth_dev_rss_hash_conf_get() does not update it. Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com> Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Diffstat (limited to 'app')
-rw-r--r--app/test-pmd/config.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 8474706..d6f4e64 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -879,7 +879,7 @@ void
port_rss_hash_conf_show(portid_t port_id, char rss_info[], int show_rss_key)
{
struct rte_eth_rss_conf rss_conf;
- uint8_t rss_key[10 * 4];
+ uint8_t rss_key[10 * 4] = "";
uint64_t rss_hf;
uint8_t i;
int diag;
@@ -895,6 +895,7 @@ port_rss_hash_conf_show(portid_t port_id, char rss_info[], int show_rss_key)
/* Get RSS hash key if asked to display it */
rss_conf.rss_key = (show_rss_key) ? rss_key : NULL;
+ rss_conf.rss_key_len = sizeof(rss_key);
diag = rte_eth_dev_rss_hash_conf_get(port_id, &rss_conf);
if (diag != 0) {
switch (diag) {