* [PATCH] net/cnxk: fix to display extended stats
@ 2022-07-01 12:51 Rakesh Kudurumalla
2022-07-04 12:59 ` Jerin Jacob
0 siblings, 1 reply; 2+ messages in thread
From: Rakesh Kudurumalla @ 2022-07-01 12:51 UTC (permalink / raw)
To: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao
Cc: dev, jerinj, Rakesh Kudurumalla
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] net/cnxk: fix to display extended stats
2022-07-01 12:51 [PATCH] net/cnxk: fix to display extended stats Rakesh Kudurumalla
@ 2022-07-04 12:59 ` Jerin Jacob
0 siblings, 0 replies; 2+ messages in thread
From: Jerin Jacob @ 2022-07-04 12:59 UTC (permalink / raw)
To: Rakesh Kudurumalla
Cc: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao,
dpdk-dev, Jerin Jacob
On Fri, Jul 1, 2022 at 6:21 PM Rakesh Kudurumalla
<rkudurumalla@marvell.com> wrote:
>
> 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>
Updated the git commit as follows and applied to
dpdk-next-net-mrvl/for-next-net. Thanks
net/cnxk: fix to display extended stats
This fix replaces the usage of roc_nix_num_xstats_get() which is compile
time RoC API with runtime RoC roc_nix_xstats_names_get() API resolving
xstat count difference for cn9k and cn10k while displaying xstats
for ethdev ports
Fixes: 825bd1d9d8e6 ("common/cnxk: update extra stats for inline device")
Cc: stable@dpdk.org
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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-07-04 13:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-01 12:51 [PATCH] net/cnxk: fix to display extended stats Rakesh Kudurumalla
2022-07-04 12:59 ` Jerin Jacob
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).