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 27482A04C1; Thu, 21 Nov 2019 08:13:49 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 12DCC2C28; Thu, 21 Nov 2019 08:13:32 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id EE8C82BC7 for ; Thu, 21 Nov 2019 08:13:29 +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 xAL7BixE024402 for ; Wed, 20 Nov 2019 23:13:29 -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=Cg7n+la6tGSY7ykinT00TtbKzsfGJHD7iNUUXtUcAbw=; b=RPtWcjCcSIEqwz+EmakeQEe39aj4nSyK/J8PG6UJBBDPd8SnH+Jzfq9Hoz3cndLqPDW9 /TrvlzUEe5szR9XjyM6XyseF7VmH5OrcvpvrpSpsdnduX3eWqCkYnFQWMpVa70S18fyn x5lijGaumoy5m169H5nQuKJthSVhlZJqzFnLEVC31gN53OE10c94a4whaSC4QqvCrxiz cMOBexrDZQx1dD7wjpGGiacy4/7luQXsBphODlO0y+Bo9J5b/7H6L3rsm6F4kv1VtmCu Nd7KfmrSJb2FKzI92FAOxg9n8hn1JxMfTHmsjtqEyfg0JvBiHv0Ybuz7U9R/gR280QpD +Q== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 2wd090wgm7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Wed, 20 Nov 2019 23:13:29 -0800 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 20 Nov 2019 23:13:27 -0800 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Wed, 20 Nov 2019 23:13:27 -0800 Received: from BG-LT7430.marvell.com (unknown [10.28.17.72]) by maili.marvell.com (Postfix) with ESMTP id EDF433F703F; Wed, 20 Nov 2019 23:13:25 -0800 (PST) From: To: , Pavan Nikhilesh CC: Date: Thu, 21 Nov 2019 12:43:16 +0530 Message-ID: <20191121071319.1901-3-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191121071319.1901-1-pbhagavatula@marvell.com> References: <20191120045626.10886-1-pbhagavatula@marvell.com> <20191121071319.1901-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-20_08:2019-11-20,2019-11-20 signatures=0 Subject: [dpdk-dev] [PATCH v2 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 daaaf8257..4549da4b5 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