summaryrefslogtreecommitdiffstats
path: root/hicn-plugin/src/data_fwd.h
diff options
context:
space:
mode:
authorAlberto Compagno <acompagn+fdio@cisco.com>2019-05-07 12:06:04 +0200
committerAlberto Compagno <acompagn+fdio@cisco.com>2019-05-07 12:06:04 +0200
commitcd48bbd9685f042a2f1f90678f8fa98a5175ea4d (patch)
tree8412a4f3d56c451250ccb4ea1b687d51ccbb214b /hicn-plugin/src/data_fwd.h
parent113e0af25e5a802eccac1fc4521f096a2e1bd199 (diff)
[HICN-189] In case the adj is not complete, we look if a better one exists and we follow the new adjacency. The adj in the face is updated accordingly.
Change-Id: Ieb5c02ee66146475d54ee99a77fc795c9bdf3130 Signed-off-by: Alberto Compagno <acompagn+fdio@cisco.com>
Diffstat (limited to 'hicn-plugin/src/data_fwd.h')
-rw-r--r--hicn-plugin/src/data_fwd.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/hicn-plugin/src/data_fwd.h b/hicn-plugin/src/data_fwd.h
index 742bb2882..c001e5af5 100644
--- a/hicn-plugin/src/data_fwd.h
+++ b/hicn-plugin/src/data_fwd.h
@@ -95,18 +95,18 @@ vlib_buffer_clone_256_2 (vlib_main_t * vm, u32 src_buffer, u32 * buffers,
d->flags = s->flags | VLIB_BUFFER_NEXT_PRESENT;
d->flags &= ~VLIB_BUFFER_EXT_HDR_VALID;
d->trace_index = s->trace_index;
- clib_memcpy (d->opaque, s->opaque, sizeof (s->opaque));
- clib_memcpy (d->opaque2, s->opaque2, sizeof (s->opaque2));
- clib_memcpy (vlib_buffer_get_current (d), vlib_buffer_get_current (s),
- head_end_offset);
+ clib_memcpy_fast (d->opaque, s->opaque, sizeof (s->opaque));
+ clib_memcpy_fast (d->opaque2, s->opaque2, sizeof (s->opaque2));
+ clib_memcpy_fast (vlib_buffer_get_current (d),
+ vlib_buffer_get_current (s), head_end_offset);
d->next_buffer = src_buffer;
}
vlib_buffer_advance (s, head_end_offset);
- s->ref_count = n_buffers - 1;
+ s->ref_count = n_buffers;
while (s->flags & VLIB_BUFFER_NEXT_PRESENT)
{
s = vlib_get_buffer (vm, s->next_buffer);
- s->ref_count = n_buffers - 1;
+ s->ref_count = n_buffers;
}
return n_buffers;
@@ -166,7 +166,7 @@ vlib_buffer_clone2 (vlib_main_t * vm, u32 src_buffer, u32 * buffers,
*/
u8 tmp_ref_count = s->ref_count;
- s->ref_count = 0;
+ s->ref_count = 1;
/*
* The regular vlib_buffer_clone_256 does copy if we need to clone
* only one packet. While this is not a problem per se, it adds
@@ -178,7 +178,7 @@ vlib_buffer_clone2 (vlib_main_t * vm, u32 src_buffer, u32 * buffers,
(buffers + n_cloned),
n_buffers, head_end_offset);
- s->ref_count += tmp_ref_count;
+ s->ref_count += (tmp_ref_count - 1);
return n_cloned;
}