From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id DBCFA903 for ; Mon, 9 Feb 2015 12:33:49 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP; 09 Feb 2015 03:26:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,543,1418112000"; d="scan'208";a="649433194" Received: from pgsmsx108.gar.corp.intel.com ([10.221.44.103]) by orsmga001.jf.intel.com with ESMTP; 09 Feb 2015 03:33:47 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by PGSMSX108.gar.corp.intel.com (10.221.44.103) with Microsoft SMTP Server (TLS) id 14.3.195.1; Mon, 9 Feb 2015 19:33:45 +0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.62]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.197]) with mapi id 14.03.0195.001; Mon, 9 Feb 2015 19:33:38 +0800 From: "Liang, Cunming" To: Olivier MATZ , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v4 01/17] eal: add cpuset into per EAL thread lcore_config Thread-Index: AQHQPoxi3bPvn2MkCEGzQGAgf6IU95zmsFqAgAGGOaA= Date: Mon, 9 Feb 2015 11:33:38 +0000 Message-ID: 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> <54D7C02F.1080308@6wind.com> In-Reply-To: <54D7C02F.1080308@6wind.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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: Mon, 09 Feb 2015 11:33:50 -0000 > -----Original Message----- > From: Olivier MATZ [mailto:olivier.matz@6wind.com] > Sent: Monday, February 09, 2015 4:00 AM > To: Liang, Cunming; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v4 01/17] eal: add cpuset into per EAL thr= ead > lcore_config >=20 > Hi, >=20 > 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)) >=20 > I don't see the link with the patch. Should this go somewhere else? >=20 >=20 > > > > /* > > 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 > > + >=20 > Should we also define RTE_CPU_SETSIZE? > For linux, should be included? [LCM] It uses the fix size cpuset, won't use CPU_ALLOC() to get the pointer= of cpuset. The RTE_CPU_SETSIZE always equal to sizeof(rte_cpuset_t). >=20 > 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. >=20 > 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? [LCM] In linux the type is *cpu_set_t*, but in freebsd it's *cpuset_t*. The purpose of *rte_cpuset_t* is to make the consistent type definition in = EAL, and to avoid lots of #ifdef for this diff. In either linux or freebsd, it still can use the MACRO in libc to set the r= te_cpuset_t. >=20 >=20 > Regards, > Olivier