From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 626B9CE7 for ; Tue, 10 Feb 2015 12:19:26 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP; 10 Feb 2015 03:19:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,549,1418112000"; d="scan'208";a="649985721" Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by orsmga001.jf.intel.com with ESMTP; 10 Feb 2015 03:19:24 -0800 Received: from irsmsx155.ger.corp.intel.com (163.33.192.3) by IRSMSX104.ger.corp.intel.com (163.33.3.159) with Microsoft SMTP Server (TLS) id 14.3.195.1; Tue, 10 Feb 2015 11:15:51 +0000 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.81]) by irsmsx155.ger.corp.intel.com ([169.254.14.11]) with mapi id 14.03.0195.001; Tue, 10 Feb 2015 11:15:51 +0000 From: "Ananyev, Konstantin" To: "Liang, Cunming" , 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: AQHQPoxxmfzLhekUkUO+IcZDBPxfuZznNuAAgAE0LoCAADlTgIAAmByAgACMMVA= Date: Tue, 10 Feb 2015 11:15:51 +0000 Message-ID: <2601191342CEEE43887BDE71AB977258213E4914@irsmsx105.ger.corp.intel.com> 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> <54D8F323.6010008@6wind.com> In-Reply-To: Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.182] 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: Tue, 10 Feb 2015 11:19:26 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Liang, Cunming > Sent: Tuesday, February 10, 2015 2:54 AM > To: Olivier MATZ; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v4 12/17] eal: set _lcore_id and _socket_i= d to (-1) by default >=20 >=20 >=20 > > -----Original Message----- > > From: Olivier MATZ [mailto:olivier.matz@6wind.com] > > Sent: Tuesday, February 10, 2015 1:49 AM > > To: Liang, Cunming; dev@dpdk.org > > Subject: Re: [dpdk-dev] [PATCH v4 12/17] eal: set _lcore_id and _socket= _id to (-1) > > by default > > > > Hi, > > > > On 02/09/2015 03:24 PM, Liang, Cunming wrote: > > >>> --- 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_A= NY; > > >>> +RTE_DEFINE_PER_LCORE(unsigned, _socket_id) =3D > > (unsigned)SOCKET_ID_ANY; > > >>> RTE_DEFINE_PER_LCORE(rte_cpuset_t, _cpuset); > > >> > > >> 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. > > >> > > >> Same for rte_socket_id(). > > > [LCM] accept. > > >> > > >> 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 = already > > used before. > > > > OK > > > > And what about directly defining the following? > > > > #define LCORE_ID_ANY ((unsigned)-1) > > > > > > It would avoid the casts. > [LCM] Good point, will update it. UINT32_MAX ?