From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 8C57BCE7 for ; Sat, 28 Feb 2015 02:51:06 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 27 Feb 2015 17:51:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,664,1418112000"; d="scan'208";a="691895791" Received: from kmsmsx153.gar.corp.intel.com ([172.21.73.88]) by orsmga002.jf.intel.com with ESMTP; 27 Feb 2015 17:51:04 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.110.15) by KMSMSX153.gar.corp.intel.com (172.21.73.88) with Microsoft SMTP Server (TLS) id 14.3.195.1; Sat, 28 Feb 2015 09:51:02 +0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.62]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.161]) with mapi id 14.03.0195.001; Sat, 28 Feb 2015 09:51:01 +0800 From: "Liang, Cunming" To: Neil Horman , "dev@dpdk.org" Thread-Topic: [PATCH v3] eal: Clean up export of per_lcore__socket_id Thread-Index: AQHQUomYYb5bXlDAJUGEA7rSKn+KZZ0FTKYA Date: Sat, 28 Feb 2015 01:51:01 +0000 Message-ID: References: <1424874849-8973-1-git-send-email-nhorman@tuxdriver.com> <1425040393-31201-1-git-send-email-nhorman@tuxdriver.com> In-Reply-To: <1425040393-31201-1-git-send-email-nhorman@tuxdriver.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 v3] eal: Clean up export of per_lcore__socket_id 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: Sat, 28 Feb 2015 01:51:07 -0000 Hi, > -----Original Message----- > From: Neil Horman [mailto:nhorman@tuxdriver.com] > Sent: Friday, February 27, 2015 8:33 PM > To: dev@dpdk.org > Cc: thomas.monjalon@6wind.com; Liang, Cunming; Neil Horman > Subject: [PATCH v3] eal: Clean up export of per_lcore__socket_id >=20 > Theres no need to export this variable. Its set and queried from an API = call > that doesn't exist in the hot path. Instead just export the rte_socket_i= d > symbol and make the variable private to protect it from type changes. We= should > do this with the other exported variables too, but I think its too late i= n the > release cycle to do that. >=20 > tested using distributor_autotest (which uses rte_socket_id), successfull= y. > Only tested on linux, as I don't currently have a bsd system spun up, but= the > changes are symmetric, and should be fine >=20 > Signed-off-by: Neil Horman >=20 > --- > Change Notes: >=20 > v2) Moved rte_socket_id to be a common function >=20 > v3) replaced some previously removed spaces > --- > lib/librte_eal/bsdapp/eal/rte_eal_version.map | 2 +- > lib/librte_eal/common/eal_common_thread.c | 7 +++++++ > lib/librte_eal/common/include/rte_lcore.h | 7 +------ > lib/librte_eal/linuxapp/eal/rte_eal_version.map | 2 +- > 4 files changed, 10 insertions(+), 8 deletions(-) >=20 > diff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map > b/lib/librte_eal/bsdapp/eal/rte_eal_version.map > index 17515a9..d83524d 100644 > --- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map > +++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map > @@ -10,7 +10,6 @@ DPDK_2.0 { > pci_driver_list; > per_lcore__lcore_id; > per_lcore__rte_errno; > - per_lcore__socket_id; > rte_cpu_check_supported; > rte_cpu_get_flag_enabled; > rte_cycles_vmware_tsc_map; > @@ -82,6 +81,7 @@ DPDK_2.0 { > rte_set_log_level; > rte_set_log_type; > rte_snprintf; > + rte_socket_id; > rte_strerror; > rte_strsplit; > rte_sys_gettid; > diff --git a/lib/librte_eal/common/eal_common_thread.c > b/lib/librte_eal/common/eal_common_thread.c > index f4d9892..2405e93 100644 > --- a/lib/librte_eal/common/eal_common_thread.c > +++ b/lib/librte_eal/common/eal_common_thread.c > @@ -46,6 +46,13 @@ >=20 > #include "eal_thread.h" >=20 > +RTE_DECLARE_PER_LCORE(unsigned , _socket_id); > + > +unsigned rte_socket_id(void) > +{ > + return RTE_PER_LCORE(_socket_id); > +} > + > int eal_cpuset_socket_id(rte_cpuset_t *cpusetp) > { > unsigned cpu =3D 0; > diff --git a/lib/librte_eal/common/include/rte_lcore.h > b/lib/librte_eal/common/include/rte_lcore.h > index 20a58eb..e03264e 100644 > --- a/lib/librte_eal/common/include/rte_lcore.h > +++ b/lib/librte_eal/common/include/rte_lcore.h > @@ -81,7 +81,6 @@ struct lcore_config { > extern struct lcore_config lcore_config[RTE_MAX_LCORE]; >=20 > RTE_DECLARE_PER_LCORE(unsigned, _lcore_id); /**< Per thread "lcore id".= */ > -RTE_DECLARE_PER_LCORE(unsigned, _socket_id); /**< Per thread "socket id"= . > */ > RTE_DECLARE_PER_LCORE(rte_cpuset_t, _cpuset); /**< Per thread "cpuset". = */ >=20 > /** > @@ -145,11 +144,7 @@ rte_lcore_index(int lcore_id) > * @return > * the ID of current lcoreid's physical socket > */ > -static inline unsigned > -rte_socket_id(void) > -{ > - return RTE_PER_LCORE(_socket_id); > -} > +unsigned rte_socket_id(void); >=20 > /** > * Get the ID of the physical socket of the specified lcore > diff --git a/lib/librte_eal/linuxapp/eal/rte_eal_version.map > b/lib/librte_eal/linuxapp/eal/rte_eal_version.map > index 17515a9..d83524d 100644 > --- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map > +++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map > @@ -10,7 +10,6 @@ DPDK_2.0 { > pci_driver_list; > per_lcore__lcore_id; > per_lcore__rte_errno; > - per_lcore__socket_id; > rte_cpu_check_supported; > rte_cpu_get_flag_enabled; > rte_cycles_vmware_tsc_map; > @@ -82,6 +81,7 @@ DPDK_2.0 { > rte_set_log_level; > rte_set_log_type; > rte_snprintf; > + rte_socket_id; > rte_strerror; > rte_strsplit; > rte_sys_gettid; > -- > 2.1.0 Acked-by: Cunming Liang