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 7BD58B50D for ; Sun, 15 Feb 2015 02:16:18 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 14 Feb 2015 17:08:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,578,1418112000"; d="scan'208";a="666522907" Received: from kmsmsx151.gar.corp.intel.com ([172.21.73.86]) by fmsmga001.fm.intel.com with ESMTP; 14 Feb 2015 17:16:15 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by KMSMSX151.gar.corp.intel.com (172.21.73.86) with Microsoft SMTP Server (TLS) id 14.3.195.1; Sun, 15 Feb 2015 09:16:14 +0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.62]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.192]) with mapi id 14.03.0195.001; Sun, 15 Feb 2015 09:16:13 +0800 From: "Liang, Cunming" To: Neil Horman Thread-Topic: [dpdk-dev] [PATCH v6 05/19] eal: add support parsing socket_id from cpuset Thread-Index: AQHQRy3OsTYDbMBUpEGSWxnQ5sqlPpzuE/gAgALXVKA= Date: Sun, 15 Feb 2015 01:16:13 +0000 Message-ID: References: <1423728996-3004-1-git-send-email-cunming.liang@intel.com> <1423791501-1555-1-git-send-email-cunming.liang@intel.com> <1423791501-1555-6-git-send-email-cunming.liang@intel.com> <20150213135152.GB13495@neilslaptop.think-freely.org> In-Reply-To: <20150213135152.GB13495@neilslaptop.think-freely.org> 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 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v6 05/19] eal: add support parsing socket_id from cpuset 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, 15 Feb 2015 01:16:18 -0000 > -----Original Message----- > From: Neil Horman [mailto:nhorman@tuxdriver.com] > Sent: Friday, February 13, 2015 9:52 PM > To: Liang, Cunming > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v6 05/19] eal: add support parsing socket_= id > from cpuset >=20 > On Fri, Feb 13, 2015 at 09:38:07AM +0800, Cunming Liang wrote: > > It returns the socket_id if all cpus in the cpuset belongs > > to the same NUMA node, otherwise it will return SOCKET_ID_ANY. > > > > Signed-off-by: Cunming Liang > > --- > > v5 changes: > > expose cpu_socket_id as eal_cpu_socket_id for linuxapp > > eal_cpuset_socket_id() remove static inline and move to c file > > > > lib/librte_eal/bsdapp/eal/eal_lcore.c | 7 +++++++ > > lib/librte_eal/common/eal_thread.h | 11 +++++++++++ > > lib/librte_eal/linuxapp/eal/eal_lcore.c | 7 ++++--- > > 3 files changed, 22 insertions(+), 3 deletions(-) > > > > diff --git a/lib/librte_eal/bsdapp/eal/eal_lcore.c > b/lib/librte_eal/bsdapp/eal/eal_lcore.c > > index 72f8ac2..162fb4f 100644 > > --- a/lib/librte_eal/bsdapp/eal/eal_lcore.c > > +++ b/lib/librte_eal/bsdapp/eal/eal_lcore.c > > @@ -41,6 +41,7 @@ > > #include > > > > #include "eal_private.h" > > +#include "eal_thread.h" > > > > /* No topology information available on FreeBSD including NUMA info */ > > #define cpu_core_id(X) 0 > > @@ -112,3 +113,9 @@ rte_eal_cpu_init(void) > > > > return 0; > > } > > + > > +unsigned > > +eal_cpu_socket_id(__rte_unused unsigned cpu_id) > > +{ > > + return cpu_socket_id(cpu_id); > > +} > > diff --git a/lib/librte_eal/common/eal_thread.h > b/lib/librte_eal/common/eal_thread.h > > index b53b84d..f1ce0bd 100644 > > --- a/lib/librte_eal/common/eal_thread.h > > +++ b/lib/librte_eal/common/eal_thread.h > > @@ -50,4 +50,15 @@ __attribute__((noreturn)) void *eal_thread_loop(void > *arg); > > */ > > void eal_thread_init_master(unsigned lcore_id); > > > > +/** > > + * Get the NUMA socket id from cpu id. > > + * This function is private to EAL. > > + * > > + * @param cpu_id > > + * The logical process id. > > + * @return > > + * socket_id or SOCKET_ID_ANY > > + */ > > +unsigned eal_cpu_socket_id(unsigned cpu_id); > > + > > #endif /* EAL_THREAD_H */ > > diff --git a/lib/librte_eal/linuxapp/eal/eal_lcore.c > b/lib/librte_eal/linuxapp/eal/eal_lcore.c > > index 29615f8..ef8c433 100644 > > --- a/lib/librte_eal/linuxapp/eal/eal_lcore.c > > +++ b/lib/librte_eal/linuxapp/eal/eal_lcore.c > > @@ -45,6 +45,7 @@ > > > > #include "eal_private.h" > > #include "eal_filesystem.h" > > +#include "eal_thread.h" > > > > #define SYS_CPU_DIR "/sys/devices/system/cpu/cpu%u" > > #define CORE_ID_FILE "topology/core_id" > > @@ -71,8 +72,8 @@ cpu_detected(unsigned lcore_id) > > * Note: physical package id !=3D NUMA node, but we use it as a > > * fallback for kernels which don't create a nodeY link > > */ > > -static unsigned > > -cpu_socket_id(unsigned lcore_id) > > +unsigned > > +eal_cpu_socket_id(unsigned lcore_id) > If you want to export this symbol, then you need to add it to the version= map. [LCM] They're all EAL internal function, won't plan to expose as EAL API. >=20 > Neil