diff options
author | Florin Coras <fcoras@cisco.com> | 2018-01-31 06:52:17 -0800 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2018-02-05 21:45:28 +0000 |
commit | a332c46a51f9b4e13963340dfee1318e7513c124 (patch) | |
tree | fde1056972c5b164987bd15ce0530a3d48d1bbd7 /src/vnet/session/session.c | |
parent | e71eb5922a293eca36dbd323970741daaca3c5c7 (diff) |
session: segment manager refactor
- use valloc as a 'central' segment baseva manager
- use per segment manager segment pools and use rwlocks to guard them
- add session test that exercises segment creation
- embed segment manager properties into application since they're shared
- fix rw locks
Change-Id: I761164c147275d9e8a926f1eda395e090d231f9a
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/session.c')
-rw-r--r-- | src/vnet/session/session.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c index ae8c42aa32b..de3cbc57d66 100644 --- a/src/vnet/session/session.c +++ b/src/vnet/session/session.c @@ -1115,6 +1115,7 @@ listen_session_get_local_session_endpoint (stream_session_t * listener, static clib_error_t * session_manager_main_enable (vlib_main_t * vm) { + segment_manager_main_init_args_t _sm_args = { 0 }, *sm_args = &_sm_args; session_manager_main_t *smm = &session_manager_main; vlib_thread_main_t *vtm = vlib_get_thread_main (); u32 num_threads; @@ -1162,8 +1163,9 @@ session_manager_main_enable (vlib_main_t * vm) session_vpp_event_queues_allocate (smm); /* Initialize fifo segment main baseva and timeout */ - svm_fifo_segment_init (smm->session_baseva + smm->evt_qs_segment_size, - smm->segment_timeout); + sm_args->baseva = smm->session_baseva + smm->evt_qs_segment_size; + sm_args->size = smm->session_va_space_size; + segment_manager_main_init (sm_args); /* Preallocate sessions */ if (smm->preallocated_sessions) @@ -1237,7 +1239,7 @@ session_manager_main_init (vlib_main_t * vm) { session_manager_main_t *smm = &session_manager_main; smm->session_baseva = 0x200000000ULL; - smm->segment_timeout = 20; + smm->session_va_space_size = (u64) 128 << 30; smm->evt_qs_segment_size = 64 << 20; smm->is_enabled = 0; return 0; |