From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.droids-corp.org (zoll.droids-corp.org [94.23.50.67]) by dpdk.org (Postfix) with ESMTP id B18223237 for ; Tue, 24 May 2016 16:59:56 +0200 (CEST) Received: from was59-1-82-226-113-214.fbx.proxad.net ([82.226.113.214] helo=[192.168.0.10]) by mail.droids-corp.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1b5DqN-0006mL-37; Tue, 24 May 2016 17:02:04 +0200 To: Jerin Jacob , dev@dpdk.org References: <1464101442-10501-1-git-send-email-jerin.jacob@caviumnetworks.com> Cc: thomas.monjalon@6wind.com, bruce.richardson@intel.com, konstantin.ananyev@intel.com From: Olivier Matz Message-ID: <57446C63.4040605@6wind.com> Date: Tue, 24 May 2016 16:59:47 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.6.0 MIME-Version: 1.0 In-Reply-To: <1464101442-10501-1-git-send-email-jerin.jacob@caviumnetworks.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] mbuf: replace c memcpy code semantics with optimized rte_memcpy X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 14:59:56 -0000 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". Are you seeing some performance improvement by using rte_memcpy()? Regards Olivier