aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/pg
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2018-12-30 18:09:59 +0100
committerDave Barach <openvpp@barachs.net>2019-01-01 14:57:54 +0000
commit671e60e65635b8d030bf303c88411192c747b59e (patch)
tree6659aef772f2f0b1d475a4cb0b2a4da67d5b87a1 /src/vnet/pg
parentb0f662fe93f1db0098f7b50306c2f084644788b1 (diff)
buffers: remove unused code
Change-Id: If2bbfbc52994f5de0879763e0b7a7864498debb6 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/pg')
-rw-r--r--src/vnet/pg/cli.c2
-rw-r--r--src/vnet/pg/input.c12
-rw-r--r--src/vnet/pg/pg.h2
-rw-r--r--src/vnet/pg/stream.c6
4 files changed, 7 insertions, 15 deletions
diff --git a/src/vnet/pg/cli.c b/src/vnet/pg/cli.c
index 8b543d3ca38..a09107c50c5 100644
--- a/src/vnet/pg/cli.c
+++ b/src/vnet/pg/cli.c
@@ -305,7 +305,7 @@ new_stream (vlib_main_t * vm,
s.sw_if_index[VLIB_RX] = s.sw_if_index[VLIB_TX] = ~0;
s.node_index = ~0;
s.max_packet_bytes = s.min_packet_bytes = 64;
- s.buffer_bytes = VLIB_BUFFER_DEFAULT_FREE_LIST_BYTES;
+ s.buffer_bytes = VLIB_BUFFER_DATA_SIZE;
s.if_id = 0;
pcap_file_name = 0;
while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
diff --git a/src/vnet/pg/input.c b/src/vnet/pg/input.c
index ee6aad4995e..4db4b45edcb 100644
--- a/src/vnet/pg/input.c
+++ b/src/vnet/pg/input.c
@@ -1190,10 +1190,7 @@ pg_stream_fill_helper (pg_main_t * pg,
uword is_start_of_packet = bi == s->buffer_indices;
u32 n_allocated;
- n_allocated = vlib_buffer_alloc_from_free_list (vm,
- buffers,
- n_alloc,
- bi->free_list_index);
+ n_allocated = vlib_buffer_alloc (vm, buffers, n_alloc);
if (n_allocated == 0)
return 0;
@@ -1525,12 +1522,13 @@ pg_generate_packets (vlib_node_runtime_t * node,
head = clib_fifo_head (bi0->buffer_fifo);
if (head + n_this_frame <= end)
- vlib_copy_buffers (to_next, head, n_this_frame);
+ clib_memcpy_fast (to_next, head, n_this_frame * sizeof (u32));
else
{
u32 n = end - head;
- vlib_copy_buffers (to_next + 0, head, n);
- vlib_copy_buffers (to_next + n, start, n_this_frame - n);
+ clib_memcpy_fast (to_next + 0, head, n * sizeof (u32));
+ clib_memcpy_fast (to_next + n, start,
+ (n_this_frame - n) * sizeof (u32));
}
vec_foreach (bi, s->buffer_indices)
diff --git a/src/vnet/pg/pg.h b/src/vnet/pg/pg.h
index 99652b43981..0b06803d384 100644
--- a/src/vnet/pg/pg.h
+++ b/src/vnet/pg/pg.h
@@ -89,8 +89,6 @@ typedef struct
/* Buffers pre-initialized with fixed buffer data for this stream. */
u32 *buffer_fifo;
- /* Buffer free list for this buffer index in stream. */
- vlib_buffer_free_list_index_t free_list_index;
} pg_buffer_index_t;
typedef struct pg_stream_t
diff --git a/src/vnet/pg/stream.c b/src/vnet/pg/stream.c
index bf0eac370aa..ddd15d66406 100644
--- a/src/vnet/pg/stream.c
+++ b/src/vnet/pg/stream.c
@@ -435,17 +435,13 @@ pg_stream_add (pg_main_t * pg, pg_stream_t * s_init)
s->last_increment_packet_size = s->min_packet_bytes;
{
- pg_buffer_index_t *bi;
int n;
- s->buffer_bytes = VLIB_BUFFER_DEFAULT_FREE_LIST_BYTES;
+ s->buffer_bytes = VLIB_BUFFER_DATA_SIZE;
n = s->max_packet_bytes / s->buffer_bytes;
n += (s->max_packet_bytes % s->buffer_bytes) != 0;
vec_resize (s->buffer_indices, n);
-
- vec_foreach (bi, s->buffer_indices)
- bi->free_list_index = VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX;
}
/* Find an interface to use. */