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 3EE8D41EB5; Thu, 16 Mar 2023 22:29:49 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AD44C42F86; Thu, 16 Mar 2023 22:29:42 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 7292E42DB5 for ; Thu, 16 Mar 2023 22:29:38 +0100 (CET) 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 32GFtBbb005959 for ; Thu, 16 Mar 2023 14:29:37 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0220; bh=J6MTgAbnGcyy1KtLWbJRfU+I0nOyP/tgPBfISmIakiA=; b=TMczeWOQfcH4548yQaytlPYYTJUmv094PVgX62JWF4bJYOhASt0PHkKOk8o6+TZGCwJb GsOPpIFoZqQ0qYeL/a+bBwjPd6xLUiB2UDZZFr0MnV+T7UCrZkFjb7nEwvfpcJbjbCv8 Y1hJMwvvKbA3+EFytJw2hTwDPSTPLZDD80ckUBVYWMJPO1oL4oItRtEqsOHuTYBDY/U7 s3whTVGxS3396rJ0ndjhKSyLcQKBwlI98lc1pya3xwkBOdMgQ8aBurESBptfZvlFf9W0 gy9DYgW1Qews4hpgZVb4oDkBK+IPqSCbYAqUx2nsj1WLoTDNNH3pnKigNtxcHe9Xwomj GA== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3pbxq2ucrk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 16 Mar 2023 14:29:37 -0700 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.42; Thu, 16 Mar 2023 14:29:35 -0700 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.42 via Frontend Transport; Thu, 16 Mar 2023 14:29:35 -0700 Received: from ml-host-33.caveonetworks.com (unknown [10.110.143.233]) by maili.marvell.com (Postfix) with ESMTP id 3F3083F707A; Thu, 16 Mar 2023 14:29:35 -0700 (PDT) From: Srikanth Yalavarthi To: Srikanth Yalavarthi , Prince Takkar CC: , , , Subject: [PATCH v3 1/8] ml/cnxk: fix evaluation order violation issues Date: Thu, 16 Mar 2023 14:28:57 -0700 Message-ID: <20230316212904.9318-2-syalavarthi@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230316212904.9318-1-syalavarthi@marvell.com> References: <20230315135427.11489-1-syalavarthi@marvell.com> <20230316212904.9318-1-syalavarthi@marvell.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-GUID: AMapL0YtjeRUnvV7VJbp5UTj-t26yy9U X-Proofpoint-ORIG-GUID: AMapL0YtjeRUnvV7VJbp5UTj-t26yy9U X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-16_14,2023-03-16_02,2023-02-09_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 Fix evaluation order violation issues reported by coverity tool. ocm_mask variable is being written twice with the same value. Coverity issue: 383659 Fixes: b7d0650ebce0 ("ml/cnxk: reserve and free OCM pages") Signed-off-by: Srikanth Yalavarthi --- drivers/ml/cnxk/cn10k_ml_ocm.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/ml/cnxk/cn10k_ml_ocm.c b/drivers/ml/cnxk/cn10k_ml_ocm.c index d8d2c71a3c..1ea45b5b60 100644 --- a/drivers/ml/cnxk/cn10k_ml_ocm.c +++ b/drivers/ml/cnxk/cn10k_ml_ocm.c @@ -423,10 +423,8 @@ cn10k_ml_ocm_free_pages(struct rte_ml_dev *dev, uint16_t model_id) wb_page_end = wb_page_start + model->model_mem_map.wb_pages - 1; for (tile_id = model->addr.tile_start; tile_id <= model->addr.tile_end; tile_id++) { for (page_id = wb_page_start; page_id <= wb_page_end; page_id++) { - ocm->tile_ocm_info[tile_id].ocm_mask[page_id / OCM_MAP_WORD_SIZE] = - CLEAR_BIT(ocm->tile_ocm_info[tile_id] - .ocm_mask[page_id / OCM_MAP_WORD_SIZE], - page_id % OCM_MAP_WORD_SIZE); + CLEAR_BIT(ocm->tile_ocm_info[tile_id].ocm_mask[page_id / OCM_MAP_WORD_SIZE], + page_id % OCM_MAP_WORD_SIZE); } /* Update last_wb_page size */ @@ -452,10 +450,9 @@ cn10k_ml_ocm_free_pages(struct rte_ml_dev *dev, uint16_t model_id) prev_start = ocm->num_pages - ocm->tile_ocm_info[tile_id].scratch_pages; curr_start = ocm->num_pages - scratch_resize_pages; for (page_id = prev_start; page_id < curr_start; page_id++) { - ocm->tile_ocm_info[tile_id].ocm_mask[page_id / OCM_MAP_WORD_SIZE] = - CLEAR_BIT(ocm->tile_ocm_info[tile_id] - .ocm_mask[page_id / OCM_MAP_WORD_SIZE], - page_id % OCM_MAP_WORD_SIZE); + CLEAR_BIT(ocm->tile_ocm_info[tile_id] + .ocm_mask[page_id / OCM_MAP_WORD_SIZE], + page_id % OCM_MAP_WORD_SIZE); } ocm->tile_ocm_info[tile_id].scratch_pages = scratch_resize_pages; } -- 2.17.1