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 4B330903 for ; Sun, 8 Feb 2015 20:59:55 +0100 (CET) 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:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1YKY4u-0005P9-4B; Sun, 08 Feb 2015 21:03:41 +0100 Message-ID: <54D7C02F.1080308@6wind.com> Date: Sun, 08 Feb 2015 20:59:43 +0100 From: Olivier MATZ User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.3.0 MIME-Version: 1.0 To: Cunming Liang , dev@dpdk.org References: <1422491072-5114-1-git-send-email-cunming.liang@intel.com> <1422842559-13617-1-git-send-email-cunming.liang@intel.com> <1422842559-13617-2-git-send-email-cunming.liang@intel.com> In-Reply-To: <1422842559-13617-2-git-send-email-cunming.liang@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v4 01/17] eal: add cpuset into per EAL thread lcore_config 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: Sun, 08 Feb 2015 19:59:55 -0000 Hi, On 02/02/2015 03:02 AM, Cunming Liang wrote: > The patch adds 'cpuset' into per-lcore configure 'lcore_config[]', > as the lcore no longer always 1:1 pinning with physical cpu. > The lcore now stands for a EAL thread rather than a logical cpu. > > It doesn't change the default behavior of 1:1 mapping, but allows to > affinity the EAL thread to multiple cpus. > > [...] > diff --git a/lib/librte_eal/bsdapp/eal/eal_memory.c b/lib/librte_eal/bsdapp/eal/eal_memory.c > index 65ee87d..a34d500 100644 > --- a/lib/librte_eal/bsdapp/eal/eal_memory.c > +++ b/lib/librte_eal/bsdapp/eal/eal_memory.c > @@ -45,6 +45,8 @@ > #include "eal_internal_cfg.h" > #include "eal_filesystem.h" > > +/* avoid re-defined against with freebsd header */ > +#undef PAGE_SIZE > #define PAGE_SIZE (sysconf(_SC_PAGESIZE)) I don't see the link with the patch. Should this go somewhere else? > > /* > diff --git a/lib/librte_eal/common/include/rte_lcore.h b/lib/librte_eal/common/include/rte_lcore.h > index 49b2c03..4c7d6bb 100644 > --- a/lib/librte_eal/common/include/rte_lcore.h > +++ b/lib/librte_eal/common/include/rte_lcore.h > @@ -50,6 +50,13 @@ extern "C" { > > #define LCORE_ID_ANY -1 /**< Any lcore. */ > > +#if defined(__linux__) > + typedef cpu_set_t rte_cpuset_t; > +#elif defined(__FreeBSD__) > +#include > + typedef cpuset_t rte_cpuset_t; > +#endif > + Should we also define RTE_CPU_SETSIZE? For linux, should be included? If I understand well, after the patch series, the user of rte_thread_set_affinity() and rte_thread_get_affinity() are supposed to use the macros from sched.h to access to this cpuset parameter. So I'm wondering if it's not better to use cpu_set_t from libc instead of redefining rte_cpuset_t. To reword my question: what is the purpose of redefining cpu_set_t in rte_cpuset_t if we still need to use all the libc API to access to it? Regards, Olivier