X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fsession%2Fapplication.c;h=b58e73eb4f8969f3991d743fc827b549f2a4902b;hb=2179513b71963a0b42ca6f1f2b641e79ce89447b;hp=8cf32896631799b51a48d7069751f701258030f5;hpb=ab2f6dbf9f7b7164a9810f4c80c8abf8463e42ad;p=vpp.git diff --git a/src/vnet/session/application.c b/src/vnet/session/application.c index 8cf32896631..b58e73eb4f8 100644 --- a/src/vnet/session/application.c +++ b/src/vnet/session/application.c @@ -762,10 +762,12 @@ application_start_listen (application_t * app, sep_ext->is_ip4); ls = listen_session_new (0, sst); ls->app_index = app->app_index; - + lh = listen_session_get_handle (ls); if (session_listen (ls, sep_ext)) goto err; + + ls = listen_session_get_from_handle (lh); app_listener = app_listener_alloc (app); ls->listener_db_index = app_listener->al_index; @@ -779,7 +781,7 @@ application_start_listen (application_t * app, app_listener->workers = clib_bitmap_set (app_listener->workers, app_wrk->wrk_map_index, 1); - *res = listen_session_get_handle (ls); + *res = lh; return 0; err: @@ -1317,9 +1319,8 @@ static app_send_evt_handler_fn * const app_send_evt_handler_fns[3] = { /** * Send event to application * - * Logic from queue perspective is non-blocking. That is, if there's - * not enough space to enqueue a message, we return. However, if the lock - * flag is set, we do wait for queue mutex. + * Logic from queue perspective is non-blocking. If there's + * not enough space to enqueue a message, we return. */ int app_worker_send_event (app_worker_t * app, stream_session_t * s, u8 evt_type) @@ -1328,6 +1329,12 @@ app_worker_send_event (app_worker_t * app, stream_session_t * s, u8 evt_type) return app_send_evt_handler_fns[evt_type] (app, s, 0 /* lock */ ); } +/** + * Send event to application + * + * Logic from queue perspective is blocking. However, if queue is full, + * we return. + */ int app_worker_lock_and_send_event (app_worker_t * app, stream_session_t * s, u8 evt_type) @@ -1924,9 +1931,10 @@ format_app_worker_listener (u8 * s, va_list * args) if (verbose) { - s = format (s, "%-40s%-25s%=10u%-15u%-15u%-10u", str, app_name, - app_wrk->wrk_map_index, app->api_client_index, handle, - sm_index); + char buf[32]; + sprintf (buf, "%u(%u)", app_wrk->wrk_map_index, app_wrk->wrk_index); + s = format (s, "%-40s%-25s%=10s%-15u%-15u%-10u", str, app_name, + buf, app->api_client_index, handle, sm_index); } else s = format (s, "%-40s%-25s%=10u", str, app_name, app_wrk->wrk_map_index);