From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <l@nofutznetworks.com>
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 <dev@dpdk.org>; Tue, 28 Jun 2016 19:20:44 +0200 (CEST)
Received: by mail-io0-f175.google.com with SMTP id t74so23103669ioi.0
 for <dev@dpdk.org>; Tue, 28 Jun 2016 10:20:44 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=nofutznetworks-com.20150623.gappssmtp.com; s=20150623;
 h=mime-version:in-reply-to:references:from:date:message-id:subject:to
 :cc; bh=Gyzz+MWegI6Ocd8IXX8kZi43z1Wvk01hUeexkM2IsPQ=;
 b=vTP0S9G/jAVpsg/BkKrx3HsHpHAUWPd3a64FrVPiDcLvUQUhql1eyBDYuViCxdv+IP
 3I/9WcJrrXccmknZQyCxqLOs8I4sVRjjMSTc5T9nqgIZSoOxLegFa+TFLhI48/NIDkfe
 wfKs50G7btu4ZzTYtMIL7foutfFbnKP/CFWP/BmuTgFfEir/sCxa3gL8Q0A1QtUFkRYC
 h5nqVLFsxGKuMe5jM0Ty690Wyv8Ya6VntvLkDevur0YSDdrEQn7S96ybqBGnesEjZgpU
 p2x3WZb/meJDoQA9m12RCxnOU9tpD1wCJP+9x6JmclHavi0X/d+qeSv5h7pXM0zc5yul
 IkFw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:mime-version:in-reply-to:references:from:date
 :message-id:subject:to:cc;
 bh=Gyzz+MWegI6Ocd8IXX8kZi43z1Wvk01hUeexkM2IsPQ=;
 b=H/KsJTA+wH+xrNR3pXExhUO9rBTLs0nGW1S56DfgKTdZDW6Q/OnN9z/jf0VDDCJST6
 zLaSXUybWq3SG4wXsgiXljwASYQoObRCg6YtEcg2pH6BAETHk1rmev+b/IE7rxY1JDWh
 Vwzg3xmOWhLUUmDgOLpy3YSewLlAhZZFUVGVg1opJNtvnEld3fEITKYuM+cTUKZg9Lhy
 VVYIrFyRaX9obAersvHCbmFNzOW6/nIDR10lDxTB6mmEYJ9HPqnkrWT1zHP2cOTA+nPQ
 E6pUN7cZEWEPp9T/DqZf74qIEDJo7tAZTSgY6dBsownzEXMwzhrdig5UicUtYTdlv4Od
 dZZg==
X-Gm-Message-State: ALyK8tK4qcDWbDUQqhasuskgciyMzyyl6t9HanQZScp0qvQBPxoQYVEdEeS767L3F86d7Cp2EiT1WYoTVkGUUw==
X-Received: by 10.107.6.89 with SMTP id 86mr5248495iog.77.1467134444151; Tue,
 28 Jun 2016 10:20:44 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.107.199.134 with HTTP; Tue, 28 Jun 2016 10:20:43 -0700 (PDT)
In-Reply-To: <1467042637-22907-4-git-send-email-olivier.matz@6wind.com>
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>
From: Lazaros Koromilas <l@nofutznetworks.com>
Date: Tue, 28 Jun 2016 18:20:43 +0100
Message-ID: <CAHPNE8jKTJreOnCsTDCfDVjdZfXnhEeTUDvos_6yrYjf-zKhSw@mail.gmail.com>
To: Olivier Matz <olivier.matz@6wind.com>
Cc: dev@dpdk.org
Content-Type: text/plain; charset=UTF-8
Subject: Re: [dpdk-dev] [PATCH v4 3/3] mempool: allow for user-owned mempool
	caches
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 28 Jun 2016 17:20:45 -0000

Hi Olivier, thanks for fixing those, just one comment below

On Mon, Jun 27, 2016 at 4:50 PM, Olivier Matz <olivier.matz@6wind.com> wrote:
> From: Lazaros Koromilas <l@nofutznetworks.com>
>
> 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 <l@nofutznetworks.com>
> Acked-by: Olivier Matz <olivier.matz@6wind.com>
> ---
>  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.