diff options
author | Florin Coras <fcoras@cisco.com> | 2020-12-08 17:50:45 -0800 |
---|---|---|
committer | Florin Coras <fcoras@cisco.com> | 2020-12-24 23:08:43 -0800 |
commit | c547e91df7083007c87615ac1e37b6f223e575e9 (patch) | |
tree | 0677e843f5307becf326c14d43d57c0e4b8c3329 /src/vnet/session/segment_manager.c | |
parent | 8219f1f361083cc63022b70d11b08f52833d4789 (diff) |
svm: split fifo into private and shared structs
Type: improvement
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Id8e77e8b2623be719fd43a95e181eaa5b7df2b6e
Diffstat (limited to 'src/vnet/session/segment_manager.c')
-rw-r--r-- | src/vnet/session/segment_manager.c | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/src/vnet/session/segment_manager.c b/src/vnet/session/segment_manager.c index bb3d7adc379..7683760fde9 100644 --- a/src/vnet/session/segment_manager.c +++ b/src/vnet/session/segment_manager.c @@ -211,6 +211,7 @@ segment_manager_del_segment (segment_manager_t * sm, fifo_segment_t * fs) } } + fifo_segment_cleanup (fs); ssvm_delete (&fs->ssvm); if (CLIB_DEBUG) @@ -612,12 +613,12 @@ segment_manager_del_sessions (segment_manager_t * sm) */ while (f) { - session = session_get_if_valid (f->master_session_index, - f->master_thread_index); - if (session) - vec_add1 (handles, session_handle (session)); - f = f->next; - } + session = session_get_if_valid (f->shr->master_session_index, + f->master_thread_index); + if (session) + vec_add1 (handles, session_handle (session)); + f = f->next; + } } /* Instead of removing the segment, test when cleaning up disconnected @@ -841,7 +842,7 @@ segment_manager_attach_fifo (segment_manager_t * sm, svm_fifo_t * f, fifo_segment_attach_fifo (fs, f, s->thread_index); segment_manager_segment_reader_unlock (sm); - f->master_session_index = s->session_index; + f->shr->master_session_index = s->session_index; f->master_thread_index = s->thread_index; } @@ -1059,25 +1060,26 @@ segment_manager_format_sessions (segment_manager_t * sm, int verbose) u32 session_index, thread_index; session_t *session; - session_index = f->master_session_index; - thread_index = f->master_thread_index; + session_index = f->shr->master_session_index; + thread_index = f->master_thread_index; - session = session_get (session_index, thread_index); - str = format (0, "%U", format_session, session, verbose); + session = session_get (session_index, thread_index); + str = format (0, "%U", format_session, session, verbose); - if (verbose) - s = format (s, "%-40v%-20v%-15u%-10u", str, app_name, - app_wrk->api_client_index, app_wrk->connects_seg_manager); - else - s = format (s, "%-40v%-20v", str, app_name); + if (verbose) + s = format (s, "%-40v%-20v%-15u%-10u", str, app_name, + app_wrk->api_client_index, + app_wrk->connects_seg_manager); + else + s = format (s, "%-40v%-20v", str, app_name); - vlib_cli_output (vm, "%v", s); - vec_reset_length (s); - vec_free (str); + vlib_cli_output (vm, "%v", s); + vec_reset_length (s); + vec_free (str); - f = f->next; - } - vec_free (s); + f = f->next; + } + vec_free (s); } } /* *INDENT-ON* */ |