}
avail_cpu = clib_bitmap_set (avail_cpu, tm->main_lcore, 0);
+ /*
+ * Determine if the number of workers is greater than 0.
+ * If so, mark CPU 0 unavailable so workers will be numbered after main.
+ */
+ u32 n_workers = 0;
+ uword *p = hash_get_mem (tm->thread_registrations_by_name, "workers");
+ if (p != 0)
+ {
+ vlib_thread_registration_t *tr = (vlib_thread_registration_t *) p[0];
+ int worker_thread_count = tr->count;
+ n_workers = worker_thread_count;
+ }
+ if (tm->skip_cores == 0 && n_workers)
+ avail_cpu = clib_bitmap_set (avail_cpu, 0, 0);
+
/* assume that there is socket 0 only if there is no data from sysfs */
if (!tm->cpu_socket_bitmap)
tm->cpu_socket_bitmap = clib_bitmap_set (0, 0, 1);
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);
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)
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