diff options
author | Florin Coras <fcoras@cisco.com> | 2020-11-08 18:04:33 -0800 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2020-11-09 21:19:29 +0000 |
commit | 165f3ae9670c98259677155bd04e92fe5830daa7 (patch) | |
tree | 90a18c0aa2ddaed3bdaa411b65bd0df424d69663 /src/vcl/vcl_bapi.c | |
parent | 6c10ab22e9ae1b5b2e086d74a5267f0bc33a0c57 (diff) |
vcl: remove support for shm api connections
Session layer only supports bapi with socket transport or app socket api
attachements. Going forward this will be further restricted to the
latter.
Type: improvement
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ib368cf2ce92bbca192cca977664800879cd4058e
Diffstat (limited to 'src/vcl/vcl_bapi.c')
-rw-r--r-- | src/vcl/vcl_bapi.c | 53 |
1 files changed, 18 insertions, 35 deletions
diff --git a/src/vcl/vcl_bapi.c b/src/vcl/vcl_bapi.c index 2e17dab6887..06947c620b8 100644 --- a/src/vcl/vcl_bapi.c +++ b/src/vcl/vcl_bapi.c @@ -473,47 +473,30 @@ vcl_bapi_connect_to_vpp (void) vcl_bapi_cleanup (); vlibapi_set_main (&wrk->bapi_api_ctx); - vlibapi_set_memory_client_main (&wrk->bapi_shm_ctx); vcl_bapi_hookup (); - if (vcl_cfg->vpp_bapi_socket_name) + if (!vcl_cfg->vpp_bapi_socket_name) { - if (vl_socket_client_connect2 (&wrk->bapi_sock_ctx, - (char *) vcl_cfg->vpp_bapi_socket_name, - (char *) wrk_name, - 0 /* default rx/tx buffer */ )) - { - VERR ("app (%s) socket connect failed!", wrk_name); - rv = VPPCOM_ECONNREFUSED; - goto error; - } - - if (vl_socket_client_init_shm2 (&wrk->bapi_sock_ctx, 0, - 1 /* want_pthread */ )) - { - VERR ("app (%s) init shm failed!", wrk_name); - rv = VPPCOM_ECONNREFUSED; - goto error; - } + rv = VPPCOM_EINVAL; + goto error; } - else - { - if (!vcl_cfg->vpp_bapi_filename) - vcl_cfg->vpp_bapi_filename = format (0, "/vpe-api%c", 0); - - vl_set_memory_root_path ((char *) vcl_cfg->vpp_bapi_chroot); - VDBG (0, "app (%s) connecting to VPP api (%s)...", - wrk_name, vcl_cfg->vpp_bapi_filename); + if (vl_socket_client_connect2 (&wrk->bapi_sock_ctx, + (char *) vcl_cfg->vpp_bapi_socket_name, + (char *) wrk_name, + 0 /* default rx/tx buffer */ )) + { + VERR ("app (%s) socket connect failed!", wrk_name); + rv = VPPCOM_ECONNREFUSED; + goto error; + } - if (vl_client_connect_to_vlib ((char *) vcl_cfg->vpp_bapi_filename, - (char *) wrk_name, - vcm->cfg.vpp_api_q_length) < 0) - { - VERR ("app (%s) connect failed!", wrk_name); - rv = VPPCOM_ECONNREFUSED; - goto error; - } + if (vl_socket_client_init_shm2 (&wrk->bapi_sock_ctx, 0, + 1 /* want_pthread */ )) + { + VERR ("app (%s) init shm failed!", wrk_name); + rv = VPPCOM_ECONNREFUSED; + goto error; } am = vlibapi_get_main (); |