aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk/device/device.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/dpdk/device/device.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/dpdk/device/device.c')
-rw-r--r--src/plugins/dpdk/device/device.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/plugins/dpdk/device/device.c b/src/plugins/dpdk/device/device.c
index ea00df25a25..9b54f34a5b2 100644
--- a/src/plugins/dpdk/device/device.c
+++ b/src/plugins/dpdk/device/device.c
@@ -80,12 +80,13 @@ dpdk_tx_trace_buffer (dpdk_main_t * dm, vlib_node_runtime_t * node,
t0->queue_index = queue_id;
t0->device_index = xd->device_index;
t0->buffer_index = vlib_get_buffer_index (vm, buffer);
- clib_memcpy (&t0->mb, mb, sizeof (t0->mb));
- clib_memcpy (&t0->buffer, buffer,
- sizeof (buffer[0]) - sizeof (buffer->pre_data));
- clib_memcpy (t0->buffer.pre_data, buffer->data + buffer->current_data,
- sizeof (t0->buffer.pre_data));
- clib_memcpy (&t0->data, mb->buf_addr + mb->data_off, sizeof (t0->data));
+ clib_memcpy_fast (&t0->mb, mb, sizeof (t0->mb));
+ clib_memcpy_fast (&t0->buffer, buffer,
+ sizeof (buffer[0]) - sizeof (buffer->pre_data));
+ clib_memcpy_fast (t0->buffer.pre_data, buffer->data + buffer->current_data,
+ sizeof (t0->buffer.pre_data));
+ clib_memcpy_fast (&t0->data, mb->buf_addr + mb->data_off,
+ sizeof (t0->data));
}
static_always_inline void
@@ -430,10 +431,10 @@ dpdk_clear_hw_interface_counters (u32 instance)
*/
dpdk_update_counters (xd, vlib_time_now (dm->vlib_main));
- clib_memcpy (&xd->last_cleared_stats, &xd->stats, sizeof (xd->stats));
- clib_memcpy (xd->last_cleared_xstats, xd->xstats,
- vec_len (xd->last_cleared_xstats) *
- sizeof (xd->last_cleared_xstats[0]));
+ clib_memcpy_fast (&xd->last_cleared_stats, &xd->stats, sizeof (xd->stats));
+ clib_memcpy_fast (xd->last_cleared_xstats, xd->xstats,
+ vec_len (xd->last_cleared_xstats) *
+ sizeof (xd->last_cleared_xstats[0]));
}