X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fsession%2Fsession.c;h=caa362e1f1d091f74a543d88be8e9468626dd4c8;hb=7357043d2abc8d3811362f256e7c9086e7b0d378;hp=1fa787217f305c596543f9b0d1f5b1c91de95c16;hpb=6d7552ca885fe385818d380d7e0b4aff03c59d83;p=vpp.git diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c index 1fa787217f3..caa362e1f1d 100644 --- a/src/vnet/session/session.c +++ b/src/vnet/session/session.c @@ -25,6 +25,10 @@ session_main_t session_main; +#if SESSION_DEBUG +session_dbg_main_t session_dbg_main; +#endif + static inline int session_send_evt_to_thread (void *data, void *args, u32 thread_index, session_evt_type_t evt_type) @@ -1104,7 +1108,10 @@ session_stream_accept (transport_connection_t * tc, u32 listener_index, s->session_state = SESSION_STATE_CREATED; if ((rv = app_worker_init_accepted (s))) - return rv; + { + session_free (s); + return rv; + } session_lookup_add_connection (tc, session_handle (s)); @@ -1112,7 +1119,13 @@ session_stream_accept (transport_connection_t * tc, u32 listener_index, if (notify) { app_worker_t *app_wrk = app_worker_get (s->app_wrk_index); - return app_worker_accept_notify (app_wrk, s); + if ((rv = app_worker_accept_notify (app_wrk, s))) + { + session_lookup_del_session (s); + segment_manager_dealloc_fifos (s->rx_fifo, s->tx_fifo); + session_free (s); + return rv; + } } return 0; @@ -1138,7 +1151,8 @@ session_dgram_accept (transport_connection_t * tc, u32 listener_index, app_wrk = app_worker_get (s->app_wrk_index); if ((rv = app_worker_accept_notify (app_wrk, s))) { - session_free_w_fifos (s); + segment_manager_dealloc_fifos (s->rx_fifo, s->tx_fifo); + session_free (s); return rv; } @@ -1695,6 +1709,17 @@ session_manager_main_enable (vlib_main_t * vm) /* Enable transports */ transport_enable_disable (vm, 1); + +#if SESSION_DEBUG + session_dbg_main_t *sdm = &session_dbg_main; + vec_validate_aligned (sdm->wrk, num_threads - 1, CLIB_CACHE_LINE_BYTES); + int thread; + for (thread = 0; thread < num_threads; thread++) + { + clib_memset (&sdm->wrk[thread], 0, sizeof (session_dbg_evts_t)); + } +#endif /* SESSION_DEBUG */ + return 0; }