diff options
author | Damjan Marion <damarion@cisco.com> | 2019-01-18 20:24:44 +0100 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2019-01-18 23:18:05 +0000 |
commit | ab9b7ec210059573c2cbe3ed961de533ba43e435 (patch) | |
tree | 943cf516742a8537607181ebad9966cee0109698 /src/vlib | |
parent | 64d557cd6723cc3a7ae3a0a68a52e220f8f2c7f1 (diff) |
buffers: remove freelist argument from vlib_buffer_add_data
Change-Id: Idb224b807373128b78dc46f177b2d2e0ed288349
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib')
-rw-r--r-- | src/vlib/buffer.c | 14 | ||||
-rw-r--r-- | src/vlib/buffer_funcs.h | 5 |
2 files changed, 7 insertions, 12 deletions
diff --git a/src/vlib/buffer.c b/src/vlib/buffer.c index 5370d501293..07f91c39a0e 100644 --- a/src/vlib/buffer.c +++ b/src/vlib/buffer.c @@ -706,22 +706,20 @@ vlib_packet_template_get_packet (vlib_main_t * vm, /* Append given data to end of buffer, possibly allocating new buffers. */ int -vlib_buffer_add_data (vlib_main_t * vm, - vlib_buffer_free_list_index_t free_list_index, - u32 * buffer_index, void *data, u32 n_data_bytes) +vlib_buffer_add_data (vlib_main_t * vm, u32 * buffer_index, void *data, + u32 n_data_bytes) { u32 n_buffer_bytes, n_left, n_left_this_buffer, bi; vlib_buffer_t *b; void *d; bi = *buffer_index; - if (bi == ~0 - && 1 != vlib_buffer_alloc_from_free_list (vm, &bi, 1, free_list_index)) + if (bi == ~0 && 1 != vlib_buffer_alloc (vm, &bi, 1)) goto out_of_buffers; d = data; n_left = n_data_bytes; - n_buffer_bytes = vlib_buffer_free_list_buffer_size (vm, free_list_index); + n_buffer_bytes = VLIB_BUFFER_DATA_SIZE; b = vlib_get_buffer (vm, bi); b->flags &= ~VLIB_BUFFER_TOTAL_LENGTH_VALID; @@ -746,9 +744,7 @@ vlib_buffer_add_data (vlib_main_t * vm, break; d += n; - if (1 != - vlib_buffer_alloc_from_free_list (vm, &b->next_buffer, 1, - free_list_index)) + if (1 != vlib_buffer_alloc (vm, &b->next_buffer, 1)) goto out_of_buffers; b->flags |= VLIB_BUFFER_NEXT_PRESENT; diff --git a/src/vlib/buffer_funcs.h b/src/vlib/buffer_funcs.h index f5781c8b173..cc72c57d5e8 100644 --- a/src/vlib/buffer_funcs.h +++ b/src/vlib/buffer_funcs.h @@ -684,9 +684,8 @@ vlib_buffer_free_list_buffer_size (vlib_main_t * vm, } /* Append given data to end of buffer, possibly allocating new buffers. */ -int vlib_buffer_add_data (vlib_main_t * vm, - vlib_buffer_free_list_index_t free_list_index, - u32 * buffer_index, void *data, u32 n_data_bytes); +int vlib_buffer_add_data (vlib_main_t * vm, u32 * buffer_index, void *data, + u32 n_data_bytes); /* duplicate all buffers in chain */ always_inline vlib_buffer_t * |