diff options
author | Florin Coras <fcoras@cisco.com> | 2019-11-28 14:21:21 -0800 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2019-12-11 19:26:27 +0000 |
commit | d4c709222b67f6c45ee7064637f69de9e9509222 (patch) | |
tree | 364288596630120840ec37dc6df3fd23b94cf7dd /src/vcl/vppcom.c | |
parent | 0aa4013e20471a7b23bc3252649c95c81b5d7519 (diff) |
vcl: separate binary api connections per thread worker
Type: fix
Change-Id: I2d72efc74a3b0a5b9e4da265475b1b01bf361125
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vcl/vppcom.c')
-rw-r--r-- | src/vcl/vppcom.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c index 0bbdea54940..ce47766b5c9 100644 --- a/src/vcl/vppcom.c +++ b/src/vcl/vppcom.c @@ -1055,7 +1055,6 @@ vppcom_app_create (char *app_name) vcl_worker_alloc_and_init (); /* API hookup and connect to VPP */ - vppcom_api_hookup (); vcl_elog_init (vcm); vcm->app_state = STATE_APP_START; rv = vppcom_connect_to_vpp (app_name); @@ -3590,11 +3589,21 @@ vppcom_session_worker (vcl_session_handle_t session_handle) int vppcom_worker_register (void) { + vcl_worker_t *wrk; + u8 *wrk_name = 0; + int rv; + if (!vcl_worker_alloc_and_init ()) return VPPCOM_EEXIST; - if (vcl_worker_set_bapi ()) - return VPPCOM_EEXIST; + wrk = vcl_worker_get_current (); + wrk_name = format (0, "%s-wrk-%u", vcm->app_name, wrk->wrk_index); + + rv = vppcom_connect_to_vpp ((char *) wrk_name); + vec_free (wrk_name); + + if (rv) + return VPPCOM_EFAULT; if (vcl_worker_register_with_vpp ()) return VPPCOM_EEXIST; |