diff options
Diffstat (limited to 'src/vlib')
-rw-r--r-- | src/vlib/buffer.c | 63 | ||||
-rw-r--r-- | src/vlib/buffer.h | 14 | ||||
-rw-r--r-- | src/vlib/main.h | 3 |
3 files changed, 16 insertions, 64 deletions
diff --git a/src/vlib/buffer.c b/src/vlib/buffer.c index 3f90f5a0860..a704efb40f4 100644 --- a/src/vlib/buffer.c +++ b/src/vlib/buffer.c @@ -573,50 +573,26 @@ recycle_or_free (vlib_main_t * vm, vlib_buffer_main_t * bm, u32 bi, { vlib_buffer_free_list_t *fl; vlib_buffer_free_list_index_t fi; - fl = vlib_buffer_get_buffer_free_list (vm, b, &fi); + u32 flags, next; - /* The only current use of this callback: - * multicast recycle */ - if (PREDICT_FALSE (fl->buffers_added_to_freelist_function != 0)) - { - int j; + fl = vlib_buffer_get_buffer_free_list (vm, b, &fi); - vlib_buffer_add_to_free_list (vm, fl, bi, - (b->flags & VLIB_BUFFER_RECYCLE) == 0); - for (j = 0; j < vec_len (vm->buffer_announce_list); j++) - { - if (fl == vm->buffer_announce_list[j]) - goto already_announced; - } - vec_add1 (vm->buffer_announce_list, fl); - already_announced: - ; - } - else + do { - if (PREDICT_TRUE ((b->flags & VLIB_BUFFER_RECYCLE) == 0)) + vlib_buffer_t *nb = vlib_get_buffer (vm, bi); + flags = nb->flags; + next = nb->next_buffer; + if (nb->n_add_refs) + nb->n_add_refs--; + else { - u32 flags, next; - - do - { - vlib_buffer_t *nb = vlib_get_buffer (vm, bi); - flags = nb->flags; - next = nb->next_buffer; - if (nb->n_add_refs) - nb->n_add_refs--; - else - { - vlib_buffer_validate_alloc_free (vm, &bi, 1, - VLIB_BUFFER_KNOWN_ALLOCATED); - vlib_buffer_add_to_free_list (vm, fl, bi, 1); - } - bi = next; - } - while (follow_buffer_next && (flags & VLIB_BUFFER_NEXT_PRESENT)); - + vlib_buffer_validate_alloc_free (vm, &bi, 1, + VLIB_BUFFER_KNOWN_ALLOCATED); + vlib_buffer_add_to_free_list (vm, fl, bi, 1); } + bi = next; } + while (follow_buffer_next && (flags & VLIB_BUFFER_NEXT_PRESENT)); } static_always_inline void @@ -673,17 +649,6 @@ vlib_buffer_free_inline (vlib_main_t * vm, recycle_or_free (vm, bm, buffers[i], b0, follow_buffer_next); i++; } - - if (vec_len (vm->buffer_announce_list)) - { - vlib_buffer_free_list_t *fl; - for (i = 0; i < vec_len (vm->buffer_announce_list); i++) - { - fl = vm->buffer_announce_list[i]; - fl->buffers_added_to_freelist_function (vm, fl); - } - _vec_len (vm->buffer_announce_list) = 0; - } } static void diff --git a/src/vlib/buffer.h b/src/vlib/buffer.h index 9555cd7d224..651e7f0dc8f 100644 --- a/src/vlib/buffer.h +++ b/src/vlib/buffer.h @@ -67,11 +67,8 @@ typedef u8 vlib_buffer_free_list_index_t; _( 0, NON_DEFAULT_FREELIST, "non-default-fl") \ _( 1, IS_TRACED, 0) \ _( 2, NEXT_PRESENT, 0) \ - _( 3, IS_RECYCLED, "is-recycled") \ - _( 4, TOTAL_LENGTH_VALID, 0) \ - _( 5, REPL_FAIL, "repl-fail") \ - _( 6, RECYCLE, "recycle") \ - _( 7, EXT_HDR_VALID, "ext-hdr-valid") + _( 3, TOTAL_LENGTH_VALID, 0) \ + _( 4, EXT_HDR_VALID, "ext-hdr-valid") /* NOTE: only buffer generic flags should be defined here, please consider using user flags. i.e. src/vnet/buffer.h */ @@ -113,8 +110,6 @@ typedef struct <br> VLIB_BUFFER_IS_TRACED: trace this buffer. <br> VLIB_BUFFER_NEXT_PRESENT: this is a multi-chunk buffer. <br> VLIB_BUFFER_TOTAL_LENGTH_VALID: as it says - <br> VLIB_BUFFER_REPL_FAIL: packet replication failure - <br> VLIB_BUFFER_RECYCLE: as it says <br> VLIB_BUFFER_EXT_HDR_VALID: buffer contains valid external buffer manager header, set to avoid adding it to a flow report <br> VLIB_BUFFER_FLAG_USER(n): user-defined bit N @@ -370,11 +365,6 @@ typedef struct vlib_buffer_free_list_t struct vlib_buffer_free_list_t * fl, u32 * buffers, u32 n_buffers); - /* Callback function to announce that buffers have been - added to the freelist */ - void (*buffers_added_to_freelist_function) - (struct vlib_main_t * vm, struct vlib_buffer_free_list_t * fl); - uword buffer_init_function_opaque; } __attribute__ ((aligned (16))) vlib_buffer_free_list_t; diff --git a/src/vlib/main.h b/src/vlib/main.h index 8b6f9478619..d21227a5fdf 100644 --- a/src/vlib/main.h +++ b/src/vlib/main.h @@ -112,9 +112,6 @@ typedef struct vlib_main_t /* Pool of buffer free lists. */ vlib_buffer_free_list_t *buffer_free_list_pool; - /* List of free-lists needing Blue Light Special announcements */ - vlib_buffer_free_list_t **buffer_announce_list; - /* Allocate/free buffer memory for DMA transfers, descriptor rings, etc. buffer memory is guaranteed to be cache-aligned. */ |