DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rakesh Kudurumalla <rkudurumalla@marvell.com>
To: Nithin Dabilpuram <ndabilpuram@marvell.com>,
	Kiran Kumar K <kirankumark@marvell.com>,
	Sunil Kumar Kori <skori@marvell.com>,
	Satha Rao <skoteshwar@marvell.com>
Cc: <dev@dpdk.org>, <jerinj@marvell.com>,
	Rakesh Kudurumalla <rkudurumalla@marvell.com>
Subject: [PATCH] net/cnxk: fix to display extended stats
Date: Fri, 1 Jul 2022 18:21:10 +0530	[thread overview]
Message-ID: <20220701125110.512275-1-rkudurumalla@marvell.com> (raw)

This fix replaces the usage of roc_nix_num_xstats_get()
which is compile time api with runtime api
roc_nix_xstats_names_get() resolving xstat count
difference for cn9k and cn10k while displaying xstats
for dpdk ports

Fixes: 825bd1d9d8e6 ("common/cnxk: update extra stats for inline device")

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
 drivers/net/cnxk/cnxk_stats.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/cnxk/cnxk_stats.c b/drivers/net/cnxk/cnxk_stats.c
index 4b0deac05e..f2f2222c89 100644
--- a/drivers/net/cnxk/cnxk_stats.c
+++ b/drivers/net/cnxk/cnxk_stats.c
@@ -172,7 +172,7 @@ cnxk_nix_xstats_get_names(struct rte_eth_dev *eth_dev,
 	struct roc_nix *nix = &dev->nix;
 	int roc_size, size, i, q;
 
-	roc_size = roc_nix_num_xstats_get(nix);
+	roc_size = roc_nix_xstats_names_get(nix, NULL, 0);
 	/* Per Queue statistics also returned as part of xstats */
 	size = roc_size + (dev->nb_rxq * CNXK_NB_RXQ_STATS) +
 	       (dev->nb_txq * CNXK_NB_TXQ_STATS);
@@ -232,7 +232,7 @@ cnxk_nix_xstats_get_names_by_id(struct rte_eth_dev *eth_dev,
 				unsigned int limit)
 {
 	struct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev);
-	uint32_t nix_cnt = roc_nix_num_xstats_get(&dev->nix);
+	uint32_t nix_cnt = roc_nix_xstats_names_get(&dev->nix, NULL, 0);
 	uint32_t stat_cnt = nix_cnt + (dev->nb_rxq * CNXK_NB_RXQ_STATS) +
 			    (dev->nb_txq * CNXK_NB_TXQ_STATS);
 	struct rte_eth_xstat_name xnames[stat_cnt];
@@ -265,7 +265,7 @@ cnxk_nix_xstats_get_by_id(struct rte_eth_dev *eth_dev, const uint64_t *ids,
 			  uint64_t *values, unsigned int n)
 {
 	struct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev);
-	uint32_t nix_cnt = roc_nix_num_xstats_get(&dev->nix);
+	uint32_t nix_cnt = roc_nix_xstats_names_get(&dev->nix, NULL, 0);
 	uint32_t stat_cnt = nix_cnt + (dev->nb_rxq * CNXK_NB_RXQ_STATS) +
 			    (dev->nb_txq * CNXK_NB_TXQ_STATS);
 	struct rte_eth_xstat xstats[stat_cnt];
-- 
2.25.1


             reply	other threads:[~2022-07-01 12:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-01 12:51 Rakesh Kudurumalla [this message]
2022-07-04 12:59 ` Jerin Jacob

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220701125110.512275-1-rkudurumalla@marvell.com \
    --to=rkudurumalla@marvell.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=kirankumark@marvell.com \
    --cc=ndabilpuram@marvell.com \
    --cc=skori@marvell.com \
    --cc=skoteshwar@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).