DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/bnxt: fix PCI per-function stats
@ 2020-09-21 17:45 Lance Richardson
  2020-09-22 23:54 ` Ajit Khaparde
  0 siblings, 1 reply; 2+ messages in thread
From: Lance Richardson @ 2020-09-21 17:45 UTC (permalink / raw)
  To: Ajit Khaparde, Somnath Kotur; +Cc: dev, stable

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(-)

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] net/bnxt: fix PCI per-function stats
  2020-09-21 17:45 [dpdk-dev] [PATCH] net/bnxt: fix PCI per-function stats Lance Richardson
@ 2020-09-22 23:54 ` Ajit Khaparde
  0 siblings, 0 replies; 2+ messages in thread
From: Ajit Khaparde @ 2020-09-22 23:54 UTC (permalink / raw)
  To: Lance Richardson; +Cc: Somnath Kotur, dpdk-dev, dpdk stable

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-22 23:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-21 17:45 [dpdk-dev] [PATCH] net/bnxt: fix PCI per-function stats Lance Richardson
2020-09-22 23:54 ` Ajit Khaparde

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git