Set the lcore_config[].thread_id for lcore_main during initialization.
This allows the new rte_lcore_{set,get}_name() APIs to work with
lcore_main consistent with other worker lcores.

Signed-off-by: Tyler Retzlaff <roret...@linux.microsoft.com>
---
 lib/eal/common/eal_common_thread.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/eal/common/eal_common_thread.c 
b/lib/eal/common/eal_common_thread.c
index 91066e6..fb1dfc9 100644
--- a/lib/eal/common/eal_common_thread.c
+++ b/lib/eal/common/eal_common_thread.c
@@ -151,6 +151,9 @@ unsigned rte_socket_id(void)
 
        /* acquire system unique id */
        rte_gettid();
+       if (lcore_id == rte_get_main_lcore())
+               lcore_config[lcore_id].thread_id =
+                       (pthread_t)(rte_thread_self()).opaque_id;
 
        thread_update_affinity(cpuset);
 
-- 
1.8.3.1

Reply via email to