summaryrefslogtreecommitdiffstats
path: root/src/vlib/buffer.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2019-01-18 20:45:30 +0100
committerFlorin Coras <florin.coras@gmail.com>2019-01-19 00:17:51 +0000
commit36eb7c214280a5442186a2d13ed018bbd26a1a3a (patch)
tree6cdb6809f6d4eb19c87d314eb6f7f74764270794 /src/vlib/buffer.c
parentab9b7ec210059573c2cbe3ed961de533ba43e435 (diff)
buffers: remove free-list information from buffer metadata
Change-Id: I6048c6a51efa826ac333f7d15919cb87dd766d74 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib/buffer.c')
-rw-r--r--src/vlib/buffer.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/vlib/buffer.c b/src/vlib/buffer.c
index 07f91c39a0e..0251f52bd87 100644
--- a/src/vlib/buffer.c
+++ b/src/vlib/buffer.c
@@ -87,9 +87,9 @@ format_vlib_buffer (u8 * s, va_list * args)
a = format (a, "%s ", v);
foreach_vlib_buffer_flag
#undef _
- s = format (s, "current data %d, length %d, free-list %d, clone-count %u",
- b->current_data, b->current_length,
- vlib_buffer_get_free_list_index (b), b->n_add_refs);
+ s = format (s, "current data %d, length %d, buffer-pool %d, "
+ "clone-count %u", b->current_data, b->current_length,
+ b->buffer_pool_index, b->n_add_refs);
if (b->flags & VLIB_BUFFER_TOTAL_LENGTH_VALID)
s = format (s, ", totlen-nifb %d",
@@ -182,14 +182,8 @@ vlib_validate_buffer_helper (vlib_main_t * vm,
vlib_buffer_t *b = vlib_get_buffer (vm, bi);
vlib_buffer_free_list_t *fl;
- if (pool_is_free_index
- (vm->buffer_free_list_pool, vlib_buffer_get_free_list_index (b)))
- return format (0, "unknown free list 0x%x",
- vlib_buffer_get_free_list_index (b));
-
- fl =
- pool_elt_at_index (vm->buffer_free_list_pool,
- vlib_buffer_get_free_list_index (b));
+ fl = pool_elt_at_index (vm->buffer_free_list_pool,
+ VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX);
if ((signed) b->current_data < (signed) -VLIB_BUFFER_PRE_DATA_SIZE)
return format (0, "current data %d before pre-data", b->current_data);
@@ -394,7 +388,6 @@ vlib_buffer_create_free_list_helper (vlib_main_t * vm,
f->name = clib_mem_is_vec (name) ? name : format (0, "%s", name);
/* Setup free buffer template. */
- vlib_buffer_set_free_list_index (&f->buffer_init_template, f->index);
f->buffer_init_template.n_add_refs = 0;
if (is_public)
@@ -567,10 +560,10 @@ recycle_or_free (vlib_main_t * vm, vlib_buffer_main_t * bm, u32 bi,
vlib_buffer_t * b, u32 follow_buffer_next)
{
vlib_buffer_free_list_t *fl;
- vlib_buffer_free_list_index_t fi;
u32 flags, next;
- fl = vlib_buffer_get_buffer_free_list (vm, b, &fi);
+ fl = pool_elt_at_index (vm->buffer_free_list_pool,
+ VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX);
do
{