net/bnxt: fix PCI per-function stats
diff mbox series

Message ID 20200921174549.269401-1-lance.richardson@broadcom.com
State Accepted
Delegated to: Ajit Khaparde
Headers show
Series
  • net/bnxt: fix PCI per-function stats
Related show

Checks

Context Check Description
ci/iol-broadcom-Functional success Functional Testing PASS
ci/travis-robot success Travis build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Lance Richardson Sept. 21, 2020, 5:45 p.m. UTC
Fix to use correct value offset for PCI function stats.

Fixes: 5f9374de2a3a ("net/bnxt: add PCI function stats to extended stats")

Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
Cc: stable@dpdk.org
Cc: ajit.khaparde@broadcom.com

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
---
 drivers/net/bnxt/bnxt_stats.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Ajit Khaparde Sept. 22, 2020, 11:54 p.m. UTC | #1
On Mon, Sep 21, 2020 at 10:45 AM Lance Richardson <
lance.richardson@broadcom.com> wrote:

> Fix to use correct value offset for PCI function stats.
>
> Fixes: 5f9374de2a3a ("net/bnxt: add PCI function stats to extended stats")
>
> Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
> Cc: stable@dpdk.org
> Cc: ajit.khaparde@broadcom.com
>
> Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
>
Applied to dpdk-next-net-brcm. Thanks


> ---
>  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.25.1
>
>

Patch
diff mbox series

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++;
 	}