vpp: fix main heap init 36/28836/3
authorBenoît Ganne <bganne@cisco.com>
Tue, 15 Sep 2020 08:45:55 +0000 (10:45 +0200)
committerDamjan Marion <dmarion@me.com>
Wed, 16 Sep 2020 17:38:42 +0000 (17:38 +0000)
NUMA node parsing with vlib_get_thread_core_numa() can failed on single
socket systems. Use clib_get_current_numa_node() instead as we already
pinned the main thread to the requested core.

Type: fix

Change-Id: I22339516d0305689a58584c92ded7c96eb53be39
Signed-off-by: Benoît Ganne <bganne@cisco.com>
src/vpp/vnet/main.c

index 00cb4ad..7d87d0c 100644 (file)
@@ -282,11 +282,8 @@ defaulted:
   /* Allocate main heap */
   if ((main_heap = clib_mem_init_thread_safe (0, main_heap_size)))
     {
-      vlib_worker_thread_t tmp;
-
       /* Figure out which numa runs the main thread */
-      vlib_get_thread_core_numa (&tmp, main_core);
-      __os_numa_index = tmp.numa_id;
+      __os_numa_index = clib_get_current_numa_node ();
 
       /* and use the main heap as that numa's numa heap */
       clib_mem_set_per_numa_heap (main_heap);