aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/segment_manager.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2021-01-09 14:34:01 -0800
committerFlorin Coras <fcoras@cisco.com>2021-01-09 18:50:08 -0800
commit0bc78d80363efc22d07171473933d1b0016440e4 (patch)
tree702dbe373faf878da86d5016f28f287175d692f5 /src/vnet/session/segment_manager.c
parentb716e3836c90bc90642076b6d895ad7c9c00fa9a (diff)
session svm: fix fifo migration
Allocate and attach a new pair of private fifos in the right private slice when a session is cloned. This ensures that private fifos are not shared between workers. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ib700d18104d2ca79aa8a07434cdcdcab0bef13a5
Diffstat (limited to 'src/vnet/session/segment_manager.c')
-rw-r--r--src/vnet/session/segment_manager.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/vnet/session/segment_manager.c b/src/vnet/session/segment_manager.c
index 2d20d9cc1e4..61108326abc 100644
--- a/src/vnet/session/segment_manager.c
+++ b/src/vnet/session/segment_manager.c
@@ -800,27 +800,27 @@ segment_manager_dealloc_fifos (svm_fifo_t * rx_fifo, svm_fifo_t * tx_fifo)
}
void
-segment_manager_detach_fifo (segment_manager_t * sm, svm_fifo_t * f)
+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);
+ 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)
+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);
+ 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->shr->master_session_index = s->session_index;
- f->master_thread_index = s->thread_index;
+ (*f)->shr->master_session_index = s->session_index;
+ (*f)->master_thread_index = s->thread_index;
}
u32