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 0C2EBA04A8; Tue, 25 Jan 2022 05:15:41 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C2A9642814; Tue, 25 Jan 2022 05:15:40 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 74BBF4013F; Tue, 25 Jan 2022 05:15:39 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 20P3L5ft011985; Mon, 24 Jan 2022 20:15:38 -0800 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=+dQPEB6NxFGz7LHdAmnSQwDl5kCd9BOTaP9Lb59Bkfg=; b=SAI43BHxSUGE6YJ8xMtGvy1VpG8588AUZM1EsfQB0PTyBub3RQGG7QSMookLYTLv+5fc XWyrbI7xuyGctIyMFUIlV9mDgc0iD5pYMjmOPpN1XjA16eBZkk9e0jxMZi2088M4dfk3 bIgkWxrP7W++KIx5h4yRKOL2FHtnEmsMbhXcTeIOVUQF+KVTdXLiNUX7TNhvRm3Zx//t 4q9cwgbJhGsr+U7AvJfeMXVpFsg6qzZyZkH/T/znFXqF3VGodsuDMvf0cxNAgguVI92T +aJUrW7grZwg+TxPlLcZ5lhbOcVJ5VvZpW971AccNB7OF48HEOG1BbMbZxw256eycBvk ZQ== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3dt97n049j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 24 Jan 2022 20:15:38 -0800 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; Mon, 24 Jan 2022 20:15:36 -0800 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, 24 Jan 2022 20:15:36 -0800 Received: from localhost.localdomain (unknown [10.28.34.33]) by maili.marvell.com (Postfix) with ESMTP id 213185E6865; Mon, 24 Jan 2022 20:15:33 -0800 (PST) From: To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao CC: , Satheesh Paul , , Jerin Jacob Kollanukkaran Subject: [dpdk-dev] [PATCH] common/cnxk: fix missing RTE Flow counter deletion Date: Tue, 25 Jan 2022 09:45:26 +0530 Message-ID: <20220125041526.905808-1-psatheesh@marvell.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: Ua4OrC6_a4av0x1Gtb64iMVuUD5x1CQG X-Proofpoint-GUID: Ua4OrC6_a4av0x1Gtb64iMVuUD5x1CQG X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-25_01,2022-01-24_02,2021-12-02_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 Added code to clear and delete counters upon flow deletion. Fixes: a07f7ced43 ("common/cnxk: add NPC init and fini") Cc: stable@dpdk.org Signed-off-by: Satheesh Paul Reviewed-by: Jerin Jacob Kollanukkaran --- drivers/common/cnxk/roc_npc.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/common/cnxk/roc_npc.c b/drivers/common/cnxk/roc_npc.c index e3961bfbc6..df3016f538 100644 --- a/drivers/common/cnxk/roc_npc.c +++ b/drivers/common/cnxk/roc_npc.c @@ -1259,6 +1259,16 @@ roc_npc_flow_destroy(struct roc_npc *roc_npc, struct roc_npc_flow *flow) return rc; } + if (flow->ctr_id != NPC_COUNTER_NONE) { + rc = roc_npc_mcam_clear_counter(roc_npc, flow->ctr_id); + if (rc != 0) + return rc; + + rc = npc_mcam_free_counter(npc, flow->ctr_id); + if (rc != 0) + return rc; + } + rc = npc_mcam_free_entry(npc, flow->mcam_id); if (rc != 0) return rc; -- 2.25.4