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 D9B8F430D2; Tue, 22 Aug 2023 19:02:18 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CE7B340EE3; Tue, 22 Aug 2023 19:02:17 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 000A64021D for ; Tue, 22 Aug 2023 19:02:15 +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 37M8Zail015708 for ; Tue, 22 Aug 2023 10:02:15 -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-transfer-encoding : content-type; s=pfpt0220; bh=SJa5Y86RLEmDOPIG9Vo8YlCVu8dmwIlE7Ex+YTwsH40=; b=fXC/uUvFfch6yFuathenx6a30d6B/GYTISCORU/yZ66Idq8Mu/5qdNfT32l/vBOfrRcp KobzjOK9qXUWiSmkAEft3uZolAGkOeI46peYwpdmSAtwbOsdndmedbHcWDXbQkLahiN+ A9Hew68FM0mdT437yNCjtaAHRIk2+G75owLlDzYGsKGWMbKeV0cEZUc5594dIcfsAwlS LDJasigUkqHpoL/252WMcU+xV2eD+zKOz2LqPQ8rWY5FIOqlJDK0fNq8NbMjefb7WRtW DiuVFNjT7+uCmlDe4gjCUbqcWDKDkbcaxtKfIlH1X/rdJwvrrlwMGtlKaC80M/vVx+g0 +A== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3smdthbr7q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Tue, 22 Aug 2023 10:02:14 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Tue, 22 Aug 2023 10:02:12 -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; Tue, 22 Aug 2023 10:02:12 -0700 Received: from localhost.localdomain (unknown [10.28.36.142]) by maili.marvell.com (Postfix) with ESMTP id 8BC513F70A9; Tue, 22 Aug 2023 10:02:08 -0700 (PDT) From: Ashwin Sekhar T K To: , Ashwin Sekhar T K , Pavan Nikhilesh CC: , , , , , , , , Subject: [PATCH 2/3] mempool/cnxk: fix free from non-EAL pthreads Date: Tue, 22 Aug 2023 22:31:56 +0530 Message-ID: <20230822170157.2637286-2-asekhar@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230822170157.2637286-1-asekhar@marvell.com> References: <20230731055514.1708500-1-asekhar@marvell.com> <20230822170157.2637286-1-asekhar@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: 2hupndS-A2Gqh-VSOquMfYvoXDckUy7l X-Proofpoint-ORIG-GUID: 2hupndS-A2Gqh-VSOquMfYvoXDckUy7l X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-08-22_14,2023-08-22_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 From: Harman Kalra For non-EAL pthreads, rte_lcore_id() will not be valid. So, batch free cannot be used as those threads won't have dedicated lmtlines. So, fallback to bulk alloc in such cases. Fixes: ecbc731a2286 ("mempool/cnxk: add cn10k batch enqueue") Signed-off-by: Harman Kalra 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 41b755b52b..2e46204c8d 100644 --- a/drivers/mempool/cnxk/cn10k_mempool_ops.c +++ b/drivers/mempool/cnxk/cn10k_mempool_ops.c @@ -162,6 +162,12 @@ cn10k_mempool_enq(struct rte_mempool *mp, void *const *obj_table, */ rte_io_wmb(); + /* For non-EAL threads, rte_lcore_id() will not be valid. Hence + * fallback to bulk alloc + */ + if (unlikely(rte_lcore_id() == LCORE_ID_ANY)) + return cnxk_mempool_enq(mp, obj_table, n); + if (n == 1) { roc_npa_aura_op_free(mp->pool_id, 1, ptr[0]); return 0; -- 2.25.1