aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/srv6-ad
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2018-11-13 16:34:13 -0500
committerFlorin Coras <florin.coras@gmail.com>2018-11-14 15:54:01 +0000
commit178cf493d009995b28fdf220f04c98860ff79a9b (patch)
tree097c1be82b8f6fa9bc04b9b1e193158e2e4997eb /src/plugins/srv6-ad
parent6917b94f2146aa51195a6a2a1ccd8416a1d74bf3 (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-ad')
-rw-r--r--src/plugins/srv6-ad/node.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/plugins/srv6-ad/node.c b/src/plugins/srv6-ad/node.c
index 776d283dbe7..8f32ae0e49e 100644
--- a/src/plugins/srv6-ad/node.c
+++ b/src/plugins/srv6-ad/node.c
@@ -166,7 +166,7 @@ end_ad_processing (vlib_buffer_t * b0,
{
vec_validate (ls0_mem->rewrite, total_size - 1);
}
- clib_memcpy (ls0_mem->rewrite, ip0, total_size);
+ clib_memcpy_fast (ls0_mem->rewrite, ip0, total_size);
ls0_mem->rw_len = total_size;
/* Remove IP header and extensions */
@@ -349,8 +349,8 @@ srv6_ad2_rewrite_fn (vlib_main_t * vm,
ASSERT (VLIB_BUFFER_PRE_DATA_SIZE >=
(ls0_mem->rw_len + b0->current_data));
- clib_memcpy (((u8 *) en0) - ls0_mem->rw_len,
- ls0_mem->rewrite, ls0_mem->rw_len);
+ clib_memcpy_fast (((u8 *) en0) - ls0_mem->rw_len,
+ ls0_mem->rewrite, ls0_mem->rw_len);
vlib_buffer_advance (b0, -(word) ls0_mem->rw_len);
ip0 = vlib_buffer_get_current (b0);
@@ -373,10 +373,10 @@ srv6_ad2_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);
}
}
@@ -484,8 +484,8 @@ srv6_ad4_rewrite_fn (vlib_main_t * vm,
ASSERT (VLIB_BUFFER_PRE_DATA_SIZE >=
(ls0_mem->rw_len + b0->current_data));
- clib_memcpy (((u8 *) ip0_encap) - ls0_mem->rw_len,
- ls0_mem->rewrite, ls0_mem->rw_len);
+ clib_memcpy_fast (((u8 *) ip0_encap) - ls0_mem->rw_len,
+ ls0_mem->rewrite, ls0_mem->rw_len);
vlib_buffer_advance (b0, -(word) ls0_mem->rw_len);
ip0 = vlib_buffer_get_current (b0);
@@ -516,10 +516,10 @@ srv6_ad4_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);
}
}
@@ -626,8 +626,8 @@ srv6_ad6_rewrite_fn (vlib_main_t * vm,
ASSERT (VLIB_BUFFER_PRE_DATA_SIZE >=
(ls0_mem->rw_len + b0->current_data));
- clib_memcpy (((u8 *) ip0_encap) - ls0_mem->rw_len,
- ls0_mem->rewrite, ls0_mem->rw_len);
+ clib_memcpy_fast (((u8 *) ip0_encap) - ls0_mem->rw_len,
+ ls0_mem->rewrite, ls0_mem->rw_len);
vlib_buffer_advance (b0, -(word) ls0_mem->rw_len);
ip0 = vlib_buffer_get_current (b0);
@@ -654,10 +654,10 @@ srv6_ad6_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);
}
}