aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-04-13 23:35:55 +0000
committerDave Barach <openvpp@barachs.net>2020-04-14 14:44:50 +0000
commit1bd461615f31022a7b721990b09b1dcdd543b339 (patch)
tree5d8bd1e796a691b265b2ba12642b019ca856c36c
parentd724e4f43b1d143a3f35492bce72fdc3e8af553e (diff)
session: avoid all session cleanup on unlisten
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ifff49366ad538bf2dd64487cae17e7457dff064f
-rw-r--r--src/vnet/session/application_worker.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/vnet/session/application_worker.c b/src/vnet/session/application_worker.c
index a3dc32a5b1e..47b156732ef 100644
--- a/src/vnet/session/application_worker.c
+++ b/src/vnet/session/application_worker.c
@@ -230,24 +230,22 @@ app_worker_stop_listen_session (app_worker_t * app_wrk, session_t * ls)
if (PREDICT_FALSE (!sm_indexp))
return;
- /* Dealloc fifos first, if any, to avoid cleanup attempt lower */
+ /* Dealloc fifos, if any (dgram listeners) */
if (ls->rx_fifo)
{
segment_manager_dealloc_fifos (ls->rx_fifo, ls->tx_fifo);
ls->tx_fifo = ls->rx_fifo = 0;
}
+ /* Try to cleanup segment manager */
sm = segment_manager_get (*sm_indexp);
- if (app_wrk->first_segment_manager == *sm_indexp)
+ if (sm && app_wrk->first_segment_manager != *sm_indexp)
{
- /* Delete sessions but don't remove segment manager */
- app_wrk->first_segment_manager_in_use = 0;
- segment_manager_del_sessions (sm);
- }
- else
- {
- segment_manager_init_free (sm);
+ segment_manager_app_detach (sm);
+ if (!segment_manager_has_fifos (sm))
+ segment_manager_free (sm);
}
+
hash_unset (app_wrk->listeners_table, handle);
}