From patchwork Tue May 17 04:04:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Satheesh Paul Antonysamy X-Patchwork-Id: 111210 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 BBE81A00BE; Tue, 17 May 2022 06:04:24 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A0A0241109; Tue, 17 May 2022 06:04:24 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 707094068B for ; Tue, 17 May 2022 06:04:23 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24H0BjZG016647 for ; Mon, 16 May 2022 21:04:22 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=02RsdOhi5dpMXI/C+fNNHlr4tY+RMyjWPiUWggWiqrs=; b=OCiO+xqwjk4vFO2plqZsafh5gth+P8U3WDiIAWcOmLUfi6EnJh53jAc+4JGm3Qu3zizB t5nSGo1+eo+Zr6f7Zm8/HzIHrHd6Rfkp/3S79yDIV7cR83hInAQuu6OWVKOTESuiYEy/ xGOyRbT9WknplwZfzvWJWO/qqr00Toltoa4XWVqCyBbOoNWQGsr0Ks9nQwWJA673cw5Z hFjcQ8OGgyLaKrSqQsj5FwcJDjt8GmOWJ2UUAWZYrqWuLYPciGh+v/9263DxF+CKjaRo VQhoxc/Ex0Dt5Vek50+cMDZBeL2vaXfHqQr2WCyxRuXu23mMmUTYZJhZs8mdySzEU74Q DQ== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3g2bxst1g7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Mon, 16 May 2022 21:04:22 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 16 May 2022 21:04:20 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Mon, 16 May 2022 21:04:20 -0700 Received: from satheeshpaullabpc.. (unknown [10.28.34.33]) by maili.marvell.com (Postfix) with ESMTP id B17A53F70F2; Mon, 16 May 2022 21:04:18 -0700 (PDT) From: To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao CC: , Satheesh Paul Subject: [dpdk-dev] [PATCH] common/cnxk: dump hardware flow MCAM entry data Date: Tue, 17 May 2022 09:34:08 +0530 Message-ID: <20220517040408.158840-1-psatheesh@marvell.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: OGwadbJXd2oYu1q1d6wOGbncscCjPnp- X-Proofpoint-GUID: OGwadbJXd2oYu1q1d6wOGbncscCjPnp- X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-17_01,2022-05-16_02,2022-02-23_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 flow data, read hardware MCAM entry corresponding to the flow and print that data also. Signed-off-by: Satheesh Paul Reviewed-by: Kiran Kumar Kokkilagadda --- drivers/common/cnxk/roc_npc_mcam_dump.c | 26 ++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/drivers/common/cnxk/roc_npc_mcam_dump.c b/drivers/common/cnxk/roc_npc_mcam_dump.c index 679e3d7657..2aaf3ccd0b 100644 --- a/drivers/common/cnxk/roc_npc_mcam_dump.c +++ b/drivers/common/cnxk/roc_npc_mcam_dump.c @@ -586,8 +586,10 @@ roc_npc_flow_mcam_dump(FILE *file, struct roc_npc *roc_npc, struct roc_npc_flow *flow) { 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; bool is_rx = 0; - int i; + int i, rc = 0; fprintf(file, "MCAM Index:%d\n", flow->mcam_id); fprintf(file, "Interface :%s (%d)\n", intf_str[flow->nix_intf], @@ -609,5 +611,27 @@ roc_npc_flow_mcam_dump(FILE *file, struct roc_npc *roc_npc, fprintf(file, "\tDW%d_Mask:%016lX\n", i, flow->mcam_mask[i]); } + mcam_read_req = mbox_alloc_msg_npc_mcam_read_entry(npc->mbox); + if (mcam_read_req == NULL) { + plt_err("Failed to alloc msg"); + return; + } + + mcam_read_req->entry = flow->mcam_id; + rc = mbox_process_msg(npc->mbox, (void *)&mcam_read_rsp); + if (rc) { + plt_err("Failed to fetch MCAM entry"); + return; + } + + fprintf(file, "HW MCAM Data :\n"); + + for (i = 0; i < ROC_NPC_MAX_MCAM_WIDTH_DWORDS; i++) { + fprintf(file, "\tDW%d :%016lX\n", i, + mcam_read_rsp->entry_data.kw[i]); + fprintf(file, "\tDW%d_Mask:%016lX\n", i, + mcam_read_rsp->entry_data.kw_mask[i]); + } + fprintf(file, "\n"); }