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 3158745BB3; Wed, 23 Oct 2024 17:02:13 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B760242D9D; Wed, 23 Oct 2024 17:02:02 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 5C7E2427E7 for ; Wed, 23 Oct 2024 17:02:01 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49NBVKZE017534 for ; Wed, 23 Oct 2024 08:02:00 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=K dyIG6PmOAKlXrZuMnynw1kY7jdg//b9JClmcqwoXyQ=; b=GOjpkR/GiY7elgbkt QmBEHOm2DULKQoYwLpmTyN2umKMgOJRAOh/os5Kj+pJSem/cTzQBIAV6eDuX7OlY flqQyjRkN6pPS+avKej6RvDCbxaxd688wiRmlYiGGuHWEwhq7J9BigmnRfW0UYdT ZwnzSdArFBXaH+93684ySYyb5tsBPQPYq7CzZzX6x7+CG3eT2TYORTbEE4CH2leU 6iaL0QzEK2Ij6C84s+ioyHX2suwjQuh8wAvS0AgZuDNAd3YwUr0Uc00/5/8IKJzl pVuBOFUAEdowfQzFdPfmzfQ90HYhtD3pZdGol25u8eLfJGAileYmsM5ZMgyFso04 8V0fg== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 42em2c253e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 23 Oct 2024 08:01:59 -0700 (PDT) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 23 Oct 2024 08:01:58 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Wed, 23 Oct 2024 08:01:58 -0700 Received: from localhost.localdomain (unknown [10.29.52.211]) by maili.marvell.com (Postfix) with ESMTP id E38A53F7069; Wed, 23 Oct 2024 08:01:55 -0700 (PDT) From: Harman Kalra To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao , Harman Kalra CC: Subject: [PATCH 3/8] common/cnxk: fix double free of flow aging resources Date: Wed, 23 Oct 2024 20:31:37 +0530 Message-ID: <20241023150143.113877-3-hkalra@marvell.com> X-Mailer: git-send-email 2.46.0.469.g4590f2e941 In-Reply-To: <20241023150143.113877-1-hkalra@marvell.com> References: <20241023150143.113877-1-hkalra@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: BgTfOKfWgiKo6sjJz5pdaIqW9_01IsWG X-Proofpoint-ORIG-GUID: BgTfOKfWgiKo6sjJz5pdaIqW9_01IsWG X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-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 As part of npc tear down sequence flow aging resources are cleaned up while they were already cleaned up when last flow with aging action was removed. This leads to double free of some resources. Fixes: 85e9542d4700 ("common/cnxk: fix flow aging cleanup") Signed-off-by: Harman Kalra --- drivers/common/cnxk/roc_npc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/common/cnxk/roc_npc.c b/drivers/common/cnxk/roc_npc.c index 8a951b6360..2b3c90683c 100644 --- a/drivers/common/cnxk/roc_npc.c +++ b/drivers/common/cnxk/roc_npc.c @@ -389,7 +389,8 @@ roc_npc_fini(struct roc_npc *roc_npc) struct npc *npc = roc_npc_to_npc_priv(roc_npc); int rc; - npc_aging_ctrl_thread_destroy(roc_npc); + if (!roc_npc->flow_age.aged_flows_get_thread_exit) + npc_aging_ctrl_thread_destroy(roc_npc); rc = npc_flow_free_all_resources(npc); if (rc) { -- 2.46.0.469.g4590f2e941