summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-10-25 14:00:29 -0700
committerDamjan Marion <dmarion@me.com>2020-10-26 15:24:32 +0000
commite10da62bd6341f214264006b4196281299c66b62 (patch)
treeedaf3e4ee85f3ba850aba18e3db79a0c8d25a9d8 /src/vnet/session/session.c
parenta8375082a29af68fbaf853f29bc7e20d812c9e5f (diff)
session: fix feature disable
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I69e912ddf64d8ec89f8d93e02a201781b99de0bd
Diffstat (limited to 'src/vnet/session/session.c')
-rw-r--r--src/vnet/session/session.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index 6413da51f3b..18850cc1ba2 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -1665,6 +1665,10 @@ session_manager_main_enable (vlib_main_t * vm)
session_worker_t *wrk;
int i;
+ /* We only initialize once and do not de-initialized on disable */
+ if (smm->is_initialized)
+ goto done;
+
num_threads = 1 /* main thread */ + vtm->n_threads;
if (num_threads < 1)
@@ -1721,6 +1725,9 @@ session_manager_main_enable (vlib_main_t * vm)
session_lookup_init ();
app_namespaces_init ();
transport_init ();
+ smm->is_initialized = 1;
+
+done:
smm->is_enabled = 1;
@@ -1731,6 +1738,12 @@ session_manager_main_enable (vlib_main_t * vm)
return 0;
}
+static void
+session_manager_main_disable (vlib_main_t * vm)
+{
+ transport_enable_disable (vm, 0 /* is_en */ );
+}
+
void
session_node_enable_disable (u8 is_en)
{
@@ -1742,10 +1755,10 @@ session_node_enable_disable (u8 is_en)
foreach_vlib_main (({
if (have_workers && ii == 0)
{
- vlib_node_set_state (this_vlib_main, session_queue_process_node.index,
- state);
if (is_en)
{
+ vlib_node_set_state (this_vlib_main,
+ session_queue_process_node.index, state);
vlib_node_t *n = vlib_get_node (this_vlib_main,
session_queue_process_node.index);
vlib_start_process (this_vlib_main, n->runtime_index);
@@ -1780,6 +1793,7 @@ vnet_session_enable_disable (vlib_main_t * vm, u8 is_en)
else
{
session_main.is_enabled = 0;
+ session_manager_main_disable (vm);
session_node_enable_disable (is_en);
}