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 B7B26A034F; Mon, 7 Jun 2021 20:10:22 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 893CE41227; Mon, 7 Jun 2021 20:06:13 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 7545641225 for ; Mon, 7 Jun 2021 20:06:12 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 157I1avd017507 for ; Mon, 7 Jun 2021 11:06:11 -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-type; s=pfpt0220; bh=j4iYAF9FE1jGG2UEQJxzJGDGH0ziizLh5qzlVes9bt4=; b=f/iLsnparEvedTi582hSzeNESCevGxUYXmkBtXVxK3VKe8cwGJYOoilso7jZAcICSIFM PTXlvJbjWlpoZfxQ4uUDXBmMLfI6OHgjeuLhUJAwgufsNcYpAt7f8rWCvVPPCAhxIu4n AJHyb0HQqklbHN8Y3qFFyKXCgcHZkIFBgpTx9S0SIMJwLnpXP7CgOhdakfWlVSX5XmUO dk5EYPZrnsvOW+FzXXJxjDNcwlUbiXKnpBaVL1+CEeryr7fCAoAMdJnlyfAq5w/Jt37c QGiG7fAgERFTnZInqFjD/aUwP1+EA+C1Eeo/1bXCyQnAF4yXxMzrfnAIPT3fNUfnhmb+ 0A== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com with ESMTP id 391ecv2esj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Mon, 07 Jun 2021 11:06:11 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 7 Jun 2021 11:06:10 -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; Mon, 7 Jun 2021 11:06:09 -0700 Received: from hyd1588t430.marvell.com (unknown [10.29.52.204]) by maili.marvell.com (Postfix) with ESMTP id 3FCD53F7043; Mon, 7 Jun 2021 11:06:06 -0700 (PDT) From: Nithin Dabilpuram To: CC: , , , , , , Date: Mon, 7 Jun 2021 23:29:41 +0530 Message-ID: <20210607175943.31690-61-ndabilpuram@marvell.com> X-Mailer: git-send-email 2.8.4 In-Reply-To: <20210607175943.31690-1-ndabilpuram@marvell.com> References: <20210306153404.10781-1-ndabilpuram@marvell.com> <20210607175943.31690-1-ndabilpuram@marvell.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-GUID: ntRcGPmsXiAaE-EPBa8Az7SOuHqJ4-2I X-Proofpoint-ORIG-GUID: ntRcGPmsXiAaE-EPBa8Az7SOuHqJ4-2I X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.761 definitions=2021-06-07_14:2021-06-04, 2021-06-07 signatures=0 Subject: [dpdk-dev] [PATCH v2 60/62] net/cnxk: support for rte flow dev dump API 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 Sender: "dev" From: Satheesh Paul Add support to dump hardware internal representation information of rte flow to file. Every flow rule added will be dumped in the below format. MCAM Index:1881 Interface :NIX-RX (0) Priority :1 NPC RX Action:0X00000000404001 ActionOp:NIX_RX_ACTIONOP_UCAST (1) PF_FUNC: 0X400 RQ Index:0X004 Match Id:0000 Flow Key Alg:0 NPC RX VTAG Action:0X00000000008100 VTAG0:relptr:0 lid:0X1 type:0 Patterns: NPC_PARSE_NIBBLE_CHAN:000 NPC_PARSE_NIBBLE_LA_LTYPE:LA_ETHER NPC_PARSE_NIBBLE_LB_LTYPE:NONE NPC_PARSE_NIBBLE_LC_LTYPE:LC_IP NPC_PARSE_NIBBLE_LD_LTYPE:LD_TCP NPC_PARSE_NIBBLE_LE_LTYPE:NONE LA_ETHER, hdr offset:0, len:0X6, key offset:0X8,\ Data:0X4AE124FC7FFF, Mask:0XFFFFFFFFFFFF LA_ETHER, hdr offset:0XC, len:0X2, key offset:0X4, Data:0XCA5A,\ Mask:0XFFFF LC_IP, hdr offset:0XC, len:0X8, key offset:0X10,\ Data:0X0A01010300000000, Mask:0XFFFFFFFF00000000 LD_TCP, hdr offset:0, len:0X4, key offset:0X18, Data:0X03450000,\ Mask:0XFFFF0000 MCAM Raw Data : DW0 :0000CA5A01202000 DW0_Mask:0000FFFF0FF0F000 DW1 :00004AE124FC7FFF DW1_Mask:0000FFFFFFFFFFFF DW2 :0A01010300000000 DW2_Mask:FFFFFFFF00000000 DW3 :0000000003450000 DW3_Mask:00000000FFFF0000 DW4 :0000000000000000 DW4_Mask:0000000000000000 DW5 :0000000000000000 DW5_Mask:0000000000000000 DW6 :0000000000000000 DW6_Mask:0000000000000000 ci: skip_checkpatch skip_checkformat Signed-off-by: Satheesh Paul --- drivers/net/cnxk/cnxk_rte_flow.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/net/cnxk/cnxk_rte_flow.c b/drivers/net/cnxk/cnxk_rte_flow.c index 8486e9e..453425e 100644 --- a/drivers/net/cnxk/cnxk_rte_flow.c +++ b/drivers/net/cnxk/cnxk_rte_flow.c @@ -328,6 +328,33 @@ cnxk_flow_isolate(struct rte_eth_dev *dev __rte_unused, int enable __rte_unused, return -rte_errno; } +static int +cnxk_flow_dev_dump(struct rte_eth_dev *dev, struct rte_flow *flow, + FILE *file, struct rte_flow_error *error) +{ + struct cnxk_eth_dev *hw = dev->data->dev_private; + struct roc_npc *npc = &hw->npc; + + if (file == NULL) { + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, + "Invalid file"); + return -rte_errno; + } + + if (flow != NULL) { + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_HANDLE, + NULL, + "Invalid argument"); + return -EINVAL; + } + + roc_npc_flow_dump(file, npc); + + return 0; +} + const struct rte_flow_ops cnxk_flow_ops = { .validate = cnxk_flow_validate, .create = cnxk_flow_create, @@ -335,4 +362,5 @@ const struct rte_flow_ops cnxk_flow_ops = { .flush = cnxk_flow_flush, .query = cnxk_flow_query, .isolate = cnxk_flow_isolate, + .dev_dump = cnxk_flow_dev_dump, }; -- 2.8.4