aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/buffer.h
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2017-11-24 20:15:23 +0100
committerDave Barach <openvpp@barachs.net>2017-11-27 14:53:23 +0000
commitc8a26c6d239554bac96c481c840b3f5b3d8a17af (patch)
tree4ad52a5fd5bbbd7c3dd1ca976d5cd9e9b2c03cd5 /src/vlib/buffer.h
parent8b9a5d198cc316d36b93f19fee7a351fc3922e4a (diff)
vlib: make vlib_buffer_alloc inline function
Currently, every alloc involves callback function call. With this change callback function is called only if there is no empty buffers on the free list. Change-Id: I2238c19ece7ce182c49ba0f2485add52f335f3b6 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib/buffer.h')
-rw-r--r--src/vlib/buffer.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/vlib/buffer.h b/src/vlib/buffer.h
index 21bed48ac14..c3c4def0991 100644
--- a/src/vlib/buffer.h
+++ b/src/vlib/buffer.h
@@ -380,12 +380,9 @@ typedef struct vlib_buffer_free_list_t
uword buffer_init_function_opaque;
} __attribute__ ((aligned (16))) vlib_buffer_free_list_t;
-typedef u32 (vlib_buffer_alloc_cb_t) (struct vlib_main_t * vm, u32 * buffers,
- u32 n_buffers);
-typedef u32 (vlib_buffer_alloc_from_free_list_cb_t) (struct vlib_main_t * vm,
- u32 * buffers,
- u32 n_buffers,
- u32 free_list_index);
+typedef uword (vlib_buffer_fill_free_list_cb_t) (struct vlib_main_t * vm,
+ vlib_buffer_free_list_t * fl,
+ uword min_free_buffers);
typedef void (vlib_buffer_free_cb_t) (struct vlib_main_t * vm, u32 * buffers,
u32 n_buffers);
typedef void (vlib_buffer_free_no_next_cb_t) (struct vlib_main_t * vm,
@@ -393,8 +390,7 @@ typedef void (vlib_buffer_free_no_next_cb_t) (struct vlib_main_t * vm,
typedef struct
{
- vlib_buffer_alloc_cb_t *vlib_buffer_alloc_cb;
- vlib_buffer_alloc_from_free_list_cb_t *vlib_buffer_alloc_from_free_list_cb;
+ vlib_buffer_fill_free_list_cb_t *vlib_buffer_fill_free_list_cb;
vlib_buffer_free_cb_t *vlib_buffer_free_cb;
vlib_buffer_free_no_next_cb_t *vlib_buffer_free_no_next_cb;
void (*vlib_packet_template_init_cb) (struct vlib_main_t * vm, void *t,