From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 65E7C20F for ; Tue, 10 Feb 2015 03:53:53 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP; 09 Feb 2015 18:50:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,547,1418112000"; d="scan'208";a="675461805" Received: from pgsmsx107.gar.corp.intel.com ([10.221.44.105]) by fmsmga002.fm.intel.com with ESMTP; 09 Feb 2015 18:53:51 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.110.14) by PGSMSX107.gar.corp.intel.com (10.221.44.105) with Microsoft SMTP Server (TLS) id 14.3.195.1; Tue, 10 Feb 2015 10:53:49 +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; Tue, 10 Feb 2015 10:53:49 +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: AQHQPoxxl8O72EDhFkGezCEdqTRF15zmsMQAgAG5RyD//7Q5gIABHg2g Date: Tue, 10 Feb 2015 02:53:49 +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> <54D8F323.6010008@6wind.com> In-Reply-To: <54D8F323.6010008@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: Tue, 10 Feb 2015 02:53:53 -0000 > -----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_i= d to (-1) > by default >=20 > Hi, >=20 > 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_ANY= ; > >>> +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 al= ready > used before. >=20 > OK >=20 > And what about directly defining the following? >=20 > #define LCORE_ID_ANY ((unsigned)-1) >=20 >=20 > It would avoid the casts. [LCM] Good point, will update it.