From: Akhil Goyal <gak...@marvell.com> Removed the calls to roc_nix_num_rx[tx]_xstats which does a model check again for cn9k/cn10k. The model check is already done before the call in the same leg, hence not needed to call these APIs.
Signed-off-by: Akhil Goyal <gak...@marvell.com> --- drivers/common/cnxk/roc_nix_stats.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/common/cnxk/roc_nix_stats.c b/drivers/common/cnxk/roc_nix_stats.c index 1e93191a07..7a9619b39d 100644 --- a/drivers/common/cnxk/roc_nix_stats.c +++ b/drivers/common/cnxk/roc_nix_stats.c @@ -400,14 +400,14 @@ roc_nix_xstats_get(struct roc_nix *roc_nix, struct roc_nix_xstat *xstats, if (rc) goto exit; - for (i = 0; i < roc_nix_num_rx_xstats(); i++) { + for (i = 0; i < CNXK_NIX_NUM_RX_XSTATS_CGX; i++) { xstats[count].value = cgx_resp->rx_stats[nix_rx_xstats_cgx[i].offset]; xstats[count].id = count; count++; } - for (i = 0; i < roc_nix_num_tx_xstats(); i++) { + for (i = 0; i < CNXK_NIX_NUM_TX_XSTATS_CGX; i++) { xstats[count].value = cgx_resp->tx_stats[nix_tx_xstats_cgx[i].offset]; xstats[count].id = count; @@ -426,14 +426,14 @@ roc_nix_xstats_get(struct roc_nix *roc_nix, struct roc_nix_xstat *xstats, if (rc) goto exit; - for (i = 0; i < roc_nix_num_rx_xstats(); i++) { + for (i = 0; i < CNXK_NIX_NUM_RX_XSTATS_RPM; i++) { xstats[count].value = rpm_resp->rx_stats[nix_rx_xstats_rpm[i].offset]; xstats[count].id = count; count++; } - for (i = 0; i < roc_nix_num_tx_xstats(); i++) { + for (i = 0; i < CNXK_NIX_NUM_TX_XSTATS_RPM; i++) { xstats[count].value = rpm_resp->tx_stats[nix_tx_xstats_rpm[i].offset]; xstats[count].id = count; @@ -504,26 +504,26 @@ roc_nix_xstats_names_get(struct roc_nix *roc_nix, return count; if (roc_model_is_cn9k()) { - for (i = 0; i < roc_nix_num_rx_xstats(); i++) { + for (i = 0; i < CNXK_NIX_NUM_RX_XSTATS_CGX; i++) { NIX_XSTATS_NAME_PRINT(xstats_names, count, nix_rx_xstats_cgx, i); count++; } - for (i = 0; i < roc_nix_num_tx_xstats(); i++) { + for (i = 0; i < CNXK_NIX_NUM_TX_XSTATS_CGX; i++) { NIX_XSTATS_NAME_PRINT(xstats_names, count, nix_tx_xstats_cgx, i); count++; } } else { - for (i = 0; i < roc_nix_num_rx_xstats(); i++) { + for (i = 0; i < CNXK_NIX_NUM_RX_XSTATS_RPM; i++) { NIX_XSTATS_NAME_PRINT(xstats_names, count, nix_rx_xstats_rpm, i); count++; } - for (i = 0; i < roc_nix_num_tx_xstats(); i++) { + for (i = 0; i < CNXK_NIX_NUM_TX_XSTATS_RPM; i++) { NIX_XSTATS_NAME_PRINT(xstats_names, count, nix_tx_xstats_rpm, i); count++; -- 2.25.1