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/vnet/session-apps/echo_client.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/vnet/session-apps/echo_client.c')
-rw-r--r-- | src/vnet/session-apps/echo_client.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/vnet/session-apps/echo_client.c b/src/vnet/session-apps/echo_client.c index 7935eb8b242..faf8521ce8c 100644 --- a/src/vnet/session-apps/echo_client.c +++ b/src/vnet/session-apps/echo_client.c @@ -86,10 +86,12 @@ send_data_chunk (echo_client_main_t * ecm, eclient_session_t * s) hdr.data_length = rv; hdr.data_offset = 0; - clib_memcpy (&hdr.rmt_ip, &at->rmt_ip, sizeof (ip46_address_t)); + clib_memcpy_fast (&hdr.rmt_ip, &at->rmt_ip, + sizeof (ip46_address_t)); hdr.is_ip4 = at->is_ip4; hdr.rmt_port = at->rmt_port; - clib_memcpy (&hdr.lcl_ip, &at->lcl_ip, sizeof (ip46_address_t)); + clib_memcpy_fast (&hdr.lcl_ip, &at->lcl_ip, + sizeof (ip46_address_t)); hdr.lcl_port = at->lcl_port; svm_fifo_enqueue_nowait (f, sizeof (hdr), (u8 *) & hdr); svm_fifo_enqueue_nocopy (f, rv); @@ -221,10 +223,10 @@ echo_client_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node, ASSERT (nconnections_this_batch > 0); vec_validate (connections_this_batch, nconnections_this_batch - 1); - clib_memcpy (connections_this_batch, - connection_indices + vec_len (connection_indices) - - nconnections_this_batch, - nconnections_this_batch * sizeof (u32)); + clib_memcpy_fast (connections_this_batch, + connection_indices + vec_len (connection_indices) + - nconnections_this_batch, + nconnections_this_batch * sizeof (u32)); _vec_len (connection_indices) -= nconnections_this_batch; } @@ -402,8 +404,8 @@ echo_clients_session_connected_callback (u32 app_index, u32 api_context, { transport_connection_t *tc; tc = session_get_transport (s); - clib_memcpy (&session->data.transport, tc, - sizeof (session->data.transport)); + clib_memcpy_fast (&session->data.transport, tc, + sizeof (session->data.transport)); session->data.is_dgram = 1; } |