aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-02-09 18:09:31 +0000
committerDave Barach <openvpp@barachs.net>2020-02-10 20:12:40 +0000
commit4c9599574929f624a218b963d268d97799289945 (patch)
treed0fd96ed24813d9bfd88e681f676d598fb409350 /src/vlib
parentf1ecb6555326f8a7d5bba6f56aa676f064675dc0 (diff)
vppinfra: use vm memory allocator for numa mapping
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I13b239cd572ae6dfaec07019d3d9b7c0ed3edcfa
Diffstat (limited to 'src/vlib')
-rw-r--r--src/vlib/main.c1
-rw-r--r--src/vlib/threads.c8
2 files changed, 4 insertions, 5 deletions
diff --git a/src/vlib/main.c b/src/vlib/main.c
index 28c8c789c0a..94218d3d9d8 100644
--- a/src/vlib/main.c
+++ b/src/vlib/main.c
@@ -1717,6 +1717,7 @@ vlib_main_or_worker_loop (vlib_main_t * vm, int is_main)
vm->cpu_id = clib_get_current_cpu_id ();
vm->numa_node = clib_get_current_numa_node ();
+ os_set_numa_index (vm->numa_node);
/* Start all processes. */
if (is_main)
diff --git a/src/vlib/threads.c b/src/vlib/threads.c
index 8a068875617..d9d781070a3 100644
--- a/src/vlib/threads.c
+++ b/src/vlib/threads.c
@@ -589,9 +589,8 @@ vlib_get_thread_core_numa (vlib_worker_thread_t * w, unsigned cpu_id)
p = format (p, "%s%u/topology/core_id%c", sys_cpu_path, cpu_id, 0);
clib_sysfs_read ((char *) p, "%d", &core_id);
vec_reset_length (p);
- p =
- format (p, "%s%u/topology/physical_package_id%c", sys_cpu_path, cpu_id,
- 0);
+ p = format (p, "%s%u/topology/physical_package_id%c", sys_cpu_path,
+ cpu_id, 0);
clib_sysfs_read ((char *) p, "%d", &numa_id);
vec_free (p);
@@ -608,7 +607,6 @@ vlib_launch_thread_int (void *fp, vlib_worker_thread_t * w, unsigned cpu_id)
w->cpu_id = cpu_id;
vlib_get_thread_core_numa (w, cpu_id);
- os_set_numa_index (w->numa_id);
/* Set up NUMA-bound heap if indicated */
if (clib_per_numa_mheaps[w->numa_id] == 0)
@@ -617,7 +615,7 @@ vlib_launch_thread_int (void *fp, vlib_worker_thread_t * w, unsigned cpu_id)
if (tm->numa_heap_size)
{
numa_heap = clib_mem_init_thread_safe_numa
- (0 /* DIY */ , tm->numa_heap_size);
+ (0 /* DIY */ , tm->numa_heap_size, w->numa_id);
clib_per_numa_mheaps[w->numa_id] = numa_heap;
}
else