aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/buffer.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2024-01-19 21:19:57 +0100
committerFlorin Coras <florin.coras@gmail.com>2024-01-20 18:28:09 +0000
commit038dad7ef29b0b724071edb5f8cc7a9845584454 (patch)
treefd49f72aa41a215b73be0409dc1f512e1f82bef2 /src/vlib/buffer.c
parent5840c66bbc15b265e280997b028442f9fedd92f6 (diff)
buffers: add compile-time option to set buffer alignment
Type: improvement Change-Id: I88c4c45bed0bdd8686e17e4f77a7d32a08c995aa Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib/buffer.c')
-rw-r--r--src/vlib/buffer.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/vlib/buffer.c b/src/vlib/buffer.c
index 005326d3906..82fe6412781 100644
--- a/src/vlib/buffer.c
+++ b/src/vlib/buffer.c
@@ -471,11 +471,7 @@ static uword
vlib_buffer_alloc_size (uword ext_hdr_size, uword data_size)
{
uword alloc_size = ext_hdr_size + sizeof (vlib_buffer_t) + data_size;
- alloc_size = CLIB_CACHE_LINE_ROUND (alloc_size);
-
- /* in case when we have even number of cachelines, we add one more for
- * better cache occupancy */
- alloc_size |= CLIB_CACHE_LINE_BYTES;
+ alloc_size = round_pow2 (alloc_size, VLIB_BUFFER_ALIGN);
return alloc_size;
}