From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1BCE7A04C1; Wed, 20 Nov 2019 05:56:49 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 58F531B948; Wed, 20 Nov 2019 05:56:41 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 10FF41B943 for ; Wed, 20 Nov 2019 05:56:38 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xAK4tT08019696 for ; Tue, 19 Nov 2019 20:56:38 -0800 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=pfpt0818; bh=k1GkuwZPyebYuPYMsSWczs4ZeUwrH1Xw1JGGSrMm6QA=; b=nYEVm0Qa8nW0TyI22AtxzR88QP+QrIDMCMWcRyz8jqDnS5PVvbjnTy1r90FDqR9yleqm JmPUyGNp/HvFpnnbX0R40itRQc0a2AkHesPzS0ELZNmmB9AFqMpYfSrD2LheKeJe7tU1 si9HHDUSF2sF26dvq+oJCyDJmUr7T2RKhOxCLQD2GxcL9vIGjjnogJ5qKnp06ooXWUkA e445fJXXSROSUnxLt1fei2iD4Bmd5iQ4iVNqdQlX9gAjHIEwDO6StzZeVgox71EV4+hM 5bc7YBtxwhYTXfoXWpv+R4lxwr/BCmLKBmycnHWo3/VXZNTMhDSAIRCdFiNx0G/IpnHf LA== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 2wc82vnvpp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Tue, 19 Nov 2019 20:56:38 -0800 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 19 Nov 2019 20:56:32 -0800 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Tue, 19 Nov 2019 20:56:32 -0800 Received: from BG-LT7430.marvell.com (unknown [10.28.17.72]) by maili.marvell.com (Postfix) with ESMTP id C93473F7040; Tue, 19 Nov 2019 20:56:31 -0800 (PST) From: To: , Pavan Nikhilesh CC: Date: Wed, 20 Nov 2019 10:26:23 +0530 Message-ID: <20191120045626.10886-3-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191120045626.10886-1-pbhagavatula@marvell.com> References: <20191120045626.10886-1-pbhagavatula@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-11-19_08:2019-11-15,2019-11-19 signatures=0 Subject: [dpdk-dev] [PATCH 3/5] event/octeontx2: improve chunk pool performance X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Pavan Nikhilesh Enable mempool cache for internal mempool to improve alloc performance. Signed-off-by: Pavan Nikhilesh --- drivers/event/octeontx2/otx2_tim_evdev.c | 4 ++-- drivers/event/octeontx2/otx2_tim_worker.h | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/event/octeontx2/otx2_tim_evdev.c b/drivers/event/octeontx2/otx2_tim_evdev.c index e8316a6c7..206ed4331 100644 --- a/drivers/event/octeontx2/otx2_tim_evdev.c +++ b/drivers/event/octeontx2/otx2_tim_evdev.c @@ -124,6 +124,7 @@ tim_chnk_pool_create(struct otx2_tim_ring *tim_ring, char pool_name[25]; int rc; + cache_sz /= rte_lcore_count(); /* Create chunk pool. */ if (rcfg->flags & RTE_EVENT_TIMER_ADAPTER_F_SP_PUT) { mp_flags = MEMPOOL_F_SP_PUT | MEMPOOL_F_SC_GET; @@ -138,10 +139,9 @@ tim_chnk_pool_create(struct otx2_tim_ring *tim_ring, cache_sz = RTE_MEMPOOL_CACHE_MAX_SIZE; if (!tim_ring->disable_npa) { - /* NPA need not have cache as free is not visible to SW */ tim_ring->chunk_pool = rte_mempool_create_empty(pool_name, tim_ring->nb_chunks, tim_ring->chunk_sz, - 0, 0, rte_socket_id(), mp_flags); + cache_sz, 0, rte_socket_id(), mp_flags); if (tim_ring->chunk_pool == NULL) { otx2_err("Unable to create chunkpool."); diff --git a/drivers/event/octeontx2/otx2_tim_worker.h b/drivers/event/octeontx2/otx2_tim_worker.h index 58ac96f87..90c8a6f80 100644 --- a/drivers/event/octeontx2/otx2_tim_worker.h +++ b/drivers/event/octeontx2/otx2_tim_worker.h @@ -144,8 +144,12 @@ static struct otx2_tim_ent * tim_clr_bkt(struct otx2_tim_ring * const tim_ring, struct otx2_tim_bkt * const bkt) { +#define TIM_MAX_OUTSTANDING_OBJ 64 + void *pend_chunks[TIM_MAX_OUTSTANDING_OBJ]; struct otx2_tim_ent *chunk; struct otx2_tim_ent *pnext; + uint8_t objs = 0; + chunk = ((struct otx2_tim_ent *)(uintptr_t)bkt->first_chunk); chunk = (struct otx2_tim_ent *)(uintptr_t)(chunk + @@ -153,10 +157,19 @@ tim_clr_bkt(struct otx2_tim_ring * const tim_ring, while (chunk) { pnext = (struct otx2_tim_ent *)(uintptr_t) ((chunk + tim_ring->nb_chunk_slots)->w0); - rte_mempool_put(tim_ring->chunk_pool, chunk); + if (objs == TIM_MAX_OUTSTANDING_OBJ) { + rte_mempool_put_bulk(tim_ring->chunk_pool, pend_chunks, + objs); + objs = 0; + } + pend_chunks[objs++] = chunk; chunk = pnext; } + if (objs) + rte_mempool_put_bulk(tim_ring->chunk_pool, pend_chunks, + objs); + return (struct otx2_tim_ent *)(uintptr_t)bkt->first_chunk; } -- 2.17.1