summaryrefslogtreecommitdiffstats
path: root/src/plugins/memif/node.c
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/memif/node.c
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/memif/node.c')
-rw-r--r--src/plugins/memif/node.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/plugins/memif/node.c b/src/plugins/memif/node.c
index 997ac8fcbad..8bd9fcddcb6 100644
--- a/src/plugins/memif/node.c
+++ b/src/plugins/memif/node.c
@@ -303,14 +303,14 @@ memif_device_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
b2 = vlib_get_buffer (vm, ptd->buffers[co[2].buffer_vec_index]);
b3 = vlib_get_buffer (vm, ptd->buffers[co[3].buffer_vec_index]);
- clib_memcpy (b0->data + co[0].buffer_offset, co[0].data,
- co[0].data_len);
- clib_memcpy (b1->data + co[1].buffer_offset, co[1].data,
- co[1].data_len);
- clib_memcpy (b2->data + co[2].buffer_offset, co[2].data,
- co[2].data_len);
- clib_memcpy (b3->data + co[3].buffer_offset, co[3].data,
- co[3].data_len);
+ clib_memcpy_fast (b0->data + co[0].buffer_offset, co[0].data,
+ co[0].data_len);
+ clib_memcpy_fast (b1->data + co[1].buffer_offset, co[1].data,
+ co[1].data_len);
+ clib_memcpy_fast (b2->data + co[2].buffer_offset, co[2].data,
+ co[2].data_len);
+ clib_memcpy_fast (b3->data + co[3].buffer_offset, co[3].data,
+ co[3].data_len);
co += 4;
n_left -= 4;
@@ -318,8 +318,8 @@ memif_device_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
while (n_left)
{
b0 = vlib_get_buffer (vm, ptd->buffers[co[0].buffer_vec_index]);
- clib_memcpy (b0->data + co[0].buffer_offset, co[0].data,
- co[0].data_len);
+ clib_memcpy_fast (b0->data + co[0].buffer_offset, co[0].data,
+ co[0].data_len);
co += 1;
n_left -= 1;
}
@@ -424,7 +424,7 @@ memif_device_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
fbvi[0] = po[0].first_buffer_vec_index;
bi[0] = ptd->buffers[fbvi[0]];
b0 = vlib_get_buffer (vm, bi[0]);
- clib_memcpy (b0, bt, 64);
+ clib_memcpy_fast (b0, bt, 64);
b0->current_length = po->packet_len;
n_rx_bytes += b0->current_length;
@@ -783,10 +783,10 @@ refill:
d2 = &ring->desc[s2];
d3 = &ring->desc[s3];
- clib_memcpy (d0, dt, sizeof (memif_desc_t));
- clib_memcpy (d1, dt, sizeof (memif_desc_t));
- clib_memcpy (d2, dt, sizeof (memif_desc_t));
- clib_memcpy (d3, dt, sizeof (memif_desc_t));
+ clib_memcpy_fast (d0, dt, sizeof (memif_desc_t));
+ clib_memcpy_fast (d1, dt, sizeof (memif_desc_t));
+ clib_memcpy_fast (d2, dt, sizeof (memif_desc_t));
+ clib_memcpy_fast (d3, dt, sizeof (memif_desc_t));
b0 = vlib_get_buffer (vm, mq->buffers[s0]);
b1 = vlib_get_buffer (vm, mq->buffers[s1]);
@@ -813,7 +813,7 @@ refill:
{
s0 = head++ & mask;
d0 = &ring->desc[s0];
- clib_memcpy (d0, dt, sizeof (memif_desc_t));
+ clib_memcpy_fast (d0, dt, sizeof (memif_desc_t));
b0 = vlib_get_buffer (vm, mq->buffers[s0]);
d0->region = b0->buffer_pool_index + 1;
d0->offset =