Skip to content

Commit

Permalink
app/procinfo: fix RSS info
Browse files Browse the repository at this point in the history
[ upstream commit 33079eccf5c1a99af722fe168d8465f602bc98b2 ]

Command show-port should show RSS info (rss_key, len and rss_hf),
However, the information is shown only when rss_conf.rss_key is not
NULL. Since no memory is allocated for rss_conf.rss_key, rss_key
will always be NULL and the rss_info will never show. This patch
fixes it.

Fixes: 8a37f37 ("app/procinfo: add --show-port")

Signed-off-by: Jie Hai <haijie1@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Huisong Li <lihuisong@huawei.com>
  • Loading branch information
Jie Hai authored and kevintraynor committed Nov 16, 2023
1 parent 774c444 commit ff10f5d
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions app/proc-info/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ static char *mempool_iter_name;
static uint32_t enable_dump_regs;
static char *dump_regs_file_prefix;

#define RSS_HASH_KEY_SIZE 64

/**< display usage */
static void
proc_info_usage(const char *prgname)
Expand Down Expand Up @@ -723,6 +725,7 @@ show_port(void)
struct rte_eth_fc_conf fc_conf;
struct rte_ether_addr mac;
struct rte_eth_dev_owner owner;
uint8_t rss_key[RSS_HASH_KEY_SIZE];

/* Skip if port is not in mask */
if ((enabled_port_mask & (1ul << i)) == 0)
Expand Down Expand Up @@ -866,17 +869,17 @@ show_port(void)
printf("\n");
}

rss_conf.rss_key = rss_key;
rss_conf.rss_key_len = dev_info.hash_key_size;
ret = rte_eth_dev_rss_hash_conf_get(i, &rss_conf);
if (ret == 0) {
if (rss_conf.rss_key) {
printf(" - RSS\n");
printf("\t -- RSS len %u key (hex):",
rss_conf.rss_key_len);
for (k = 0; k < rss_conf.rss_key_len; k++)
printf(" %x", rss_conf.rss_key[k]);
printf("\t -- hf 0x%"PRIx64"\n",
rss_conf.rss_hf);
}
printf(" - RSS\n");
printf("\t -- RSS len %u key (hex):",
rss_conf.rss_key_len);
for (k = 0; k < rss_conf.rss_key_len; k++)
printf(" %x", rss_conf.rss_key[k]);
printf("\t -- hf 0x%"PRIx64"\n",
rss_conf.rss_hf);
}

#ifdef RTE_LIB_SECURITY
Expand Down

0 comments on commit ff10f5d

Please sign in to comment.