From 739e5982f92f31057a1b41983f41912edaee266a Mon Sep 17 00:00:00 2001 From: Lance Richardson Date: Mon, 21 Sep 2020 13:45:49 -0400 Subject: [PATCH] net/bnxt: fix PCI per function stats Fix to use correct value offset for PCI function stats. Fixes: 5f9374de2a3a ("net/bnxt: add PCI function stats to extended stats") Cc: stable@dpdk.org Signed-off-by: Lance Richardson Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_stats.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/bnxt/bnxt_stats.c b/drivers/net/bnxt/bnxt_stats.c index 8df6922f52..cb7756d54f 100644 --- a/drivers/net/bnxt/bnxt_stats.c +++ b/drivers/net/bnxt/bnxt_stats.c @@ -643,7 +643,8 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev, for (i = 0; i < RTE_DIM(bnxt_func_stats_strings); i++) { xstats[count].id = count; xstats[count].value = - rte_le_to_cpu_64(((uint64_t *)&func_qstats)[i]); + rte_le_to_cpu_64(*(uint64_t *)((char *)&func_qstats + + bnxt_func_stats_strings[i].offset)); count++; } -- 2.20.1