vlib: properly configure main thread's core id 93/24693/4
authorJon Loeliger <jdl@netgate.com>
Fri, 31 Jan 2020 00:37:47 +0000 (18:37 -0600)
committerDamjan Marion <dmarion@me.com>
Mon, 10 Feb 2020 18:53:46 +0000 (18:53 +0000)
Prior to this patch, the main thread's core id was
always reported as 0.
This patch makes a call to vlib_get_thread_core_socket() on
the main thread so that its core id is set properly.

Type: fix
Fixes: 5d64c7868f67749a6c99eb4ee5998b518ab6c71c

Change-Id: I019cb95eec031da25197e48d956038c4bd6b5040
Signed-off-by: Jon Loeliger <jdl@netgate.com>
src/vlib/threads.c

index a827e35..8a06887 100644 (file)
@@ -283,6 +283,8 @@ vlib_thread_init (vlib_main_t * vm)
   w->thread_id = pthread_self ();
   tm->n_vlib_mains = 1;
 
+  vlib_get_thread_core_numa (w, w->cpu_id);
+
   if (tm->sched_policy != ~0)
     {
       struct sched_param sched_param;