net/bnxt: fix PCI per-function stats
PATCH 1/1 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")
Signed-off-by Lance Richardson <[email protected]>
--- drivers/net/bnxt/bnxt_stats.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/bnxt/bnxt_stats.c +2 -1
@@ -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++; }
Signature · 1 line
2.25.1
Ajit Khaparde
AppliedQuoted 10 lines · Lance Richardson
Fix to use correct value offset for PCI function stats.
Fixes 5f9374de2a3a ("net/bnxt: add PCI function stats to extended stats")Signed-off-by Lance Richardson <[email protected]>
Applied to dpdk-next-net-brcm. Thanks
Quoted 24 lines
--- drivers/net/bnxt/bnxt_stats.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/net/bnxt/bnxt_stats.c +2
-1@@ -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.25.1