buffers: fix bug in free list n_alloc tracking
This change avoids hitting
ASSERT (vec_len (f->buffers) == f->n_alloc);
in vlib_buffer_delete_free_list_internal by updating
vlib_buffer_free_list_t->n_alloc in case when buffers are removed from
the free list due to overfill.
Change-Id: Id60fa97e8cb0f02ef529b05816265a57a4e7d998
Signed-off-by: Klement Sekera <ksekera@cisco.com>
diff --git a/src/vlib/buffer_funcs.h b/src/vlib/buffer_funcs.h
index 7224e08..c7b5321 100644
--- a/src/vlib/buffer_funcs.h
+++ b/src/vlib/buffer_funcs.h
@@ -828,6 +828,7 @@
vec_add_aligned (mf->global_buffers, f->buffers, VLIB_FRAME_SIZE,
CLIB_CACHE_LINE_BYTES);
vec_delete (f->buffers, VLIB_FRAME_SIZE, 0);
+ f->n_alloc -= VLIB_FRAME_SIZE;
clib_spinlock_unlock (&mf->global_buffers_lock);
}
}