From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerin Jacob Subject: [PATCH v3] mempool: replace c memcpy code semantics with optimized rte_memcpy Date: Thu, 30 Jun 2016 17:46:36 +0530 Message-ID: <1467288996-6109-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1464250025-9191-1-git-send-email-jerin.jacob@caviumnetworks.com> Mime-Version: 1.0 Content-Type: text/plain Cc: , , Jerin Jacob To: Return-path: Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0086.outbound.protection.outlook.com [157.56.110.86]) by dpdk.org (Postfix) with ESMTP id 06C432617 for ; Thu, 30 Jun 2016 14:17:08 +0200 (CEST) In-Reply-To: <1464250025-9191-1-git-send-email-jerin.jacob@caviumnetworks.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" Signed-off-by: Jerin Jacob Acked-by: Olivier Matz --- v1..v2 Corrected the the git commit message(s/mbuf/mempool/g) v2..v3 re-base to master --- --- 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 b2a5197..c8a81e2 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" { @@ -1028,7 +1029,6 @@ static inline void __attribute__((always_inline)) __mempool_generic_put(struct rte_mempool *mp, void * const *obj_table, unsigned n, struct rte_mempool_cache *cache, int flags) { - uint32_t index; void **cache_objs; /* increment stat now, adding in mempool always success */ @@ -1052,8 +1052,7 @@ __mempool_generic_put(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; -- 2.5.5