diff options
author | Klement Sekera <ksekera@cisco.com> | 2017-11-09 09:12:12 +0100 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2017-11-09 19:26:36 +0000 |
commit | 75e974b45faef7fa36f6da5a0938f2a86a2a2f80 (patch) | |
tree | 00107e3358518aa8795841c9d5f59be99e8508b4 /src/vlib | |
parent | b966b8e63ff71159d55bc4510b4d9d96a01c19db (diff) |
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>
Diffstat (limited to 'src/vlib')
-rw-r--r-- | src/vlib/buffer_funcs.h | 1 |
1 files changed, 1 insertions, 0 deletions
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); } } |