aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/session/session.c')
-rw-r--r--src/vnet/session/session.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index 5cd840bd834..163f4d2a6a6 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -1609,10 +1609,25 @@ session_manager_main_init (vlib_main_t * vm)
smm->evt_qs_segment_size = 1 << 20;
#endif
smm->is_enabled = 0;
+ smm->session_enable_asap = 0;
+ return 0;
+}
+
+static clib_error_t *
+session_main_init (vlib_main_t * vm)
+{
+ session_main_t *smm = &session_main;
+ if (smm->session_enable_asap)
+ {
+ vlib_worker_thread_barrier_sync (vm);
+ vnet_session_enable_disable (vm, 1 /* is_en */ );
+ vlib_worker_thread_barrier_release (vm);
+ }
return 0;
}
VLIB_INIT_FUNCTION (session_manager_main_init);
+VLIB_MAIN_LOOP_ENTER_FUNCTION (session_main_init);
static clib_error_t *
session_config_fn (vlib_main_t * vm, unformat_input_t * input)
@@ -1694,7 +1709,7 @@ session_config_fn (vlib_main_t * vm, unformat_input_t * input)
&smm->evt_qs_segment_size))
;
else if (unformat (input, "enable"))
- vnet_session_enable_disable (vm, 1 /* is_en */ );
+ smm->session_enable_asap = 1;
else
return clib_error_return (0, "unknown input `%U'",
format_unformat_error, input);