diff options
author | Dave Barach <dave@barachs.net> | 2020-10-02 11:35:44 -0400 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2020-10-02 21:08:47 +0000 |
commit | 1c556d19d0b7a0f9d130ddfb07041cb2cafb8a8d (patch) | |
tree | 915d2531a63ad3cf2296f04675327715769a4eaa /src | |
parent | 2bc1af5578a9c669c16839656bb661ce950c2246 (diff) |
vlib: always replace bootstrap vlib_mains
Fixes an obscure issue when spinning up pure pthreads which don't have
vlib_main_t clones.
VLIB_REGISTER_THREAD () = {
<snip>
.use_pthreads = 1,
.no_data_structure_clone = 1,
}
Type: improvement
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ifae5a2a35865de057eea7782ee71b1011a21c88e
Diffstat (limited to 'src')
-rw-r--r-- | src/vlib/threads.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/vlib/threads.c b/src/vlib/threads.c index 270ccc325ba..ecca7e3ea52 100644 --- a/src/vlib/threads.c +++ b/src/vlib/threads.c @@ -707,16 +707,15 @@ start_workers (vlib_main_t * vm) clib_callback_data_init (&vm->vlib_node_runtime_perf_callbacks, &vm->worker_thread_main_loop_callback_lock); - if (n_vlib_mains > 1) - { - /* Replace hand-crafted length-1 vector with a real vector */ - vlib_mains = 0; + /* Replace hand-crafted length-1 vector with a real vector */ + vlib_mains = 0; - vec_validate_aligned (vlib_mains, tm->n_vlib_mains - 1, - CLIB_CACHE_LINE_BYTES); - _vec_len (vlib_mains) = 0; - vec_add1_aligned (vlib_mains, vm, CLIB_CACHE_LINE_BYTES); + vec_validate_aligned (vlib_mains, n_vlib_mains - 1, CLIB_CACHE_LINE_BYTES); + _vec_len (vlib_mains) = 0; + vec_add1_aligned (vlib_mains, vm, CLIB_CACHE_LINE_BYTES); + if (n_vlib_mains > 1) + { vlib_worker_threads->wait_at_barrier = clib_mem_alloc_aligned (sizeof (u32), CLIB_CACHE_LINE_BYTES); vlib_worker_threads->workers_at_barrier = |