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/srp | |
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/srp')
-rw-r--r-- | src/vnet/srp/interface.c | 2 | ||||
-rw-r--r-- | src/vnet/srp/node.c | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/vnet/srp/interface.c b/src/vnet/srp/interface.c index 28e519986f0..3c98f416781 100644 --- a/src/vnet/srp/interface.c +++ b/src/vnet/srp/interface.c @@ -289,7 +289,7 @@ simulated_srp_interface_tx (vlib_main_t * vm, n_copy = clib_min (n_left_from, n_left_to_next); - clib_memcpy (to_next, from, n_copy * sizeof (from[0])); + clib_memcpy_fast (to_next, from, n_copy * sizeof (from[0])); n_left_to_next -= n_copy; n_left_from -= n_copy; for (i = 0; i < n_copy; i++) diff --git a/src/vnet/srp/node.c b/src/vnet/srp/node.c index 7cbc71b39ae..cec014f987d 100644 --- a/src/vnet/srp/node.c +++ b/src/vnet/srp/node.c @@ -309,7 +309,7 @@ srp_topology_packet (vlib_main_t * vm, u32 sw_if_index, u8 ** contents) return SRP_ERROR_TOPOLOGY_BAD_LENGTH; /* Fill in our source MAC address. */ - clib_memcpy (t->ethernet.src_address, hi->hw_address, vec_len (hi->hw_address)); + clib_memcpy_fast (t->ethernet.src_address, hi->hw_address, vec_len (hi->hw_address)); /* Make space for our MAC binding. */ vec_resize (*contents, sizeof (srp_topology_mac_binding_t)); @@ -321,7 +321,7 @@ srp_topology_packet (vlib_main_t * vm, u32 sw_if_index, u8 ** contents) mb->flags = ((t->srp.is_inner_ring ? SRP_TOPOLOGY_MAC_BINDING_FLAG_IS_INNER_RING : 0) | (/* is wrapped FIXME */ 0)); - clib_memcpy (mb->address, hi->hw_address, vec_len (hi->hw_address)); + clib_memcpy_fast (mb->address, hi->hw_address, vec_len (hi->hw_address)); t->control.checksum = ~ip_csum_fold (ip_incremental_checksum (0, &t->control, @@ -588,7 +588,7 @@ static void init_ips_packet (srp_interface_t * si, i->srp.mode = SRP_MODE_control_locally_buffered_for_host; srp_header_compute_parity (&i->srp); - clib_memcpy (&i->ethernet.src_address, &si->my_address, sizeof (si->my_address)); + clib_memcpy_fast (&i->ethernet.src_address, &si->my_address, sizeof (si->my_address)); i->ethernet.type = clib_host_to_net_u16 (ETHERNET_TYPE_SRP_CONTROL); /* Checksum will be filled in later. */ @@ -596,7 +596,7 @@ static void init_ips_packet (srp_interface_t * si, i->control.type = SRP_CONTROL_PACKET_TYPE_ips; i->control.ttl = 255; - clib_memcpy (&i->originator_address, &si->my_address, sizeof (si->my_address)); + clib_memcpy_fast (&i->originator_address, &si->my_address, sizeof (si->my_address)); } static void tx_ips_packet (srp_interface_t * si, @@ -680,7 +680,7 @@ void srp_ips_rx_packet (u32 sw_if_index, srp_ips_header_t * h) ASSERT (0); } ir->rx_neighbor_address_valid = 1; - clib_memcpy (ir->rx_neighbor_address, h->originator_address, sizeof (ir->rx_neighbor_address)); + clib_memcpy_fast (ir->rx_neighbor_address, h->originator_address, sizeof (ir->rx_neighbor_address)); } switch (si->current_ips_state) |