From ec315bf7b4e622b6a6cd059ac7ca7f5495e3c11b Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Tue, 5 Apr 2022 15:53:31 -0700 Subject: srtp: use safe pool reallocs Type: improvement Signed-off-by: Florin Coras Change-Id: I15fea1f90640ea54cafe3ea929e871ec6e86fc67 --- src/plugins/srtp/srtp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/plugins/srtp/srtp.c b/src/plugins/srtp/srtp.c index c9987e8a47f..36f4628aa0c 100644 --- a/src/plugins/srtp/srtp.c +++ b/src/plugins/srtp/srtp.c @@ -26,7 +26,9 @@ static inline u32 srtp_ctx_alloc_w_thread (u32 thread_index) { srtp_tc_t *ctx; - pool_get_zero (srtp_main.ctx_pool[thread_index], ctx); + pool_get_aligned_safe (srtp_main.ctx_pool[thread_index], ctx, + CLIB_CACHE_LINE_BYTES); + clib_memset (ctx, 0, sizeof (*ctx)); ctx->c_thread_index = thread_index; ctx->srtp_ctx_handle = ctx - srtp_main.ctx_pool[thread_index]; ctx->app_session_handle = SESSION_INVALID_HANDLE; @@ -84,7 +86,8 @@ srtp_ctx_attach (u32 thread_index, void *ctx_ptr) { srtp_tc_t *ctx; - pool_get (srtp_main.ctx_pool[thread_index], ctx); + pool_get_aligned_safe (srtp_main.ctx_pool[thread_index], ctx, + CLIB_CACHE_LINE_BYTES); clib_memcpy (ctx, ctx_ptr, sizeof (*ctx)); ctx->c_thread_index = thread_index; -- cgit 1.2.3-korg