buffers: add compile-time option to set buffer alignment
Type: improvement Change-Id: I88c4c45bed0bdd8686e17e4f77a7d32a08c995aa Signed-off-by: Damjan Marion <damarion@cisco.com>
This commit is contained in:

committed by
Florin Coras

parent
5840c66bbc
commit
038dad7ef2
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user