]> git.droids-corp.org - dpdk.git/blobdiff - lib/librte_eal/common/include/rte_lcore.h
spinlock: support non-EAL thread
[dpdk.git] / lib / librte_eal / common / include / rte_lcore.h
index 045d4b6a65a8d40c38e91dda37c05f03117f44fd..20a58eb392c24659d3c504a26d047f66be865e38 100644 (file)
@@ -48,7 +48,7 @@
 extern "C" {
 #endif
 
-#define LCORE_ID_ANY -1    /**< Any lcore. */
+#define LCORE_ID_ANY     UINT32_MAX       /**< Any lcore. */
 
 #if defined(__linux__)
        typedef cpu_set_t rte_cpuset_t;
@@ -87,7 +87,7 @@ RTE_DECLARE_PER_LCORE(rte_cpuset_t, _cpuset); /**< Per thread "cpuset". */
 /**
  * Return the ID of the execution unit we are running on.
  * @return
- *  Logical core ID
+ *  Logical core ID (in EAL thread) or LCORE_ID_ANY (in non-EAL thread)
  */
 static inline unsigned
 rte_lcore_id(void)
@@ -148,7 +148,7 @@ rte_lcore_index(int lcore_id)
 static inline unsigned
 rte_socket_id(void)
 {
-       return lcore_config[rte_lcore_id()].socket_id;
+       return RTE_PER_LCORE(_socket_id);
 }
 
 /**