Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
GBP V2
[vpp.git]
/
src
/
vnet
/
replication.c
diff --git
a/src/vnet/replication.c
b/src/vnet/replication.c
index
0fdca0b
..
21f5485
100644
(file)
--- a/
src/vnet/replication.c
+++ b/
src/vnet/replication.c
@@
-45,6
+45,7
@@
replication_prep (vlib_main_t * vm,
/* Save state from vlib buffer */
ctx->saved_free_list_index = vlib_buffer_get_free_list_index (b0);
ctx->current_data = b0->current_data;
/* Save state from vlib buffer */
ctx->saved_free_list_index = vlib_buffer_get_free_list_index (b0);
ctx->current_data = b0->current_data;
+ ctx->flags = b0->flags & VNET_BUFFER_FLAGS_VLAN_BITS;
/* Set up vlib buffer hooks */
b0->recycle_count = ctx_id;
/* Set up vlib buffer hooks */
b0->recycle_count = ctx_id;
@@
-104,6
+105,10
@@
replication_recycle (vlib_main_t * vm, vlib_buffer_t * b0, u32 is_last)
clib_memcpy (vnet_buffer (b0), ctx->vnet_buffer,
sizeof (vnet_buffer_opaque_t));
clib_memcpy (vnet_buffer (b0), ctx->vnet_buffer,
sizeof (vnet_buffer_opaque_t));
+ /* Restore the vlan flags */
+ b0->flags &= ~VNET_BUFFER_FLAGS_VLAN_BITS;
+ b0->flags |= ctx->flags;
+
/* Restore the packet start (current_data) and length */
vlib_buffer_advance (b0, ctx->current_data - b0->current_data);
/* Restore the packet start (current_data) and length */
vlib_buffer_advance (b0, ctx->current_data - b0->current_data);
@@
-214,9
+219,8
@@
replication_recycle_callback (vlib_main_t * vm, vlib_buffer_free_list_t * fl)
b0->flags |= VLIB_BUFFER_IS_RECYCLED;
#if (CLIB_DEBUG > 0)
b0->flags |= VLIB_BUFFER_IS_RECYCLED;
#if (CLIB_DEBUG > 0)
- if (vm->buffer_main->callbacks_registered == 0)
- vlib_buffer_set_known_state (vm, bi0,
- VLIB_BUFFER_KNOWN_ALLOCATED);
+ if (buffer_main.callbacks_registered == 0)
+ vlib_buffer_set_known_state (bi0, VLIB_BUFFER_KNOWN_ALLOCATED);
#endif
/* If buffer is traced, mark frame as traced */
#endif
/* If buffer is traced, mark frame as traced */
@@
-247,7
+251,6
@@
clib_error_t *
replication_init (vlib_main_t * vm)
{
replication_main_t *rm = &replication_main;
replication_init (vlib_main_t * vm)
{
replication_main_t *rm = &replication_main;
- vlib_buffer_main_t *bm = vm->buffer_main;
vlib_buffer_free_list_t *fl;
__attribute__ ((unused)) replication_context_t *ctx;
vlib_thread_main_t *tm = vlib_get_thread_main ();
vlib_buffer_free_list_t *fl;
__attribute__ ((unused)) replication_context_t *ctx;
vlib_thread_main_t *tm = vlib_get_thread_main ();
@@
-258,7
+261,7
@@
replication_init (vlib_main_t * vm)
vlib_buffer_create_free_list (vm, 1024 /* fictional */ ,
"replication-recycle");
vlib_buffer_create_free_list (vm, 1024 /* fictional */ ,
"replication-recycle");
- fl = pool_elt_at_index (
b
m->buffer_free_list_pool, rm->recycle_list_index);
+ fl = pool_elt_at_index (
v
m->buffer_free_list_pool, rm->recycle_list_index);
fl->buffers_added_to_freelist_function = replication_recycle_callback;
fl->buffers_added_to_freelist_function = replication_recycle_callback;