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 BAB2D4324A for ; Fri, 3 Nov 2023 00:25:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B2CD841151; Fri, 3 Nov 2023 00:25:47 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id F09164021E; Fri, 3 Nov 2023 00:25:44 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3A2Ls6lc012894; Thu, 2 Nov 2023 16:25:44 -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=Ta6O6qRJe/44GkRomZWhVTP9U9dVUDL+rfVFAfIJWZA=; b=SPewkL3C4cqEKtl7W0OmwyScDZobnSufLoC4bL7ncQUUCEpJiDkue0W6b+gy909y3kcW snMRar4pXmu3RFjAH/zEnadr6BMm0ENtlXKFVEJ0RUzcJeM0U8jrn5EF9Ys1m2GYFA9a IEeNyI6JshL6TZPANEQAKd9ouscanodK0lffZOW2bVnLv4Z7ICLDQSQaDYeC6nuee51O IMoeRhQeoU3yFS2ZM1FIk2W99K4ax7f17abZjx35YTNFKO99bttcOJ2AL/8Tw4eFGjRo EH5adV+nCIk3PCBk73odt6Jj5XJBkG3vmj67+L7J1WX9u1jJaYmVfn/0PX7tAnt7ILLW rg== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3u4m3487j7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 02 Nov 2023 16:25:44 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Thu, 2 Nov 2023 16:25:42 -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.48 via Frontend Transport; Thu, 2 Nov 2023 16:25:42 -0700 Received: from localhost.localdomain (unknown [10.28.36.185]) by maili.marvell.com (Postfix) with ESMTP id 9237B406E47; Thu, 2 Nov 2023 04:38:20 -0700 (PDT) From: Ankur Dwivedi To: CC: , , , , , Ankur Dwivedi , Subject: [PATCH v1] common/cnxk: fix aged flows bitmap alloc Date: Thu, 2 Nov 2023 17:08:03 +0530 Message-ID: <20231102113803.2173468-1-adwivedi@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: 3Hha-WWnW8CReXJuOoHOgr2jYP4LdMKW X-Proofpoint-GUID: 3Hha-WWnW8CReXJuOoHOgr2jYP4LdMKW X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-02_10,2023-11-02_03,2023-05-22_02 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org The allocation of bitmap for aged flows should be done in npc_aging_ctrl_thread_create() instead of roc_npc_init(), as the bitmap free is being done in npc_aging_ctrl_thread_destroy(). Fixes: 357f5ebc8a24 ("common/cnxk: support flow aging") Cc: stable@dpdk.org Signed-off-by: Ankur Dwivedi --- drivers/common/cnxk/roc_npc.c | 5 ++--- drivers/common/cnxk/roc_npc_aging.c | 6 +++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/common/cnxk/roc_npc.c b/drivers/common/cnxk/roc_npc.c index 7593466bc1..f2cf4d8a28 100644 --- a/drivers/common/cnxk/roc_npc.c +++ b/drivers/common/cnxk/roc_npc.c @@ -331,9 +331,8 @@ roc_npc_init(struct roc_npc *roc_npc) */ plt_bitmap_set(npc->rss_grp_entries, 0); - rc = npc_aged_flows_bitmap_alloc(roc_npc); - if (rc != 0) - goto done; + roc_npc->flow_age.age_flow_refcnt = 0; + return rc; done: diff --git a/drivers/common/cnxk/roc_npc_aging.c b/drivers/common/cnxk/roc_npc_aging.c index a456d2b893..254dd2139b 100644 --- a/drivers/common/cnxk/roc_npc_aging.c +++ b/drivers/common/cnxk/roc_npc_aging.c @@ -33,7 +33,6 @@ npc_aged_flows_bitmap_alloc(struct roc_npc *roc_npc) goto done; } - flow_age->age_flow_refcnt = 0; done: return rc; } @@ -276,11 +275,16 @@ npc_aging_ctrl_thread_create(struct roc_npc *roc_npc, flow->has_age_action = true; if (flow_age->age_flow_refcnt == 0) { + errcode = npc_aged_flows_bitmap_alloc(roc_npc); + if (errcode != 0) + goto done; + flow_age->aged_flows_get_thread_exit = false; if (plt_thread_create_control(&flow_age->aged_flows_poll_thread, "Aged Flows Get Ctrl Thread", npc_aged_flows_get, roc_npc) != 0) { plt_err("Failed to create thread for age flows"); + npc_aged_flows_bitmap_free(roc_npc); errcode = NPC_ERR_ACTION_NOTSUP; goto done; } -- 2.25.1