eal: Clean up export of per_lcore__socket_id
PATCH 1/1 eal: Clean up export of per_lcore__socket_id
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_id 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 in the release cycle to do that.
tested using distributor_autotest (which uses rte_socket_id), successfully. Only tested on linux, as I don't currently have a bsd system spun up, but the changes are symmetric, and should be fine
--- lib/librte_eal/bsdapp/eal/eal_thread.c | 5 +++++ lib/librte_eal/bsdapp/eal/rte_eal_version.map | 2 +- lib/librte_eal/common/eal_common_thread.c | 2 ++ lib/librte_eal/common/include/rte_lcore.h | 7 +------ lib/librte_eal/linuxapp/eal/eal_thread.c | 5 +++++ lib/librte_eal/linuxapp/eal/rte_eal_version.map | 2 +- 6 files changed, 15 insertions(+), 8 deletions(-)
lib/librte_eal/bsdapp/eal/eal_thread.c +5 -0
@@ -60,6 +60,11 @@ RTE_DEFINE_PER_LCORE(unsigned, _lcore_id) = LCORE_ID_ANY;RTE_DEFINE_PER_LCORE (unsigned, _socket_id) = (unsigned )SOCKET_ID_ANY ;RTE_DEFINE_PER_LCORE (rte_cpuset_t, _cpuset); +unsigned rte_socket_id (void ) +{ +return RTE_PER_LCORE (_socket_id); +} +/* * Send a message to a slave lcore identified by slave_id to call a * function f with argument arg. Once the execution is done, the
lib/librte_eal/bsdapp/eal/rte_eal_version.map +1 -1
@@ -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;
lib/librte_eal/common/eal_common_thread.c +2 -0
@@ -46,6 +46,8 @@#include "eal_thread.h" +RTE_DECLARE_PER_LCORE (unsigned , _socket_id); +int eal_cpuset_socket_id (rte_cpuset_t *cpusetp) {unsigned cpu =0 ;
lib/librte_eal/common/include/rte_lcore.h +1 -6
@@ -81,7 +81,6 @@ struct lcore_config {extern struct lcore_config lcore_config[RTE_MAX_LCORE ];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". */ /**
@@ -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 );/** * Get the ID of the physical socket of the specified lcore
lib/librte_eal/linuxapp/eal/eal_thread.c +5 -0
@@ -60,6 +60,11 @@ RTE_DEFINE_PER_LCORE(unsigned, _lcore_id) = LCORE_ID_ANY;RTE_DEFINE_PER_LCORE (unsigned, _socket_id) = (unsigned )SOCKET_ID_ANY ;RTE_DEFINE_PER_LCORE (rte_cpuset_t, _cpuset); +unsigned rte_socket_id (void ) +{ +return RTE_PER_LCORE (_socket_id); +} +/* * Send a message to a slave lcore identified by slave_id to call a * function f with argument arg. Once the execution is done, the
lib/librte_eal/linuxapp/eal/rte_eal_version.map +1 -1
@@ -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;
Signature · 1 line
2.1.0
Hi Neil,
Thanks for the cleanup.
Does it better moving rte_socket_id() to eal_common_thread.c ?
As it simply returns _socket_id, it's not necessary to have two copy in both linux and bsd.
-Cunming
Quoted 148 lines
-----Original Message-----
From: Neil Horman [mailto:[email protected]]
Sent: Wednesday, February 25, 2015 10:34 PM
To: [email protected]
Cc: [email protected]; Liang, Cunming; Neil Horman
Subject: [PATCH] eal: Clean up export ofper_lcore__socket_idTheres 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_idsymbol 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 in the release cycle to do that.tested using
distributor_autotest(which usesrte_socket_id), successfully. Only tested on linux, as I don't currently have a bsd system spun up, but the changes are symmetric, and should be fineSigned-off-by Neil Horman <[email protected]>--- lib/librte_eal/bsdapp/eal/eal_thread.c | 5 +++++ lib/librte_eal/bsdapp/eal/rte_eal_version.map | 2 +- lib/librte_eal/common/eal_common_thread.c | 2 ++ lib/librte_eal/common/include/rte_lcore.h | 7 +------ lib/librte_eal/linuxapp/eal/eal_thread.c | 5 +++++ lib/librte_eal/linuxapp/eal/rte_eal_version.map | 2 +- 6 files changed, 15 insertions(+), 8 deletions(-)lib/librte_eal/bsdapp/eal/eal_thread.c +5
-0@@ -60,6 +60,11 @@ RTE_DEFINE_PER_LCORE(unsigned, _lcore_id) =LCORE_ID_ANY ;RTE_DEFINE_PER_LCORE (unsigned, _socket_id) = (unsigned )SOCKET_ID_ANY ;RTE_DEFINE_PER_LCORE (rte_cpuset_t, _cpuset); +unsigned rte_socket_id (void ) +{ +return RTE_PER_LCORE (_socket_id); +} +/* * Send a message to a slave lcore identified by slave_id to call a * function f with argument arg. Once the execution is done, the
lib/librte_eal/bsdapp/eal/rte_eal_version.map +1
-1@@ -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;lib/librte_eal/common/eal_common_thread.c +2
-0@@ -46,6 +46,8 @@#include "eal_thread.h" +RTE_DECLARE_PER_LCORE (unsigned , _socket_id); +int eal_cpuset_socket_id (rte_cpuset_t *cpusetp) {unsigned cpu =0 ;lib/librte_eal/common/include/rte_lcore.h +0
-1@@ -81,7 +81,6 @@ struct lcore_config {extern struct lcore_config lcore_config[RTE_MAX_LCORE]; 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". */ /**
lib/librte_eal/common/include/rte_lcore.h +1
-5@@ -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 );/** * Get the ID of the physical socket of the specified lcore lib/librte_eal/linuxapp/eal/eal_thread.c +5
-0@@ -60,6 +60,11 @@ RTE_DEFINE_PER_LCORE(unsigned, _lcore_id) =LCORE_ID_ANY ;RTE_DEFINE_PER_LCORE (unsigned, _socket_id) = (unsigned )SOCKET_ID_ANY ;RTE_DEFINE_PER_LCORE (rte_cpuset_t, _cpuset); +unsigned rte_socket_id (void ) +{ +return RTE_PER_LCORE (_socket_id); +} +/* * Send a message to a slave lcore identified by slave_id to call a * function f with argument arg. Once the execution is done, the
lib/librte_eal/linuxapp/eal/rte_eal_version.map +1
-2@@ -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
Quoted 8 lines · Cunming
Hi Neil,
Thanks for the cleanup.
Does it better movingrte_socket_id()toeal_common_thread.c?
As it simply returns_socket_id, it's not necessary to have two copy in both linux and bsd.-Cunming
Sure, I can respin this in the AM.
neil
Quoted 150 lines
Quoted 148 lines
-----Original Message-----
From: Neil Horman [mailto:[email protected]]
Sent: Wednesday, February 25, 2015 10:34 PM
To: [email protected]
Cc: [email protected]; Liang, Cunming; Neil Horman
Subject: [PATCH] eal: Clean up export ofper_lcore__socket_idTheres 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_idsymbol 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 in the release cycle to do that.tested using
distributor_autotest(which usesrte_socket_id), successfully. Only tested on linux, as I don't currently have a bsd system spun up, but the changes are symmetric, and should be fineSigned-off-by Neil Horman <[email protected]>--- lib/librte_eal/bsdapp/eal/eal_thread.c | 5 +++++ lib/librte_eal/bsdapp/eal/rte_eal_version.map | 2 +- lib/librte_eal/common/eal_common_thread.c | 2 ++ lib/librte_eal/common/include/rte_lcore.h | 7 +------ lib/librte_eal/linuxapp/eal/eal_thread.c | 5 +++++ lib/librte_eal/linuxapp/eal/rte_eal_version.map | 2 +- 6 files changed, 15 insertions(+), 8 deletions(-)lib/librte_eal/bsdapp/eal/eal_thread.c +5
-0@@ -60,6 +60,11 @@ RTE_DEFINE_PER_LCORE(unsigned, _lcore_id) =LCORE_ID_ANY ;RTE_DEFINE_PER_LCORE (unsigned, _socket_id) = (unsigned )SOCKET_ID_ANY ;RTE_DEFINE_PER_LCORE (rte_cpuset_t, _cpuset); +unsigned rte_socket_id (void ) +{ +return RTE_PER_LCORE (_socket_id); +} +/* * Send a message to a slave lcore identified by slave_id to call a * function f with argument arg. Once the execution is done, the
lib/librte_eal/bsdapp/eal/rte_eal_version.map +1
-1@@ -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;lib/librte_eal/common/eal_common_thread.c +2
-0@@ -46,6 +46,8 @@#include "eal_thread.h" +RTE_DECLARE_PER_LCORE (unsigned , _socket_id); +int eal_cpuset_socket_id (rte_cpuset_t *cpusetp) {unsigned cpu =0 ;lib/librte_eal/common/include/rte_lcore.h +0
-1@@ -81,7 +81,6 @@ struct lcore_config {extern struct lcore_config lcore_config[RTE_MAX_LCORE]; 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". */ /**
lib/librte_eal/common/include/rte_lcore.h +1
-5@@ -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 );/** * Get the ID of the physical socket of the specified lcore lib/librte_eal/linuxapp/eal/eal_thread.c +5
-0@@ -60,6 +60,11 @@ RTE_DEFINE_PER_LCORE(unsigned, _lcore_id) =LCORE_ID_ANY ;RTE_DEFINE_PER_LCORE (unsigned, _socket_id) = (unsigned )SOCKET_ID_ANY ;RTE_DEFINE_PER_LCORE (rte_cpuset_t, _cpuset); +unsigned rte_socket_id (void ) +{ +return RTE_PER_LCORE (_socket_id); +} +/* * Send a message to a slave lcore identified by slave_id to call a * function f with argument arg. Once the execution is done, the
lib/librte_eal/linuxapp/eal/rte_eal_version.map +1
-2@@ -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
PATCH v2 1/1 eal: Clean up export of per_lcore__socket_id
In reply to a message not in the archiveTheres 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_id 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 in the release cycle to do that.
tested using distributor_autotest (which uses rte_socket_id), successfully. Only tested on linux, as I don't currently have a bsd system spun up, but the changes are symmetric, and should be fine
---
Change Notes:
v2) Moved rte_socket_id to be a common function
--- lib/librte_eal/bsdapp/eal/eal_thread.c | 1 - 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/eal_thread.c | 1 - lib/librte_eal/linuxapp/eal/rte_eal_version.map | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-)
lib/librte_eal/bsdapp/eal/eal_thread.c +0 -1
@@ -59,7 +59,6 @@RTE_DEFINE_PER_LCORE (unsigned, _lcore_id) =LCORE_ID_ANY ;RTE_DEFINE_PER_LCORE (unsigned, _socket_id) = (unsigned )SOCKET_ID_ANY ;RTE_DEFINE_PER_LCORE (rte_cpuset_t, _cpuset); -/* * Send a message to a slave lcore identified by slave_id to call a * function f with argument arg. Once the execution is done, the
lib/librte_eal/bsdapp/eal/rte_eal_version.map +1 -1
@@ -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;
lib/librte_eal/common/eal_common_thread.c +7 -0
@@ -46,6 +46,13 @@#include "eal_thread.h" +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 =0 ;
lib/librte_eal/common/include/rte_lcore.h +1 -6
@@ -81,7 +81,6 @@ struct lcore_config {extern struct lcore_config lcore_config[RTE_MAX_LCORE ];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". */ /**
@@ -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 );/** * Get the ID of the physical socket of the specified lcore
lib/librte_eal/linuxapp/eal/eal_thread.c +0 -1
@@ -59,7 +59,6 @@RTE_DEFINE_PER_LCORE (unsigned, _lcore_id) =LCORE_ID_ANY ;RTE_DEFINE_PER_LCORE (unsigned, _socket_id) = (unsigned )SOCKET_ID_ANY ;RTE_DEFINE_PER_LCORE (rte_cpuset_t, _cpuset); -/* * Send a message to a slave lcore identified by slave_id to call a * function f with argument arg. Once the execution is done, the
lib/librte_eal/linuxapp/eal/rte_eal_version.map +1 -1
@@ -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;
Signature · 1 line
2.1.0
Liang, Cunming
Acked-byHi,
Quoted 147 lines
-----Original Message-----
From: Neil Horman [mailto:[email protected]]
Sent: Thursday, February 26, 2015 8:48 PM
To: [email protected]
Cc: [email protected]; Liang, Cunming; Neil Horman
Subject: [PATCH v2] eal: Clean up export ofper_lcore__socket_idTheres 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_idsymbol 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 in the release cycle to do that.tested using
distributor_autotest(which usesrte_socket_id), successfully. Only tested on linux, as I don't currently have a bsd system spun up, but the changes are symmetric, and should be fineSigned-off-by Neil Horman <[email protected]>---
Change Notes:v2) Moved
rte_socket_idto be a common function--- lib/librte_eal/bsdapp/eal/eal_thread.c | 1 - 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/eal_thread.c | 1 - lib/librte_eal/linuxapp/eal/rte_eal_version.map | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-)lib/librte_eal/bsdapp/eal/eal_thread.c +0
-1@@ -59,7 +59,6 @@RTE_DEFINE_PER_LCORE (unsigned, _lcore_id) =LCORE_ID_ANY ;RTE_DEFINE_PER_LCORE (unsigned, _socket_id) = (unsigned )SOCKET_ID_ANY ;RTE_DEFINE_PER_LCORE (rte_cpuset_t, _cpuset); -/* * Send a message to a slave lcore identified by slave_id to call a * function f with argument arg. Once the execution is done, the lib/librte_eal/bsdapp/eal/rte_eal_version.map +1
-1@@ -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;lib/librte_eal/common/eal_common_thread.c +7
-0@@ -46,6 +46,13 @@#include "eal_thread.h" +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 =0 ;lib/librte_eal/common/include/rte_lcore.h +0
-1@@ -81,7 +81,6 @@ struct lcore_config {extern struct lcore_config lcore_config[RTE_MAX_LCORE]; 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". */ /**
lib/librte_eal/common/include/rte_lcore.h +1
-5@@ -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 );/** * Get the ID of the physical socket of the specified lcore lib/librte_eal/linuxapp/eal/eal_thread.c +0
-1@@ -59,7 +59,6 @@RTE_DEFINE_PER_LCORE (unsigned, _lcore_id) =LCORE_ID_ANY ;RTE_DEFINE_PER_LCORE (unsigned, _socket_id) = (unsigned )SOCKET_ID_ANY ;RTE_DEFINE_PER_LCORE (rte_cpuset_t, _cpuset); -/* * Send a message to a slave lcore identified by slave_id to call a * function f with argument arg. Once the execution is done, the lib/librte_eal/linuxapp/eal/rte_eal_version.map +1
-2@@ -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; --
Quoted 1 line
2.1.0
David Marchand
Acked-byHello Neil,
Quoted 24 lines · Neil Horman
lib/librte_eal/bsdapp/eal/eal_thread.c +0
-1@@ -59,7 +59,6 @@RTE_DEFINE_PER_LCORE (unsigned, _lcore_id) =LCORE_ID_ANY ;RTE_DEFINE_PER_LCORE (unsigned, _socket_id) = (unsigned )SOCKET_ID_ANY ;RTE_DEFINE_PER_LCORE (rte_cpuset_t, _cpuset); -/* * Send a message to a slave lcore identified by slave_id to call a * function f with argument arg. Once the execution is done, the lib/librte_eal/linuxapp/eal/eal_thread.c +0
-0
lib/librte_eal/linuxapp/eal/eal_thread.c line 64
Quoted 7 lines
lib/librte_eal/linuxapp/eal/eal_thread.c +0
-1@@ -59,7 +59,6 @@RTE_DEFINE_PER_LCORE (unsigned, _lcore_id) =LCORE_ID_ANY ;RTE_DEFINE_PER_LCORE (unsigned, _socket_id) = (unsigned )SOCKET_ID_ANY ;RTE_DEFINE_PER_LCORE (rte_cpuset_t, _cpuset); -/* * Send a message to a slave lcore identified by slave_id to call a * function f with argument arg. Once the execution is done, the
Can you remove these two hunks ?
Then,
Signature · 1 line
David Marchand
PATCH v3 1/1 eal: Clean up export of per_lcore__socket_id
In reply to a message not in the archiveTheres 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_id 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 in the release cycle to do that.
tested using distributor_autotest (which uses rte_socket_id), successfully. Only tested on linux, as I don't currently have a bsd system spun up, but the changes are symmetric, and should be fine
---
Change Notes:
v2) Moved rte_socket_id to be a common function
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(-)
lib/librte_eal/bsdapp/eal/rte_eal_version.map +1 -1
@@ -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;
lib/librte_eal/common/eal_common_thread.c +7 -0
@@ -46,6 +46,13 @@#include "eal_thread.h" +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 =0 ;
lib/librte_eal/common/include/rte_lcore.h +1 -6
@@ -81,7 +81,6 @@ struct lcore_config {extern struct lcore_config lcore_config[RTE_MAX_LCORE ];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". */ /**
@@ -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 );/** * Get the ID of the physical socket of the specified lcore
lib/librte_eal/linuxapp/eal/rte_eal_version.map +1 -1
@@ -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;
Signature · 1 line
2.1.0
Liang, Cunming
Acked-byHi,
Quoted 121 lines
-----Original Message-----
From: Neil Horman [mailto:[email protected]]
Sent: Friday, February 27, 2015 8:33 PM
To: [email protected]
Cc: [email protected]; Liang, Cunming; Neil Horman
Subject: [PATCH v3] eal: Clean up export ofper_lcore__socket_idTheres 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_idsymbol 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 in the release cycle to do that.tested using
distributor_autotest(which usesrte_socket_id), successfully. Only tested on linux, as I don't currently have a bsd system spun up, but the changes are symmetric, and should be fineSigned-off-by Neil Horman <[email protected]>---
Change Notes:v2) Moved
rte_socket_idto be a common functionv3) 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(-)lib/librte_eal/bsdapp/eal/rte_eal_version.map +1
-1@@ -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;lib/librte_eal/common/eal_common_thread.c +7
-0@@ -46,6 +46,13 @@#include "eal_thread.h" +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 =0 ;lib/librte_eal/common/include/rte_lcore.h +0
-1@@ -81,7 +81,6 @@ struct lcore_config {extern struct lcore_config lcore_config[RTE_MAX_LCORE]; 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". */ /**
lib/librte_eal/common/include/rte_lcore.h +1
-5@@ -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 );/** * Get the ID of the physical socket of the specified lcore lib/librte_eal/linuxapp/eal/rte_eal_version.map +1
-2@@ -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; --
Quoted 1 line
2.1.0
Thomas Monjalon
AppliedQuoted 6 lines
Quoted 6 lines
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_idsymbol 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 in the release cycle to do that.
Quoted 7 lines
Quoted 5 lines
tested using
distributor_autotest(which usesrte_socket_id), successfully. Only tested on linux, as I don't currently have a bsd system spun up, but the changes are symmetric, and should be fineSigned-off-by Neil Horman <[email protected]>Acked-by Cunming Liang <[email protected]>
Applied, thanks