From 53d8d4fd625c21777d11172dac9ea3aa6602edd0 Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Wed, 9 Mar 2022 13:55:38 -0800 Subject: 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 Change-Id: I533272a29534338935a3fcf7027c0e7af2ca948c --- src/vnet/session/session.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/vnet/session/session.c') 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++) { -- cgit 1.2.3-korg