From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id EA002A0542; Mon, 29 Aug 2022 08:25:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7E70041147; Mon, 29 Aug 2022 08:24:58 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 4B8BF4069F for ; Mon, 29 Aug 2022 08:24:55 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27SMalXf019238 for ; Sun, 28 Aug 2022 23:24:54 -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=Daoj3AEauuy5OsWDpOry2S/EPdv00d1/Lcoixglq4h4=; b=iUu2M1EH17j2WagacPuurCPlHcxSA2eHposchSeXMblbqk/CsDyQ7aIt/izsBTK17wQ5 H3WtaSMR/kM2Jw0I3mM9aQ6UYiLkeYy/bKcnbv8r8suNeT+fnVyHRPvgkNYFt7LgxmwR XmdMTSxugUIZrq0mmdGCTEA1fKtmBtJj3u9z8NgPrEGu9F0DIIRavYEPZu87SdjvXMIg b0Xr/OJbDEbYJPrTImKHg2rDbMS9Y+5DBQXs5d0D6rsL83PtRbOu5gMPdZagrYOiZ8Jh 94BcVeJRO3ZuCqqp/s1HskGSYOfO5Qea5gVkpN6sSVVXfPfmmAQBDM/O/tStLapVJV1F TQ== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3j7gmqx7vm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Sun, 28 Aug 2022 23:24:54 -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.2; Sun, 28 Aug 2022 23:24:53 -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.2 via Frontend Transport; Sun, 28 Aug 2022 23:24:53 -0700 Received: from satheeshpaullabpc.. (unknown [10.28.34.33]) by maili.marvell.com (Postfix) with ESMTP id D31433F7062; Sun, 28 Aug 2022 23:24:50 -0700 (PDT) From: To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao CC: , Satheesh Paul Subject: [dpdk-dev] [PATCH v2 2/3] common/cnxk: print counters along with flow dump Date: Mon, 29 Aug 2022 11:54:41 +0530 Message-ID: <20220829062442.49728-2-psatheesh@marvell.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220829062442.49728-1-psatheesh@marvell.com> References: <20220801061629.1862969-1-psatheesh@marvell.com> <20220829062442.49728-1-psatheesh@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: tJNE5L0pt41qLWHb3pNWWvToP2kDpV0Z X-Proofpoint-ORIG-GUID: tJNE5L0pt41qLWHb3pNWWvToP2kDpV0Z X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-29_03,2022-08-25_01,2022-06-22_01 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: Satheesh Paul When dumping hardware flow data, print any counter configured on the flow as well. Signed-off-by: Satheesh Paul Reviewed-by: Kiran Kumar K --- drivers/common/cnxk/roc_npc_mcam_dump.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/common/cnxk/roc_npc_mcam_dump.c b/drivers/common/cnxk/roc_npc_mcam_dump.c index 16997bd38a..fe57811a84 100644 --- a/drivers/common/cnxk/roc_npc_mcam_dump.c +++ b/drivers/common/cnxk/roc_npc_mcam_dump.c @@ -590,12 +590,19 @@ roc_npc_flow_mcam_dump(FILE *file, struct roc_npc *roc_npc, struct npc *npc = roc_npc_to_npc_priv(roc_npc); struct npc_mcam_read_entry_req *mcam_read_req; struct npc_mcam_read_entry_rsp *mcam_read_rsp; + uint64_t count = 0; bool is_rx = 0; int i, rc = 0; fprintf(file, "MCAM Index:%d\n", flow->mcam_id); - fprintf(file, "Interface :%s (%d)\n", intf_str[flow->nix_intf], - flow->nix_intf); + if (flow->ctr_id != NPC_COUNTER_NONE && flow->use_ctr) { + rc = roc_npc_mcam_read_counter(roc_npc, flow->ctr_id, &count); + if (rc) + return; + fprintf(file, "Hit count: %" PRIu64 "\n", count); + } + + fprintf(file, "Interface :%s (%d)\n", intf_str[flow->nix_intf], flow->nix_intf); fprintf(file, "Priority :%d\n", flow->priority); if (flow->nix_intf == NIX_INTF_RX) -- 2.35.3