From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lazaros Koromilas Subject: Re: [PATCH v4 3/3] mempool: allow for user-owned mempool caches Date: Tue, 28 Jun 2016 18:20:43 +0100 Message-ID: References: <1466074939-29863-1-git-send-email-l@nofutznetworks.com> <1467042637-22907-1-git-send-email-olivier.matz@6wind.com> <1467042637-22907-4-git-send-email-olivier.matz@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: dev@dpdk.org To: Olivier Matz Return-path: Received: from mail-io0-f175.google.com (mail-io0-f175.google.com [209.85.223.175]) by dpdk.org (Postfix) with ESMTP id B52FA2BE0 for ; Tue, 28 Jun 2016 19:20:44 +0200 (CEST) Received: by mail-io0-f175.google.com with SMTP id t74so23103669ioi.0 for ; Tue, 28 Jun 2016 10:20:44 -0700 (PDT) In-Reply-To: <1467042637-22907-4-git-send-email-olivier.matz@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" Hi Olivier, thanks for fixing those, just one comment below On Mon, Jun 27, 2016 at 4:50 PM, Olivier Matz wrote: > From: Lazaros Koromilas > > The mempool cache is only available to EAL threads as a per-lcore > resource. Change this so that the user can create and provide their own > cache on mempool get and put operations. This works with non-EAL threads > too. This commit introduces the new API calls: > > rte_mempool_cache_create(size, socket_id) > rte_mempool_cache_free(cache) > rte_mempool_cache_flush(cache, mp) > rte_mempool_default_cache(mp, lcore_id) > > Changes the API calls: > > rte_mempool_generic_put(mp, obj_table, n, cache, flags) > rte_mempool_generic_get(mp, obj_table, n, cache, flags) > > The cache-oblivious API calls use the per-lcore default local cache. > > Signed-off-by: Lazaros Koromilas > Acked-by: Olivier Matz > --- > app/test/test_mempool.c | 75 +++++++++---- > app/test/test_mempool_perf.c | 70 ++++++++++--- > lib/librte_mempool/rte_mempool.c | 66 +++++++++++- > lib/librte_mempool/rte_mempool.h | 163 +++++++++++++++++++++-------- > lib/librte_mempool/rte_mempool_version.map | 4 + > 5 files changed, 296 insertions(+), 82 deletions(-) > > diff --git a/app/test/test_mempool.c b/app/test/test_mempool.c > index 55c2cbc..5b3c754 100644 > --- a/app/test/test_mempool.c > +++ b/app/test/test_mempool.c > @@ -75,10 +75,18 @@ > #define MAX_KEEP 16 > #define MEMPOOL_SIZE ((rte_lcore_count()*(MAX_KEEP+RTE_MEMPOOL_CACHE_MAX_SIZE))-1) > > -#define RET_ERR() do { \ > +#define LOG_ERR() do { \ > printf("test failed at %s():%d\n", __func__, __LINE__); \ > + } while (0) > +#define RET_ERR() do { \ > + LOG_ERR(); \ > return -1; \ > } while (0) > +#define GOTO_ERR(err, label) do { \ > + LOG_ERR(); \ > + ret = err; \ > + goto label; \ > + } while (0) Here, GOTO_ERR still assumes a variable named ret in the function and has the value as an argument while RET_ERR always returns -1. I'd changed it to use -1: #define GOTO_ERR(retvar, label) do { LOG_ERR(); retvar = -1; goto label; } while (0) Should I do it like that and also quickly add the documentation in a v5? Thanks, Lazaros.