From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id D05B658E8 for ; Mon, 9 Feb 2015 15:24:17 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP; 09 Feb 2015 06:19:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,544,1418112000"; d="scan'208";a="683104660" Received: from pgsmsx102.gar.corp.intel.com ([10.221.44.80]) by orsmga002.jf.intel.com with ESMTP; 09 Feb 2015 06:24:15 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by PGSMSX102.gar.corp.intel.com (10.221.44.80) with Microsoft SMTP Server (TLS) id 14.3.195.1; Mon, 9 Feb 2015 22:24:14 +0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.62]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.46]) with mapi id 14.03.0195.001; Mon, 9 Feb 2015 22:24:13 +0800 From: "Liang, Cunming" To: Olivier MATZ , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v4 12/17] eal: set _lcore_id and _socket_id to (-1) by default Thread-Index: AQHQPoxxl8O72EDhFkGezCEdqTRF15zmsMQAgAG5RyA= Date: Mon, 9 Feb 2015 14:24:13 +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-13-git-send-email-cunming.liang@intel.com> <54D7C088.9080401@6wind.com> In-Reply-To: <54D7C088.9080401@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 12/17] eal: set _lcore_id and _socket_id to (-1) by default 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 14:24:18 -0000 > -----Original Message----- > From: Olivier MATZ [mailto:olivier.matz@6wind.com] > Sent: Monday, February 09, 2015 4:01 AM > To: Liang, Cunming; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v4 12/17] eal: set _lcore_id and _socket_i= d to (-1) > by default >=20 > Hi, >=20 > On 02/02/2015 03:02 AM, Cunming Liang wrote: > > For those none EAL thread, *_lcore_id* shall always be LCORE_ID_ANY. > > The libraries using *_lcore_id* as index need to take care. > > *_socket_id* always be SOCKET_ID_ANY unitl the thread changes the affin= ity >=20 > unitl -> until [LCM] accept. >=20 > > by rte_thread_set_affinity() > > > > Signed-off-by: Cunming Liang > > --- > > lib/librte_eal/bsdapp/eal/eal_thread.c | 4 ++-- > > lib/librte_eal/linuxapp/eal/eal_thread.c | 4 ++-- > > 2 files changed, 4 insertions(+), 4 deletions(-) > > > > diff --git a/lib/librte_eal/bsdapp/eal/eal_thread.c > b/lib/librte_eal/bsdapp/eal/eal_thread.c > > index 5b16302..2b3c9a8 100644 > > --- a/lib/librte_eal/bsdapp/eal/eal_thread.c > > +++ b/lib/librte_eal/bsdapp/eal/eal_thread.c > > @@ -56,8 +56,8 @@ > > #include "eal_private.h" > > #include "eal_thread.h" > > > > -RTE_DEFINE_PER_LCORE(unsigned, _lcore_id); > > -RTE_DEFINE_PER_LCORE(unsigned, _socket_id); > > +RTE_DEFINE_PER_LCORE(unsigned, _lcore_id) =3D (unsigned)LCORE_ID_ANY; > > +RTE_DEFINE_PER_LCORE(unsigned, _socket_id) =3D (unsigned)SOCKET_ID_ANY= ; > > RTE_DEFINE_PER_LCORE(rte_cpuset_t, _cpuset); > > > > /* > > diff --git a/lib/librte_eal/linuxapp/eal/eal_thread.c > b/lib/librte_eal/linuxapp/eal/eal_thread.c > > index 6eb1525..ab94e20 100644 > > --- a/lib/librte_eal/linuxapp/eal/eal_thread.c > > +++ b/lib/librte_eal/linuxapp/eal/eal_thread.c > > @@ -57,8 +57,8 @@ > > #include "eal_private.h" > > #include "eal_thread.h" > > > > -RTE_DEFINE_PER_LCORE(unsigned, _lcore_id); > > -RTE_DEFINE_PER_LCORE(unsigned, _socket_id); > > +RTE_DEFINE_PER_LCORE(unsigned, _lcore_id) =3D (unsigned)LCORE_ID_ANY; > > +RTE_DEFINE_PER_LCORE(unsigned, _socket_id) =3D (unsigned)SOCKET_ID_ANY= ; > > RTE_DEFINE_PER_LCORE(rte_cpuset_t, _cpuset); >=20 > As far as I understand, now a rte_lcore_id() can return LCORE_ID_ANY. > This should be modified in the rte_lcore_id() API comments. >=20 > Same for rte_socket_id(). [LCM] accept. >=20 > I also wonder if the API of these functions should be modified to > return an int instead of an unsigned as LCORE_ID_ANY is -1. [LCM] I prefer not change the API definition. (unsigned)LCORE_ID_ANY alread= y used before. >=20 > Regards, > Olivier