From patchwork Fri Aug 11 08:57:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nithin Dabilpuram X-Patchwork-Id: 130126 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4953843032; Fri, 11 Aug 2023 10:59:24 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BEADE4327D; Fri, 11 Aug 2023 10:58:48 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 8583C4327D for ; Fri, 11 Aug 2023 10:58:47 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 37AMj86v014471 for ; Fri, 11 Aug 2023 01:58:47 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=bP8bmSUkKTCb806p3hJVR4+dQUbmgAF3OBavbArNFCo=; b=RiVcirto9ZQnsif9LDYfFseIgeLaoC1KliBXxoO0teXa7xobGufRBntes3j2u/WIn490 DQjEbGhGPSLPYludHvJLRWnb8rwjisdb5edoWUP5RpLfiYRs1Vu8TO9HiVEQHIZ3qIHb I9pFojCyTTQQVIFh4RDVU7hWTjGxVpvN4Ohaz52uZXJlcDedGVssjyMti+c6AxC/sQx2 yeXMaX5Ivshp+ESWL5op620uK237vlIb+AXsPNTBjBX4ZR9634spejB8QVqQ9touaVTj v23odUsgd3/16Es+hE0AITrPZe1HnCiHOi1xTAAwVDh9nCzWVQJll+KlS0Yp7AoP9+4n Dw== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3sd8ya1g99-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Fri, 11 Aug 2023 01:58:46 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Fri, 11 Aug 2023 01:58:44 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Fri, 11 Aug 2023 01:58:44 -0700 Received: from hyd1588t430.caveonetworks.com (unknown [10.29.52.204]) by maili.marvell.com (Postfix) with ESMTP id 708A53F706A; Fri, 11 Aug 2023 01:58:42 -0700 (PDT) From: Nithin Dabilpuram To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao CC: , , Akhil Goyal Subject: [PATCH 12/31] common/cnxk: remove unnecessory ROC API calls Date: Fri, 11 Aug 2023 14:27:46 +0530 Message-ID: <20230811085805.441256-12-ndabilpuram@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230811085805.441256-1-ndabilpuram@marvell.com> References: <20230811085805.441256-1-ndabilpuram@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: dB5K_D72nl_vAVXeWVx62xi2-GTtBW1Q X-Proofpoint-GUID: dB5K_D72nl_vAVXeWVx62xi2-GTtBW1Q X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-08-10_20,2023-08-10_01,2023-05-22_02 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Akhil Goyal 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 --- 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++;