From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerin Jacob Subject: Re: [PATCH] mbuf: replace c memcpy code semantics with optimized rte_memcpy Date: Tue, 24 May 2016 20:47:01 +0530 Message-ID: <20160524151654.GA10870@localhost.localdomain> References: <1464101442-10501-1-git-send-email-jerin.jacob@caviumnetworks.com> <57446C63.4040605@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Cc: , , , To: Olivier Matz Return-path: Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0095.outbound.protection.outlook.com [207.46.100.95]) by dpdk.org (Postfix) with ESMTP id 5B49737AC for ; Tue, 24 May 2016 17:17:28 +0200 (CEST) Content-Disposition: inline In-Reply-To: <57446C63.4040605@6wind.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, May 24, 2016 at 04:59:47PM +0200, Olivier Matz wrote: > Hi Jerin, > > > On 05/24/2016 04:50 PM, Jerin Jacob wrote: > > Signed-off-by: Jerin Jacob > > --- > > lib/librte_mempool/rte_mempool.h | 5 ++--- > > 1 file changed, 2 insertions(+), 3 deletions(-) > > > > diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h > > index ed2c110..ebe399a 100644 > > --- a/lib/librte_mempool/rte_mempool.h > > +++ b/lib/librte_mempool/rte_mempool.h > > @@ -74,6 +74,7 @@ > > #include > > #include > > #include > > +#include > > > > #ifdef __cplusplus > > extern "C" { > > @@ -917,7 +918,6 @@ __mempool_put_bulk(struct rte_mempool *mp, void * const *obj_table, > > unsigned n, __rte_unused int is_mp) > > { > > struct rte_mempool_cache *cache; > > - uint32_t index; > > void **cache_objs; > > unsigned lcore_id = rte_lcore_id(); > > uint32_t cache_size = mp->cache_size; > > @@ -946,8 +946,7 @@ __mempool_put_bulk(struct rte_mempool *mp, void * const *obj_table, > > */ > > > > /* Add elements back into the cache */ > > - for (index = 0; index < n; ++index, obj_table++) > > - cache_objs[index] = *obj_table; > > + rte_memcpy(&cache_objs[0], obj_table, sizeof(void *) * n); > > > > cache->len += n; > > > > > > The commit title should be "mempool" instead of "mbuf". I will fix it. > Are you seeing some performance improvement by using rte_memcpy()? Yes, In some case, In default case, It was replaced with memcpy by the compiler itself(gcc 5.3). But when I tried external mempool manager patch and then performance dropped almost 800Kpps. Debugging further it turns out that external mempool managers unrelated change was knocking out the memcpy. explicit rte_memcpy brought back 500Kpps. Remaing 300Kpps drop is still unknown(In my test setup, packets are in the local cache, so it must be something do with __mempool_put_bulk text alignment change or similar. Anyone else observed performance drop with external poolmanager? Jerin > > Regards > Olivier