In non-EAL thread, lcore_id always be LCORE_ID_ANY.
It can't be used as unique id for recursive spinlock.
Then use rte_gettid() to replace it.
Signed-off-by: Cunming Liang <cunming.liang@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
*/
static inline void rte_spinlock_recursive_lock(rte_spinlock_recursive_t *slr)
{
- int id = rte_lcore_id();
+ int id = rte_gettid();
if (slr->user != id) {
rte_spinlock_lock(&slr->sl);
*/
static inline int rte_spinlock_recursive_trylock(rte_spinlock_recursive_t *slr)
{
- int id = rte_lcore_id();
+ int id = rte_gettid();
if (slr->user != id) {
if (rte_spinlock_trylock(&slr->sl) == 0)
/**
* Return the ID of the execution unit we are running on.
* @return
- * Logical core ID(in EAL thread) or LCORE_ID_ANY(in non-EAL thread)
+ * Logical core ID (in EAL thread) or LCORE_ID_ANY (in non-EAL thread)
*/
static inline unsigned
rte_lcore_id(void)