diff options
Diffstat (limited to 'src/vcl/vcl_private.c')
-rw-r--r-- | src/vcl/vcl_private.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/vcl/vcl_private.c b/src/vcl/vcl_private.c index a07e0b165ec..fd35db0b678 100644 --- a/src/vcl/vcl_private.c +++ b/src/vcl/vcl_private.c @@ -101,12 +101,30 @@ vcl_worker_free (vcl_worker_t * wrk) pool_put (vcm->workers, wrk); } +int +vcl_api_app_worker_add (void) +{ + if (vcm->cfg.vpp_app_socket_api) + return vcl_sapi_app_worker_add (); + + return vcl_bapi_app_worker_add (); +} + +void +vcl_api_app_worker_del (vcl_worker_t * wrk) +{ + if (vcm->cfg.vpp_app_socket_api) + return vcl_sapi_app_worker_del (wrk); + + vcl_bapi_app_worker_del (wrk); +} + void vcl_worker_cleanup (vcl_worker_t * wrk, u8 notify_vpp) { clib_spinlock_lock (&vcm->workers_lock); if (notify_vpp) - vcl_bapi_app_worker_del (wrk); + vcl_api_app_worker_del (wrk); if (wrk->mqs_epfd > 0) close (wrk->mqs_epfd); @@ -184,7 +202,7 @@ vcl_worker_register_with_vpp (void) clib_spinlock_lock (&vcm->workers_lock); - if (vcl_bapi_app_worker_add ()) + if (vcl_api_app_worker_add ()) { VDBG (0, "failed to add worker to vpp"); clib_spinlock_unlock (&vcm->workers_lock); |