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 00F5EA00BE; Thu, 17 Feb 2022 07:37:10 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D92A140150; Thu, 17 Feb 2022 07:37:09 +0100 (CET) Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) by mails.dpdk.org (Postfix) with ESMTP id 7075040042; Thu, 17 Feb 2022 07:37:08 +0100 (CET) Received: by mail-io1-f51.google.com with SMTP id w7so2526969ioj.5; Wed, 16 Feb 2022 22:37:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VE06GefOapdaZfDwMIjd2cyV65u8fxybAT55ohsytsY=; b=mcLhAGYk8hb+k7gV0L1qe14ZqV0FGe3hY7t0Wv0jjRv3xh5WlMYH7RcJ8B9dNJLGXH bUI9yP9O3fwXlaMNP11uwKRL5pl/3IdoZoWTgI3wsI4DUdq2b83mtBiZBMOkRcCGe1Wf XgVg/BMPBS/Vc5O12+GipFBBrHVd95ZZ0wELlSHYEDmnUUTsWB0uQZIVePURpTNgSCxO YVqdaZ/UP9MD5bC8WuNTA4CFlrB3gRcMOB5z9suOEFK17QaMO/+TaWX7sPZsZ2l84RA3 jJ9Z+s86o+B6TlMAyPamXF/bKJMLBemKj/90KgWkjfXvr+4IlyAnQGbKzilMaKS2LPdJ 6WBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VE06GefOapdaZfDwMIjd2cyV65u8fxybAT55ohsytsY=; b=BQD6Rnm1KIWj4AUEgnm+civ9Ng6SNrt1QTLhMDBkswTGWq8yI0EiJPhnlGxOzIyOUn x30dLEKDX+4OhUvogdd6x4T+LlzB5vEhq0/YkulJU3LdnUFASUN/SQ/YLfCA+J9U/syz 51zQxOpB7LJ5GNtocw8keKeFU1nqFnbomgqjzGrRZ3sj7ZGPuVtij7UxVywKT15elwpA s5KfslD7RZRBaaLj0pv9CAgGgGFonE5On4ympTDVdxWZfAcP79dHXO6kyxhH6OPzV9Ar eh2qdOdD4jmuqvAj2dvOzIU09+nE4KhljonLyKkQHQxdYEm/G96+zp9/B85z8RKjV9OG eezg== X-Gm-Message-State: AOAM532YEjVQNZExg/mAyUEeas1hDnImAAjiqd5DIs3JemRaJpe0tXJW PrixqLD7Su5ADKxfMZ8J74Om4kn4AZORgr510sg= X-Google-Smtp-Source: ABdhPJx4PRJDp+4olYyLJftKnJNxJFzgYPVB4xNQ9bPhrZjKrXUUgR6aBgG33hdNei/VCZreJmNWfqkON/fK3Xipxf0= X-Received: by 2002:a02:604f:0:b0:30f:e6f1:3883 with SMTP id d15-20020a02604f000000b0030fe6f13883mr1092297jaf.266.1645079826826; Wed, 16 Feb 2022 22:37:06 -0800 (PST) MIME-Version: 1.0 References: <20220125041526.905808-1-psatheesh@marvell.com> In-Reply-To: <20220125041526.905808-1-psatheesh@marvell.com> From: Jerin Jacob Date: Thu, 17 Feb 2022 12:06:40 +0530 Message-ID: Subject: Re: [dpdk-dev] [PATCH] common/cnxk: fix missing RTE Flow counter deletion To: Satheesh Paul , Ferruh Yigit Cc: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao , dpdk-dev , dpdk stable , Jerin Jacob Kollanukkaran Content-Type: text/plain; charset="UTF-8" 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 On Tue, Jan 25, 2022 at 9:45 AM wrote: > > 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 Updated the comment as follows and applied to dpdk-next-net-mrvl/for-next-net. Thanks common/cnxk: fix flow deletion When a flow is deleted, the counters are deleted without being cleared first. This results in counter values being retained and shown in flows created later. Hence, counter is cleared before being deleted. Updated driver 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 > --- > 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 >