diff options
author | Dave Barach <dave@barachs.net> | 2018-11-13 16:34:13 -0500 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2018-11-14 15:54:01 +0000 |
commit | 178cf493d009995b28fdf220f04c98860ff79a9b (patch) | |
tree | 097c1be82b8f6fa9bc04b9b1e193158e2e4997eb /src/plugins/srv6-as/node.c | |
parent | 6917b94f2146aa51195a6a2a1ccd8416a1d74bf3 (diff) |
Remove c-11 memcpy checks from perf-critical code
Change-Id: Id4f37f5d4a03160572954a416efa1ef9b3d79ad1
Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/plugins/srv6-as/node.c')
-rw-r--r-- | src/plugins/srv6-as/node.c | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/src/plugins/srv6-as/node.c b/src/plugins/srv6-as/node.c index d81a7e88722..6f424fcca12 100644 --- a/src/plugins/srv6-as/node.c +++ b/src/plugins/srv6-as/node.c @@ -316,8 +316,8 @@ srv6_as2_rewrite_fn (vlib_main_t * vm, ASSERT (VLIB_BUFFER_PRE_DATA_SIZE >= (vec_len (ls0_mem->rewrite) + b0->current_data)); - clib_memcpy (((u8 *) en0) - vec_len (ls0_mem->rewrite), - ls0_mem->rewrite, vec_len (ls0_mem->rewrite)); + clib_memcpy_fast (((u8 *) en0) - vec_len (ls0_mem->rewrite), + ls0_mem->rewrite, vec_len (ls0_mem->rewrite)); vlib_buffer_advance (b0, -(word) vec_len (ls0_mem->rewrite)); ip0 = vlib_buffer_get_current (b0); @@ -340,10 +340,10 @@ srv6_as2_rewrite_fn (vlib_main_t * vm, } else { - clib_memcpy (tr->src.as_u8, ip0->src_address.as_u8, - sizeof tr->src.as_u8); - clib_memcpy (tr->dst.as_u8, ip0->dst_address.as_u8, - sizeof tr->dst.as_u8); + clib_memcpy_fast (tr->src.as_u8, ip0->src_address.as_u8, + sizeof tr->src.as_u8); + clib_memcpy_fast (tr->dst.as_u8, ip0->dst_address.as_u8, + sizeof tr->dst.as_u8); } } @@ -451,8 +451,9 @@ srv6_as4_rewrite_fn (vlib_main_t * vm, ASSERT (VLIB_BUFFER_PRE_DATA_SIZE >= (vec_len (ls0_mem->rewrite) + b0->current_data)); - clib_memcpy (((u8 *) ip0_encap) - vec_len (ls0_mem->rewrite), - ls0_mem->rewrite, vec_len (ls0_mem->rewrite)); + clib_memcpy_fast (((u8 *) ip0_encap) - + vec_len (ls0_mem->rewrite), ls0_mem->rewrite, + vec_len (ls0_mem->rewrite)); vlib_buffer_advance (b0, -(word) vec_len (ls0_mem->rewrite)); ip0 = vlib_buffer_get_current (b0); @@ -483,10 +484,10 @@ srv6_as4_rewrite_fn (vlib_main_t * vm, } else { - clib_memcpy (tr->src.as_u8, ip0->src_address.as_u8, - sizeof tr->src.as_u8); - clib_memcpy (tr->dst.as_u8, ip0->dst_address.as_u8, - sizeof tr->dst.as_u8); + clib_memcpy_fast (tr->src.as_u8, ip0->src_address.as_u8, + sizeof tr->src.as_u8); + clib_memcpy_fast (tr->dst.as_u8, ip0->dst_address.as_u8, + sizeof tr->dst.as_u8); } } @@ -593,8 +594,9 @@ srv6_as6_rewrite_fn (vlib_main_t * vm, ASSERT (VLIB_BUFFER_PRE_DATA_SIZE >= (vec_len (ls0_mem->rewrite) + b0->current_data)); - clib_memcpy (((u8 *) ip0_encap) - vec_len (ls0_mem->rewrite), - ls0_mem->rewrite, vec_len (ls0_mem->rewrite)); + clib_memcpy_fast (((u8 *) ip0_encap) - + vec_len (ls0_mem->rewrite), ls0_mem->rewrite, + vec_len (ls0_mem->rewrite)); vlib_buffer_advance (b0, -(word) vec_len (ls0_mem->rewrite)); ip0 = vlib_buffer_get_current (b0); @@ -621,10 +623,10 @@ srv6_as6_rewrite_fn (vlib_main_t * vm, } else { - clib_memcpy (tr->src.as_u8, ip0->src_address.as_u8, - sizeof tr->src.as_u8); - clib_memcpy (tr->dst.as_u8, ip0->dst_address.as_u8, - sizeof tr->dst.as_u8); + clib_memcpy_fast (tr->src.as_u8, ip0->src_address.as_u8, + sizeof tr->src.as_u8); + clib_memcpy_fast (tr->dst.as_u8, ip0->dst_address.as_u8, + sizeof tr->dst.as_u8); } } |