diff options
author | Florin Coras <fcoras@cisco.com> | 2019-02-27 07:55:46 -0800 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2019-03-01 11:51:53 +0000 |
commit | 2b81e3cba77e6427b47228318d55e40a859d02d1 (patch) | |
tree | 8034c15966f8fe40a87dbcddbbb67aa0864e9a7c /src/vnet/session/segment_manager.c | |
parent | 038243064ba0a6b587213ba56fffd9e3fddcf0ee (diff) |
session: refactor local connects
- Switches local connects to cut-thru transport
- Removes local sessions as a separate session type
Change-Id: I997c6355d8c8e4f2110678f785b0f5d96bba47f7
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/segment_manager.c')
-rw-r--r-- | src/vnet/session/segment_manager.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/vnet/session/segment_manager.c b/src/vnet/session/segment_manager.c index 8e6c2818a20..63af299e9a8 100644 --- a/src/vnet/session/segment_manager.c +++ b/src/vnet/session/segment_manager.c @@ -16,7 +16,6 @@ #include <vnet/session/segment_manager.h> #include <vnet/session/session.h> #include <vnet/session/application.h> -#include <vnet/session/application_local.h> segment_manager_main_t segment_manager_main; @@ -380,6 +379,7 @@ void segment_manager_del_sessions (segment_manager_t * sm) { svm_fifo_segment_private_t *fifo_segment; + session_handle_t *handles = 0, *handle; session_t *session; svm_fifo_t *fifo; @@ -398,16 +398,11 @@ segment_manager_del_sessions (segment_manager_t * sm) while (fifo) { if (fifo->ct_session_index != SVM_FIFO_INVALID_SESSION_INDEX) - { - svm_fifo_t *next = fifo->next; - app_worker_local_session_disconnect_w_index (sm->app_wrk_index, - fifo->ct_session_index); - fifo = next; - continue; - } - session = session_get (fifo->master_session_index, - fifo->master_thread_index); - session_close (session); + session = session_get (fifo->ct_session_index, 0); + else + session = session_get (fifo->master_session_index, + fifo->master_thread_index); + vec_add1 (handles, session_handle (session)); fifo = fifo->next; } @@ -416,6 +411,9 @@ segment_manager_del_sessions (segment_manager_t * sm) */ })); /* *INDENT-ON* */ + + vec_foreach (handle, handles) + session_close (session_get_from_handle (*handle)); } /** @@ -553,9 +551,10 @@ alloc_check: if (added_a_segment) { + app_worker_t *app_wrk; segment_handle = segment_manager_segment_handle (sm, fifo_segment); - rv = app_worker_add_segment_notify (sm->app_wrk_index, - segment_handle); + app_wrk = app_worker_get (sm->app_wrk_index); + rv = app_worker_add_segment_notify (app_wrk, segment_handle); } /* Drop the lock after app is notified */ segment_manager_segment_reader_unlock (sm); |