if (i >= n_bytes)
return 1;
- clib_warning ("buffer %U", format_vlib_buffer, b);
+ clib_warning ("buffer %U", format_vnet_buffer, b);
clib_warning ("differ at index %d", i);
clib_warning ("is %U", format_hex_bytes, bd, n_bytes);
clib_warning ("mask %U", format_hex_bytes, pm, n_bytes);
vnet_buffer (b0)->sw_if_index[VLIB_TX] = (u32) ~ 0;
d0 = vec_elt (s->replay_packet_templates, i);
+ vnet_buffer2 (b0)->pg_replay_timestamp = s->replay_packet_timestamps[i];
n0 = n_data;
if (data_offset + n_data >= vec_len (d0))
}
}
-static void
-pg_buffer_init (vlib_main_t * vm,
- vlib_buffer_free_list_t * fl, u32 * buffers, u32 n_buffers)
-{
- pg_main_t *pg = &pg_main;
- pg_stream_t *s;
- uword bi, si;
-
- si = fl->buffer_init_function_opaque & pow2_mask (24);
- bi = fl->buffer_init_function_opaque >> 24;
-
- s = pool_elt_at_index (pg->streams, si);
-
- init_buffers_inline (vm, s, buffers, n_buffers,
- /* data_offset */ bi * s->buffer_bytes,
- /* n_data */ s->buffer_bytes,
- /* set_data */ 1);
-}
-
static u32
pg_stream_fill_helper (pg_main_t * pg,
pg_stream_t * s,
u32 * buffers, u32 * next_buffers, u32 n_alloc)
{
vlib_main_t *vm = vlib_get_main ();
- vlib_buffer_free_list_t *f;
uword is_start_of_packet = bi == s->buffer_indices;
u32 n_allocated;
- f = vlib_buffer_get_free_list (vm, bi->free_list_index);
-
- /*
- * Historically, the pg maintained its own free lists and
- * device drivers tx paths would return pkts.
- */
- if (vm->buffer_main->callbacks_registered == 0 &&
- !(s->flags & PG_STREAM_FLAGS_DISABLE_BUFFER_RECYCLE))
- f->buffer_init_function = pg_buffer_init;
- f->buffer_init_function_opaque =
- (s - pg->streams) | ((bi - s->buffer_indices) << 24);
-
- if (is_start_of_packet)
- vnet_buffer (&f->buffer_init_template)->sw_if_index[VLIB_RX]
- = vnet_main.local_interface_sw_if_index;
-
n_allocated = vlib_buffer_alloc_from_free_list (vm,
buffers,
n_alloc,
n_alloc = n_allocated;
/* Reinitialize buffers */
- if (vm->buffer_main->callbacks_registered == 0 || CLIB_DEBUG > 0
- || (s->flags & PG_STREAM_FLAGS_DISABLE_BUFFER_RECYCLE))
- init_buffers_inline
- (vm, s,
- buffers,
- n_alloc, (bi - s->buffer_indices) * s->buffer_bytes /* data offset */ ,
- s->buffer_bytes,
- /* set_data */
- vm->buffer_main->callbacks_registered != 0
- || (s->flags & PG_STREAM_FLAGS_DISABLE_BUFFER_RECYCLE) != 0);
+ init_buffers_inline
+ (vm, s,
+ buffers,
+ n_alloc, (bi - s->buffer_indices) * s->buffer_bytes /* data offset */ ,
+ s->buffer_bytes,
+ /* set_data */ 1);
if (next_buffers)
pg_set_next_buffer_pointers (pg, s, buffers, next_buffers, n_alloc);
s = format (s, ", %d sw_if_index", t->sw_if_index);
s = format (s, "\n%U%U",
- format_white_space, indent, format_vlib_buffer, &t->buffer);
+ format_white_space, indent, format_vnet_buffer, &t->buffer);
s = format (s, "\n%U", format_white_space, indent);
{
vlib_buffer_t *b;
b = vlib_get_buffer (vm, to_next[i]);
- vnet_buffer (b)->device_input_feat.saved_next_index =
- s->next_index;
- vnet_buffer (b)->device_input_feat.buffer_advance = 0;
b->current_config_index = current_config_index;
- b->feature_arc_index = feature_arc_index;
+ vnet_buffer (b)->feature_arc_index = feature_arc_index;
}
n_trace = vlib_get_trace_count (vm, node);