From patchwork Thu Sep 21 07:46:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Dwivedi X-Patchwork-Id: 131760 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5B63142604; Thu, 21 Sep 2023 09:46:52 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 26BBE4026D; Thu, 21 Sep 2023 09:46:51 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id B7E714014F for ; Thu, 21 Sep 2023 09:46:49 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38L7PoOV001328 for ; Thu, 21 Sep 2023 00:46:48 -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=5kgGXm8jE+WmkxpqR32rlTenEWP9CiwauvtOVRei4RA=; b=BGPCDv8Qmbh5LI1ApeS3viy91+6nRFnsnaJ5/NldbWhX5xo+8Xrbashfw7JgO+2aX/Vq mMhvObCAuXo0+MUO7MBlFhCWsy7idCVLBiNFScpfZLxvtRzWOIVE0pJnc6YpKwLoGLnT Foc0CghlqMHsMwp+zs76l1kcdZOLqgo49ia4CKlQc8dDSZRFXYq42SFgE7iXiljcubZL kVEk6Sh1rK4uNUnGmjI0GIfb7y1r6rnylRGaNCLx7FEHMzNxG845mTADTTctG6wjkZeD JeWtjULlc43RHNsxGEuFTIltkvxSIJAZj70wSHS3pl2WaveRvPZAEBWIJ64E/bbgFRtY 9A== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3t7u4dd5pu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 21 Sep 2023 00:46:48 -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, 21 Sep 2023 00:46:46 -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, 21 Sep 2023 00:46:46 -0700 Received: from localhost.localdomain (unknown [10.28.36.185]) by maili.marvell.com (Postfix) with ESMTP id B09D75B693F; Thu, 21 Sep 2023 00:46:44 -0700 (PDT) From: Ankur Dwivedi To: CC: , , , , , Ankur Dwivedi Subject: [PATCH v1] common/cnxk: fix initialization of MCAM ID Date: Thu, 21 Sep 2023 13:16:37 +0530 Message-ID: <20230921074637.4043468-1-adwivedi@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: 6VXiynAhjPVBh4F4_0btzEPSLvIv9Px3 X-Proofpoint-GUID: 6VXiynAhjPVBh4F4_0btzEPSLvIv9Px3 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-09-21_05,2023-09-20_01,2023-05-22_02 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 The start and end mcam id is initialized when aged_flows_cnt is 0. The boolean variable aging_enabled is not needed. Fixes: d110c44d29e7 ("common/cnxk: support flow aging") Signed-off-by: Ankur Dwivedi --- drivers/common/cnxk/roc_npc_aging.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/common/cnxk/roc_npc_aging.c b/drivers/common/cnxk/roc_npc_aging.c index 874a7cd4ff..4b845954b4 100644 --- a/drivers/common/cnxk/roc_npc_aging.c +++ b/drivers/common/cnxk/roc_npc_aging.c @@ -56,7 +56,6 @@ check_timeout_cycles(struct roc_npc *roc_npc, uint32_t mcam_id) struct npc_age_flow_list_head *list; struct npc_age_flow_entry *fl_iter; struct roc_npc_flow_age *flow_age; - bool aging_enabled = false; flow_age = &roc_npc->flow_age; list = &npc->age_flow_list; @@ -65,10 +64,9 @@ check_timeout_cycles(struct roc_npc *roc_npc, uint32_t mcam_id) fl_iter->flow->timeout_cycles < plt_tsc_cycles()) { /* update bitmap */ plt_bitmap_set(flow_age->aged_flows, mcam_id); - if (!aging_enabled) { + if (flow_age->aged_flows_cnt == 0) { flow_age->start_id = mcam_id; flow_age->end_id = mcam_id; - aging_enabled = true; } if (flow_age->start_id > mcam_id) flow_age->start_id = mcam_id;