aboutsummaryrefslogtreecommitdiffstats
path: root/src/vcl/vcl_locked.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vcl/vcl_locked.c')
-rw-r--r--src/vcl/vcl_locked.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/src/vcl/vcl_locked.c b/src/vcl/vcl_locked.c
index 4b88b27ac6f..678499cd71c 100644
--- a/src/vcl/vcl_locked.c
+++ b/src/vcl/vcl_locked.c
@@ -1491,44 +1491,30 @@ static void
vls_app_fork_child_handler (void)
{
vcl_worker_t *parent_wrk;
- int rv, parent_wrk_index;
- u8 *child_name;
+ int parent_wrk_index;
parent_wrk_index = vcl_get_worker_index ();
VDBG (0, "initializing forked child %u with parent wrk %u", getpid (),
parent_wrk_index);
/*
- * Allocate worker vcl
+ * Clear old state
*/
vcl_set_worker_index (~0);
- if (!vcl_worker_alloc_and_init ())
- VERR ("couldn't allocate new worker");
/*
- * Attach to binary api
+ * Allocate and register vcl worker with vpp
*/
- child_name = format (0, "%v-child-%u%c", vcm->app_name, getpid (), 0);
- vcl_cleanup_bapi ();
- vppcom_api_hookup ();
- vcm->app_state = STATE_APP_START;
- rv = vppcom_connect_to_vpp ((char *) child_name);
- vec_free (child_name);
- if (rv)
+ if (vppcom_worker_register ())
{
- VERR ("couldn't connect to VPP!");
+ VERR ("couldn't register new worker!");
return;
}
/*
- * Allocate/initialize vls worker
+ * Allocate/initialize vls worker and share sessions
*/
vls_worker_alloc ();
-
- /*
- * Register worker with vpp and share sessions
- */
- vcl_worker_register_with_vpp ();
parent_wrk = vcl_worker_get (parent_wrk_index);
vls_worker_copy_on_fork (parent_wrk);
parent_wrk->forked_child = vcl_get_worker_index ();