From 75e974b45faef7fa36f6da5a0938f2a86a2a2f80 Mon Sep 17 00:00:00 2001 From: Klement Sekera Date: Thu, 9 Nov 2017 09:12:12 +0100 Subject: 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 --- src/vlib/buffer_funcs.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vlib/buffer_funcs.h b/src/vlib/buffer_funcs.h index 7224e08013e..c7b5321ffac 100644 --- a/src/vlib/buffer_funcs.h +++ b/src/vlib/buffer_funcs.h @@ -828,6 +828,7 @@ vlib_buffer_add_to_free_list (vlib_main_t * vm, 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); } } -- cgit 1.2.3-korg