diff options
author | Dave Barach <dbarach@cisco.com> | 2017-09-26 10:54:34 -0400 |
---|---|---|
committer | John Lo <loj@cisco.com> | 2017-09-26 17:17:09 +0000 |
commit | 69128d0209ba6108430dca9cc78ab36a9b1c793e (patch) | |
tree | 744b543327338d10594c2578f66ec250d3947070 /src/vlibmemory | |
parent | 8a398bbae279f07b1f9203721836b60dd1f39142 (diff) |
Add thread-safe event signaller, use RPC where required
Update ping code to use the new function
Change-Id: Ieb753b23f8402cbe5667c22747896784c8ece937
Signed-off-by: Florin Coras <fcoras@cisco.com>
Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vlibmemory')
-rw-r--r-- | src/vlibmemory/memory_vlib.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/vlibmemory/memory_vlib.c b/src/vlibmemory/memory_vlib.c index 77959e6d366..d305ea619aa 100644 --- a/src/vlibmemory/memory_vlib.c +++ b/src/vlibmemory/memory_vlib.c @@ -1573,6 +1573,17 @@ _(RPC_CALL_REPLY,rpc_call_reply) #define foreach_plugin_trace_msg \ _(TRACE_PLUGIN_MSG_IDS,trace_plugin_msg_ids) +/* + * Set the rpc callback at our earliest possible convenience. + * This avoids ordering issues between thread_init() -> start_workers and + * an init function which we could define here. If we ever intend to use + * vlib all by itself, we can't create a link-time dependency on + * an init function here and a typical "call foo_init first" + * guitar lick. + */ + +extern void *rpc_call_main_thread_cb_fn; + static clib_error_t * rpc_api_hookup (vlib_main_t * vm) { @@ -1599,7 +1610,7 @@ rpc_api_hookup (vlib_main_t * vm) /* No reason to halt the parade to create a trace record... */ am->is_mp_safe[VL_API_TRACE_PLUGIN_MSG_IDS] = 1; - + rpc_call_main_thread_cb_fn = vl_api_rpc_call_main_thread; return 0; } |