buffers: introduce vlib_buffer_template_t

Type: improvement
Change-Id: Ie86a5edf2ada21355543e9a0382052b16ff86927
Signed-off-by: Damjan Marion <damarion@cisco.com>
This commit is contained in:
Damjan Marion
2023-10-13 09:59:00 +00:00
parent 0094fe0190
commit bf236630f5
4 changed files with 91 additions and 79 deletions

View File

@ -58,9 +58,6 @@ STATIC_ASSERT_FITS_IN (vlib_buffer_t, ref_count, 16);
STATIC_ASSERT_FITS_IN (vlib_buffer_t, buffer_pool_index, 16);
#endif
/* Make sure that buffer template size is not accidentally changed */
STATIC_ASSERT_OFFSET_OF (vlib_buffer_t, template_end, 64);
u16 __vlib_buffer_external_hdr_size = 0;
uword
@ -577,7 +574,7 @@ vlib_buffer_pool_create (vlib_main_t *vm, u32 data_size, u32 physmem_map_index,
continue;
b = (vlib_buffer_t *) (p + bm->ext_hdr_size);
vlib_buffer_copy_template (b, &bp->buffer_template);
b->template = bp->buffer_template;
bi = vlib_get_buffer_index (vm, b);
bp->buffers[bp->n_avail++] = bi;
vlib_get_buffer (vm, bi);