aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2022-03-09 13:55:38 -0800
committerDamjan Marion <dmarion@me.com>2022-03-18 20:05:42 +0000
commit53d8d4fd625c21777d11172dac9ea3aa6602edd0 (patch)
tree01574fab5f77c6d0175632ed74ffb665050d11b8 /src/vnet/session/session.c
parentc8e4110cd10ea36c996eff6e30cc9116896b4adf (diff)
session: add infra for safe pool reallocs
This is not to be used lightly. The idea is to forces pool reallocs to be done only on main thread with a barrier to make sure pools are always reallocated without peekers/readers. If rpcs are delayed and the pool runs out of elements, workers will block waiting for barrier and force the realloc. Consumers of this api should be session layer and transports. Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I533272a29534338935a3fcf7027c0e7af2ca948c
Diffstat (limited to 'src/vnet/session/session.c')
-rw-r--r--src/vnet/session/session.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index 2a5d13d57c5..60991cdd8d0 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -1887,6 +1887,7 @@ session_manager_main_enable (vlib_main_t * vm)
/* Allocate cache line aligned worker contexts */
vec_validate_aligned (smm->wrk, num_threads - 1, CLIB_CACHE_LINE_BYTES);
+ clib_spinlock_init (&session_main.pool_realloc_lock);
for (i = 0; i < num_threads; i++)
{