diff options
author | Andrew Yourtchenko <ayourtch@gmail.com> | 2018-01-16 16:33:28 +0100 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2018-01-16 23:40:06 +0000 |
commit | 798502f3d065472d235f9bea1b617fc30c675839 (patch) | |
tree | 6ab1205fec191bc006253126c90da51e86ab8db0 /src/plugins | |
parent | 0e7c5f55f4f1304744e561ad7d613f39f8d2b64e (diff) |
acl-plugin: multicore: use pool_init_fixed for per-worker preallocated pools
One worker thread may be processing the packets
for session owned by another worker thread.
During session access the validity of the pool
index is checked - however, the free bitmap pointer
might change just at that moment, potentially resulting
in a crash.
Thus, use the pool_init_fixed() when initializing the per-worker pools,
so that the free bitmaps are as well staying in their place.
Change-Id: I5796e6b62fdc1efd4299124a388b84a7c0dc19cd
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/acl/fa_node.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/acl/fa_node.c b/src/plugins/acl/fa_node.c index 59eb9dfcb52..5fa45098559 100644 --- a/src/plugins/acl/fa_node.c +++ b/src/plugins/acl/fa_node.c @@ -644,7 +644,13 @@ acl_fa_verify_init_sessions (acl_main_t * am) /* Allocate the per-worker sessions pools */ for (wk = 0; wk < vec_len (am->per_worker_data); wk++) { acl_fa_per_worker_data_t *pw = &am->per_worker_data[wk]; - pool_alloc_aligned(pw->fa_sessions_pool, am->fa_conn_table_max_entries, CLIB_CACHE_LINE_BYTES); + + /* + * // In lieu of trying to preallocate the pool and its free bitmap, rather use pool_init_fixed + * pool_alloc_aligned(pw->fa_sessions_pool, am->fa_conn_table_max_entries, CLIB_CACHE_LINE_BYTES); + * clib_bitmap_validate(pool_header(pw->fa_sessions_pool)->free_bitmap, am->fa_conn_table_max_entries); + */ + pool_init_fixed(pw->fa_sessions_pool, am->fa_conn_table_max_entries); } /* ... and the interface session hash table */ |