summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2022-03-15 16:27:43 -0700
committerDamjan Marion <dmarion@me.com>2022-04-04 22:30:17 +0000
commitb01873208bd6201e83f806699ad11dfb5ee2939e (patch)
treecfcad445ec8720bd237ffb95f8772910022aa5b1 /src
parent72c04bb7df6b6dda1ba8274a028e7a3811c17903 (diff)
tcp: use safe realloc pool
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I8ba93643236aaa50eeb4755b74821a8c4ca6179b
Diffstat (limited to 'src')
-rw-r--r--src/vnet/tcp/tcp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c
index d97fafa6f24..09913fa1242 100644
--- a/src/vnet/tcp/tcp.c
+++ b/src/vnet/tcp/tcp.c
@@ -293,7 +293,7 @@ tcp_connection_alloc (u8 thread_index)
tcp_worker_ctx_t *wrk = tcp_get_worker (thread_index);
tcp_connection_t *tc;
- pool_get (wrk->connections, tc);
+ pool_get_aligned_safe (wrk->connections, tc, CLIB_CACHE_LINE_BYTES);
clib_memset (tc, 0, sizeof (*tc));
tc->c_c_index = tc - wrk->connections;
tc->c_thread_index = thread_index;
@@ -310,12 +310,12 @@ tcp_connection_alloc_w_base (u8 thread_index, tcp_connection_t **base)
if ((*base)->c_thread_index == thread_index)
{
u32 base_index = (*base)->c_c_index;
- pool_get (wrk->connections, tc);
+ pool_get_aligned_safe (wrk->connections, tc, CLIB_CACHE_LINE_BYTES);
*base = tcp_connection_get (base_index, thread_index);
}
else
{
- pool_get (wrk->connections, tc);
+ pool_get_aligned_safe (wrk->connections, tc, CLIB_CACHE_LINE_BYTES);
}
clib_memcpy_fast (tc, *base, sizeof (*tc));
tc->c_c_index = tc - wrk->connections;