diff options
author | Florin Coras <fcoras@cisco.com> | 2022-06-01 14:44:11 -0700 |
---|---|---|
committer | Florin Coras <fcoras@cisco.com> | 2022-06-01 14:56:15 -0700 |
commit | 512223490a247d792c27f3bfe6ffe49e6dfb71fa (patch) | |
tree | 77a86f3122c849c90fab6aa3279b3670321f2e41 | |
parent | 082dc14b4a32e2b04d04c5ef223486d381dda84c (diff) |
session: make sure fifos are freed on right thread
Type: improvement
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I3c573641bd95fe899823b66f6c59a2525a18d293
-rw-r--r-- | src/vnet/session/segment_manager.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vnet/session/segment_manager.c b/src/vnet/session/segment_manager.c index e72e833f53c..14e4e219996 100644 --- a/src/vnet/session/segment_manager.c +++ b/src/vnet/session/segment_manager.c @@ -856,6 +856,10 @@ segment_manager_dealloc_fifos (svm_fifo_t * rx_fifo, svm_fifo_t * tx_fifo) if (!rx_fifo || !tx_fifo) return; + /* Thread that allocated the fifos must be the one to clean them up */ + ASSERT (rx_fifo->master_thread_index == vlib_get_thread_index () || + rx_fifo->refcnt > 1); + /* It's possible to have no segment manager if the session was removed * as result of a detach. */ if (!(sm = segment_manager_get_if_valid (rx_fifo->segment_manager))) |