diff options
author | Florin Coras <fcoras@cisco.com> | 2020-04-09 01:49:45 +0000 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2020-04-09 19:36:28 +0000 |
commit | 6d7552ca885fe385818d380d7e0b4aff03c59d83 (patch) | |
tree | 198460faf9bcb77802e8d3418f684cbe441db7e5 /src/vnet/session/segment_manager.c | |
parent | 98c2348b5cf9669c9698b9fdd31ae653081e9180 (diff) |
session: update fifo slice on session migration
Type: fix
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ic5fb0f95c58ad70925a365004fe911ac8f2d2382
Diffstat (limited to 'src/vnet/session/segment_manager.c')
-rw-r--r-- | src/vnet/session/segment_manager.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/vnet/session/segment_manager.c b/src/vnet/session/segment_manager.c index 716f2a39a4e..b40675ad56f 100644 --- a/src/vnet/session/segment_manager.c +++ b/src/vnet/session/segment_manager.c @@ -743,6 +743,30 @@ segment_manager_dealloc_fifos (svm_fifo_t * rx_fifo, svm_fifo_t * tx_fifo) segment_manager_segment_reader_unlock (sm); } +void +segment_manager_detach_fifo (segment_manager_t * sm, svm_fifo_t * f) +{ + fifo_segment_t *fs; + + fs = segment_manager_get_segment_w_lock (sm, f->segment_index); + fifo_segment_detach_fifo (fs, f); + segment_manager_segment_reader_unlock (sm); +} + +void +segment_manager_attach_fifo (segment_manager_t * sm, svm_fifo_t * f, + session_t * s) +{ + fifo_segment_t *fs; + + fs = segment_manager_get_segment_w_lock (sm, f->segment_index); + fifo_segment_attach_fifo (fs, f, s->thread_index); + segment_manager_segment_reader_unlock (sm); + + f->master_session_index = s->session_index; + f->master_thread_index = s->thread_index; +} + u32 segment_manager_evt_q_expected_size (u32 q_len) { |