summaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/devices/af_packet/node.c3
-rw-r--r--src/vnet/devices/netmap/node.c3
-rw-r--r--src/vnet/devices/virtio/vhost_user_input.c5
-rwxr-xr-xsrc/vnet/ip/ip6_neighbor.c8
-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
-rw-r--r--src/vnet/sctp/sctp.c3
-rw-r--r--src/vnet/session/session_node.c3
-rw-r--r--src/vnet/tcp/tcp.c3
-rw-r--r--src/vnet/unix/tapcli.c7
12 files changed, 18 insertions, 39 deletions
diff --git a/src/vnet/devices/af_packet/node.c b/src/vnet/devices/af_packet/node.c
index 97aa170c0a6..243a38a42b1 100644
--- a/src/vnet/devices/af_packet/node.c
+++ b/src/vnet/devices/af_packet/node.c
@@ -192,8 +192,7 @@ af_packet_device_input_fn (vlib_main_t * vm, vlib_node_runtime_t * node,
u8 *block_start = apif->rx_ring + block * block_size;
uword n_trace = vlib_get_trace_count (vm, node);
u32 thread_index = vm->thread_index;
- u32 n_buffer_bytes = vlib_buffer_free_list_buffer_size (vm,
- VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX);
+ u32 n_buffer_bytes = VLIB_BUFFER_DATA_SIZE;
u32 min_bufs = apif->rx_req->tp_frame_size / n_buffer_bytes;
if (apif->per_interface_next_index != ~0)
diff --git a/src/vnet/devices/netmap/node.c b/src/vnet/devices/netmap/node.c
index dde706f20c7..577d4a394b2 100644
--- a/src/vnet/devices/netmap/node.c
+++ b/src/vnet/devices/netmap/node.c
@@ -99,8 +99,7 @@ netmap_device_input_fn (vlib_main_t * vm, vlib_node_runtime_t * node,
struct netmap_ring *ring;
int cur_ring;
u32 thread_index = vm->thread_index;
- u32 n_buffer_bytes = vlib_buffer_free_list_buffer_size (vm,
- VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX);
+ u32 n_buffer_bytes = VLIB_BUFFER_DATA_SIZE;
if (nif->per_interface_next_index != ~0)
next_index = nif->per_interface_next_index;
diff --git a/src/vnet/devices/virtio/vhost_user_input.c b/src/vnet/devices/virtio/vhost_user_input.c
index 97303ce3791..812f9d3f6ab 100644
--- a/src/vnet/devices/virtio/vhost_user_input.c
+++ b/src/vnet/devices/virtio/vhost_user_input.c
@@ -349,9 +349,8 @@ vhost_user_if_input (vlib_main_t * vm,
{
u32 curr_len = cpu->rx_buffers_len;
cpu->rx_buffers_len +=
- vlib_buffer_alloc_from_free_list (vm, cpu->rx_buffers + curr_len,
- VHOST_USER_RX_BUFFERS_N - curr_len,
- VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX);
+ vlib_buffer_alloc (vm, cpu->rx_buffers + curr_len,
+ VHOST_USER_RX_BUFFERS_N - curr_len);
if (PREDICT_FALSE
(cpu->rx_buffers_len < VHOST_USER_RX_BUFFER_STARVATION))
diff --git a/src/vnet/ip/ip6_neighbor.c b/src/vnet/ip/ip6_neighbor.c
index 9be57207572..a7ce2798f2a 100755
--- a/src/vnet/ip/ip6_neighbor.c
+++ b/src/vnet/ip/ip6_neighbor.c
@@ -2758,10 +2758,7 @@ ip6_neighbor_send_mldpv2_report (u32 sw_if_index)
return;
/* send report now - build a mldpv2 report packet */
- n_allocated = vlib_buffer_alloc_from_free_list (vm,
- &bo0,
- n_to_alloc,
- VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX);
+ n_allocated = vlib_buffer_alloc (vm, &bo0, n_to_alloc);
if (PREDICT_FALSE (n_allocated == 0))
{
clib_warning ("buffer allocation failure");
@@ -2954,8 +2951,7 @@ ip6_neighbor_process_timer_event (vlib_main_t * vm,
radv_info->last_multicast_time = now;
/* send advert now - build a "solicted" router advert with unspecified source address */
- n_allocated = vlib_buffer_alloc_from_free_list
- (vm, &bo0, n_to_alloc, VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX);
+ n_allocated = vlib_buffer_alloc (vm, &bo0, n_to_alloc);
if (PREDICT_FALSE(n_allocated == 0))
{
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. */
diff --git a/src/vnet/sctp/sctp.c b/src/vnet/sctp/sctp.c
index 10ec7700a2c..86aef88f432 100644
--- a/src/vnet/sctp/sctp.c
+++ b/src/vnet/sctp/sctp.c
@@ -892,8 +892,7 @@ sctp_main_enable (vlib_main_t * vm)
vec_validate (tm->ip_lookup_tx_frames[0], num_threads - 1);
vec_validate (tm->ip_lookup_tx_frames[1], num_threads - 1);
- tm->bytes_per_buffer = vlib_buffer_free_list_buffer_size
- (vm, VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX);
+ tm->bytes_per_buffer = VLIB_BUFFER_DATA_SIZE;
vec_validate (tm->time_now, num_threads - 1);
return error;
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c
index 45018daf45a..a01f01c8bcb 100644
--- a/src/vnet/session/session_node.c
+++ b/src/vnet/session/session_node.c
@@ -541,8 +541,7 @@ session_tx_set_dequeue_params (vlib_main_t * vm, session_tx_context_t * ctx,
ctx->max_len_to_snd = max_segs * ctx->snd_mss;
}
- n_bytes_per_buf = vlib_buffer_free_list_buffer_size (vm,
- VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX);
+ n_bytes_per_buf = VLIB_BUFFER_DATA_SIZE;
ASSERT (n_bytes_per_buf > MAX_HDRS_LEN);
n_bytes_per_seg = MAX_HDRS_LEN + ctx->snd_mss;
ctx->n_bufs_per_seg = ceil ((f64) n_bytes_per_seg / n_bytes_per_buf);
diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c
index 7f6a087b2f3..8c3e8b10df0 100644
--- a/src/vnet/tcp/tcp.c
+++ b/src/vnet/tcp/tcp.c
@@ -1445,8 +1445,7 @@ tcp_main_enable (vlib_main_t * vm)
tcp_initialize_timer_wheels (tm);
- tm->bytes_per_buffer = vlib_buffer_free_list_buffer_size
- (vm, VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX);
+ tm->bytes_per_buffer = VLIB_BUFFER_DATA_SIZE;
return error;
}
diff --git a/src/vnet/unix/tapcli.c b/src/vnet/unix/tapcli.c
index 83ac33f49dc..b4df8e84fe4 100644
--- a/src/vnet/unix/tapcli.c
+++ b/src/vnet/unix/tapcli.c
@@ -297,11 +297,8 @@ tapcli_rx_iface (vlib_main_t * vm,
{
uword len = vec_len (tm->threads[thread_index].rx_buffers);
_vec_len (tm->threads[thread_index].rx_buffers) +=
- vlib_buffer_alloc_from_free_list (vm,
- &tm->threads[thread_index].
- rx_buffers[len],
- VLIB_FRAME_SIZE - len,
- VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX);
+ vlib_buffer_alloc (vm, &tm->threads[thread_index].rx_buffers[len],
+ VLIB_FRAME_SIZE - len);
if (PREDICT_FALSE
(vec_len (tm->threads[thread_index].rx_buffers) <
tm->mtu_buffers))