summaryrefslogtreecommitdiffstats
path: root/src/examples
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/examples
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/examples')
-rw-r--r--src/examples/sample-plugin/sample/node.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/src/examples/sample-plugin/sample/node.c b/src/examples/sample-plugin/sample/node.c
index 009968b6099..1f0a2e9775b 100644
--- a/src/examples/sample-plugin/sample/node.c
+++ b/src/examples/sample-plugin/sample/node.c
@@ -183,10 +183,10 @@ VLIB_NODE_FN (sample_node) (vlib_main_t * vm, vlib_node_runtime_t * node,
vlib_add_trace (vm, node, b0, sizeof (*t));
t->sw_if_index = sw_if_index0;
t->next_index = next0;
- clib_memcpy (t->new_src_mac, en0->src_address,
- sizeof (t->new_src_mac));
- clib_memcpy (t->new_dst_mac, en0->dst_address,
- sizeof (t->new_dst_mac));
+ clib_memcpy_fast (t->new_src_mac, en0->src_address,
+ sizeof (t->new_src_mac));
+ clib_memcpy_fast (t->new_dst_mac, en0->dst_address,
+ sizeof (t->new_dst_mac));
}
if (b1->flags & VLIB_BUFFER_IS_TRACED)
@@ -195,10 +195,10 @@ VLIB_NODE_FN (sample_node) (vlib_main_t * vm, vlib_node_runtime_t * node,
vlib_add_trace (vm, node, b1, sizeof (*t));
t->sw_if_index = sw_if_index1;
t->next_index = next1;
- clib_memcpy (t->new_src_mac, en1->src_address,
- sizeof (t->new_src_mac));
- clib_memcpy (t->new_dst_mac, en1->dst_address,
- sizeof (t->new_dst_mac));
+ clib_memcpy_fast (t->new_src_mac, en1->src_address,
+ sizeof (t->new_src_mac));
+ clib_memcpy_fast (t->new_dst_mac, en1->dst_address,
+ sizeof (t->new_dst_mac));
}
}
@@ -256,10 +256,10 @@ VLIB_NODE_FN (sample_node) (vlib_main_t * vm, vlib_node_runtime_t * node,
sample_trace_t *t = vlib_add_trace (vm, node, b0, sizeof (*t));
t->sw_if_index = sw_if_index0;
t->next_index = next0;
- clib_memcpy (t->new_src_mac, en0->src_address,
- sizeof (t->new_src_mac));
- clib_memcpy (t->new_dst_mac, en0->dst_address,
- sizeof (t->new_dst_mac));
+ clib_memcpy_fast (t->new_src_mac, en0->src_address,
+ sizeof (t->new_src_mac));
+ clib_memcpy_fast (t->new_dst_mac, en0->dst_address,
+ sizeof (t->new_dst_mac));
}
pkts_swapped += 1;
@@ -367,10 +367,10 @@ VLIB_NODE_FN (sample_node) (vlib_main_t * vm, vlib_node_runtime_t * node,
vlib_add_trace (vm, node, b0, sizeof (*t));
t->sw_if_index = sw_if_index0;
t->next_index = next0;
- clib_memcpy (t->new_src_mac, en0->src_address,
- sizeof (t->new_src_mac));
- clib_memcpy (t->new_dst_mac, en0->dst_address,
- sizeof (t->new_dst_mac));
+ clib_memcpy_fast (t->new_src_mac, en0->src_address,
+ sizeof (t->new_src_mac));
+ clib_memcpy_fast (t->new_dst_mac, en0->dst_address,
+ sizeof (t->new_dst_mac));
}
if (b1->flags & VLIB_BUFFER_IS_TRACED)
@@ -379,10 +379,10 @@ VLIB_NODE_FN (sample_node) (vlib_main_t * vm, vlib_node_runtime_t * node,
vlib_add_trace (vm, node, b1, sizeof (*t));
t->sw_if_index = sw_if_index1;
t->next_index = next1;
- clib_memcpy (t->new_src_mac, en1->src_address,
- sizeof (t->new_src_mac));
- clib_memcpy (t->new_dst_mac, en1->dst_address,
- sizeof (t->new_dst_mac));
+ clib_memcpy_fast (t->new_src_mac, en1->src_address,
+ sizeof (t->new_src_mac));
+ clib_memcpy_fast (t->new_dst_mac, en1->dst_address,
+ sizeof (t->new_dst_mac));
}
}
@@ -432,10 +432,10 @@ VLIB_NODE_FN (sample_node) (vlib_main_t * vm, vlib_node_runtime_t * node,
sample_trace_t *t = vlib_add_trace (vm, node, b0, sizeof (*t));
t->sw_if_index = sw_if_index0;
t->next_index = next0;
- clib_memcpy (t->new_src_mac, en0->src_address,
- sizeof (t->new_src_mac));
- clib_memcpy (t->new_dst_mac, en0->dst_address,
- sizeof (t->new_dst_mac));
+ clib_memcpy_fast (t->new_src_mac, en0->src_address,
+ sizeof (t->new_src_mac));
+ clib_memcpy_fast (t->new_dst_mac, en0->dst_address,
+ sizeof (t->new_dst_mac));
}
pkts_swapped += 1;
@@ -585,10 +585,10 @@ VLIB_NODE_FN (sample_node) (vlib_main_t * vm, vlib_node_runtime_t * node,
t->sw_if_index = vnet_buffer (b[0])->sw_if_index[VLIB_TX];
t->next_index = SAMPLE_NEXT_INTERFACE_OUTPUT;
en = vlib_buffer_get_current (b[0]);
- clib_memcpy (t->new_src_mac, en->src_address,
- sizeof (t->new_src_mac));
- clib_memcpy (t->new_dst_mac, en->dst_address,
- sizeof (t->new_dst_mac));
+ clib_memcpy_fast (t->new_src_mac, en->src_address,
+ sizeof (t->new_src_mac));
+ clib_memcpy_fast (t->new_dst_mac, en->dst_address,
+ sizeof (t->new_dst_mac));
b++;
}
else