diff options
author | Lollita Liu <lollita.liu@ericsson.com> | 2019-02-14 05:02:44 -0500 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2019-02-14 17:16:03 +0000 |
commit | 8f6c1dda355b6e4d00dc4e41e65a25e1fd1507ee (patch) | |
tree | 009ade3a6651c33114e00aa2cf9efcdb8c660f58 /src/vlib | |
parent | cec202c417fe874e5208dbccc344f76b08658df7 (diff) |
buffer: bug fix vlib_buffer_free_inline
buffer_pool_index, in case of buffer_pool_index change,
should free buffers in queue before setting buffer_pool_index again
Change-Id: I846ead947a7b2d940c8fc747976239d608597391
Signed-off-by: Lollita Liu <lollita.liu@ericsson.com>
Diffstat (limited to 'src/vlib')
-rw-r--r-- | src/vlib/buffer_funcs.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/vlib/buffer_funcs.h b/src/vlib/buffer_funcs.h index 1600905564c..ec0c12e3ee9 100644 --- a/src/vlib/buffer_funcs.h +++ b/src/vlib/buffer_funcs.h @@ -767,18 +767,19 @@ vlib_buffer_free_inline (vlib_main_t * vm, u32 * buffers, u32 n_buffers, if (PREDICT_FALSE (buffer_pool_index != b[0]->buffer_pool_index)) { - buffer_pool_index = b[0]->buffer_pool_index; -#if defined(CLIB_HAVE_VEC128) && !__aarch64__ - bpi_vec.buffer_pool_index = buffer_pool_index; -#endif - bp = vlib_get_buffer_pool (vm, buffer_pool_index); - vlib_buffer_copy_template (&bt, &bp->buffer_template); if (n_queue) { vlib_buffer_pool_put (vm, buffer_pool_index, queue, n_queue); n_queue = 0; } + + buffer_pool_index = b[0]->buffer_pool_index; +#if defined(CLIB_HAVE_VEC128) && !__aarch64__ + bpi_vec.buffer_pool_index = buffer_pool_index; +#endif + bp = vlib_get_buffer_pool (vm, buffer_pool_index); + vlib_buffer_copy_template (&bt, &bp->buffer_template); } vlib_buffer_validate (vm, b[0]); |