aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/threads.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2022-06-01 00:45:18 +0200
committerBeno�t Ganne <bganne@cisco.com>2022-06-01 11:34:03 +0000
commit321bd106a64bdd6c051579f58e111f71c2c7e7d6 (patch)
tree4e5cb606b19a533d404f8dc60325c620ff6d1951 /src/vlib/threads.c
parentdd2f12ba6ab952d9d66f4d9ba89ffde6309b1ff2 (diff)
vlib: add VLIB_NUM_WORKERS_CHANGE_FN() handler
Allows features to update their data structures after change in number of worker threads. Type: improvement Change-Id: Icd4d197e28608f5bbb1edd13eb624cd98e33cafe Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib/threads.c')
-rw-r--r--src/vlib/threads.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/vlib/threads.c b/src/vlib/threads.c
index 6c39e688b72..5599c5b352b 100644
--- a/src/vlib/threads.c
+++ b/src/vlib/threads.c
@@ -820,6 +820,14 @@ start_workers (vlib_main_t * vm)
}
}
vlib_worker_thread_barrier_sync (vm);
+ {
+ clib_error_t *err;
+ err = vlib_call_init_exit_functions (
+ vm, &vgm->num_workers_change_function_registrations, 1 /* call_once */,
+ 1 /* is_global */);
+ if (err)
+ clib_error_report (err);
+ }
vlib_worker_thread_barrier_release (vm);
return 0;
}