]> git.droids-corp.org - dpdk.git/commitdiff
eal: relocate per thread symbols to common
authorDavid Marchand <david.marchand@redhat.com>
Mon, 6 Jul 2020 20:52:25 +0000 (22:52 +0200)
committerDavid Marchand <david.marchand@redhat.com>
Wed, 8 Jul 2020 12:39:26 +0000 (14:39 +0200)
We have per lcore thread symbols scattered in OS implementations but
common code relies on them.
Move all of them in common.

RTE_PER_LCORE(_socket_id) and RTE_PER_LCORE(_cpuset) have public
accessors and are not exported through the library map, they can be
made static.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
lib/librte_eal/common/eal_common_thread.c
lib/librte_eal/freebsd/eal_thread.c
lib/librte_eal/include/rte_lcore.h
lib/librte_eal/linux/eal_thread.c
lib/librte_eal/windows/eal_thread.c

index a341070926340099c31237daba12b65a761eb44d..7be80c292e03cdabc0fcc1f7168093537ae1416d 100644 (file)
 #include "eal_private.h"
 #include "eal_thread.h"
 
-RTE_DECLARE_PER_LCORE(unsigned , _socket_id);
+RTE_DEFINE_PER_LCORE(unsigned int, _lcore_id) = LCORE_ID_ANY;
+static RTE_DEFINE_PER_LCORE(unsigned int, _socket_id) =
+       (unsigned int)SOCKET_ID_ANY;
+static RTE_DEFINE_PER_LCORE(rte_cpuset_t, _cpuset);
 
 unsigned rte_socket_id(void)
 {
index b52019782ac62a413718ad81e26eec4e3ecb3fd8..40676d9ef52d1698b100a640363417096e9e44bb 100644 (file)
 #include "eal_private.h"
 #include "eal_thread.h"
 
-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
index 339046bc8691a2f5add9366bf5bc1c063d4d7ae2..5c1d1926e9d6f6a50324b9f5e643637c41d760d2 100644 (file)
@@ -23,7 +23,6 @@ extern "C" {
 #define LCORE_ID_ANY     UINT32_MAX       /**< Any lcore. */
 
 RTE_DECLARE_PER_LCORE(unsigned, _lcore_id);  /**< Per thread "lcore id". */
-RTE_DECLARE_PER_LCORE(rte_cpuset_t, _cpuset); /**< Per thread "cpuset". */
 
 /**
  * Get a lcore's role.
index cd9d6e0ebf5b6a297aec712c475d42f3418c42ed..a52ebef3a4ae631342b6405797257079224ff11a 100644 (file)
 #include "eal_private.h"
 #include "eal_thread.h"
 
-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
index 3dd56519c99a6e249bd82c81162395106e08f43b..f12a2ec6ad2e7da0f6ad21562109f4daa5ea8cf7 100644 (file)
 #include "eal_private.h"
 #include "eal_windows.h"
 
-RTE_DEFINE_PER_LCORE(unsigned int, _lcore_id) = LCORE_ID_ANY;
-RTE_DEFINE_PER_LCORE(unsigned int, _socket_id) = (unsigned int)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