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 D59C2A034C; Thu, 28 Apr 2022 11:56:57 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6620D40E50; Thu, 28 Apr 2022 11:56:57 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 7E9B34013F for ; Thu, 28 Apr 2022 11:56:55 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 23S7o3Dx023073 for ; Thu, 28 Apr 2022 02:56:54 -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=Y5ghACmbO5o3KFBVO78C/dyxtG7KOIFbrWMFxn17p50=; b=JV9P7MrC67lTGetDCdDhKj1DbGEWBppVfHytOaa9KK7I+9SA6U6+lv0DJWx0u7avJlTv ISFgCEpZQ86ziAfE8mzzAKmejCVWeLCIjhuaBCm4ylu2lox0n8nGu/K/I+T7B//h+s2l lPLyRfMV4RhxmCK3N2C4EJMR7YNT41/ECjL1ob+eLxjEiQWoWM5b7onXDilUYHh8FhLq pACdoxDtC1d3axABg3w4R/CJoIRDiOH+cUfLHdwliyXkVSipAVHVDAgLah2Z7tG/YlMV ElC40tg3PVxKKb2iNn2RrgFaGFEGLl0OWGvTkLp8yFrLHa2xJwEhg2+yD6z6BHNF3OSD hw== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3fqpvs0fbw-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 28 Apr 2022 02:56:54 -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.18; Thu, 28 Apr 2022 02:56:53 -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.18 via Frontend Transport; Thu, 28 Apr 2022 02:56:53 -0700 Received: from lab-ci-142.marvell.com (unknown [10.28.36.142]) by maili.marvell.com (Postfix) with ESMTP id CBCC63F704A; Thu, 28 Apr 2022 02:56:49 -0700 (PDT) From: Ashwin Sekhar T K To: CC: , , , , , , , , , , Subject: [PATCH] mempool/cnxk: avoid batch op free for empty mempools Date: Thu, 28 Apr 2022 15:29:35 +0530 Message-ID: <20220428095935.3612387-1-asekhar@marvell.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: fvrE0Pl-3fsh7nR68Bk1fzyDSFve29p- X-Proofpoint-ORIG-GUID: fvrE0Pl-3fsh7nR68Bk1fzyDSFve29p- X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-04-28_01,2022-04-27_01,2022-02-23_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 Batch op data is initialized inside mempool alloc. But in case of empty mempools, the alloc function is not called and hence the initialization of batch op data is also not done. So ensure the validity of batch op data inside mempool free. Signed-off-by: Ashwin Sekhar T K --- drivers/mempool/cnxk/cn10k_mempool_ops.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/mempool/cnxk/cn10k_mempool_ops.c b/drivers/mempool/cnxk/cn10k_mempool_ops.c index 6ebbf91de5..a02e01cea0 100644 --- a/drivers/mempool/cnxk/cn10k_mempool_ops.c +++ b/drivers/mempool/cnxk/cn10k_mempool_ops.c @@ -109,6 +109,12 @@ batch_op_fini(struct rte_mempool *mp) int i; op_data = batch_op_data_get(mp->pool_id); + if (!op_data) { + /* Batch op data can be uninitialized in case of empty + * mempools. + */ + return; + } rte_wmb(); for (i = 0; i < RTE_MAX_LCORE; i++) { -- 2.32.0