summaryrefslogtreecommitdiffstats
path: root/src/vlib
diff options
context:
space:
mode:
Diffstat (limited to 'src/vlib')
-rw-r--r--src/vlib/main.h4
-rw-r--r--src/vlib/threads.c3
-rwxr-xr-xsrc/vlib/unix/main.c2
3 files changed, 8 insertions, 1 deletions
diff --git a/src/vlib/main.h b/src/vlib/main.h
index 474756bebd6..8a25ce8b4cc 100644
--- a/src/vlib/main.h
+++ b/src/vlib/main.h
@@ -172,8 +172,10 @@ typedef struct vlib_main_t
/* Hash table to record which init functions have been called. */
uword *init_functions_called;
- /* to compare with node runtime */
+ /* thread, cpu and numa_node indices */
u32 thread_index;
+ u32 cpu_index;
+ u32 numa_node;
/* List of init functions to call, setup by constructors */
_vlib_init_function_list_elt_t *init_function_registrations;
diff --git a/src/vlib/threads.c b/src/vlib/threads.c
index 3e184e3e1cd..45e4d89b7ab 100644
--- a/src/vlib/threads.c
+++ b/src/vlib/threads.c
@@ -1681,6 +1681,9 @@ vlib_worker_thread_fn (void *arg)
ASSERT (vm->thread_index == vlib_get_thread_index ());
+ vm->cpu_index = clib_get_current_cpu_index ();
+ vm->numa_node = clib_get_current_numa_node ();
+
vlib_worker_thread_init (w);
clib_time_init (&vm->clib_time);
clib_mem_set_heap (w->thread_mheap);
diff --git a/src/vlib/unix/main.c b/src/vlib/unix/main.c
index 08f0506fbc2..4d6519ed857 100755
--- a/src/vlib/unix/main.c
+++ b/src/vlib/unix/main.c
@@ -671,6 +671,8 @@ vlib_unix_main (int argc, char *argv[])
__os_thread_index = 0;
vm->thread_index = 0;
+ vm->cpu_index = clib_get_current_cpu_index ();
+ vm->numa_node = clib_get_current_numa_node ();
i = clib_calljmp (thread0, (uword) vm,
(void *) (vlib_thread_stacks[0] +