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/devices/af_packet | |
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/devices/af_packet')
-rw-r--r-- | src/vnet/devices/af_packet/device.c | 6 | ||||
-rw-r--r-- | src/vnet/devices/af_packet/node.c | 16 |
2 files changed, 11 insertions, 11 deletions
diff --git a/src/vnet/devices/af_packet/device.c b/src/vnet/devices/af_packet/device.c index 811642ec7b9..9d08c620d94 100644 --- a/src/vnet/devices/af_packet/device.c +++ b/src/vnet/devices/af_packet/device.c @@ -119,9 +119,9 @@ af_packet_interface_tx (vlib_main_t * vm, { b0 = vlib_get_buffer (vm, bi); len = b0->current_length; - clib_memcpy ((u8 *) tph + - TPACKET_ALIGN (sizeof (struct tpacket2_hdr)) + offset, - vlib_buffer_get_current (b0), len); + clib_memcpy_fast ((u8 *) tph + + TPACKET_ALIGN (sizeof (struct tpacket2_hdr)) + + offset, vlib_buffer_get_current (b0), len); offset += len; } while ((bi = diff --git a/src/vnet/devices/af_packet/node.c b/src/vnet/devices/af_packet/node.c index 8dbd8554f01..97aa170c0a6 100644 --- a/src/vnet/devices/af_packet/node.c +++ b/src/vnet/devices/af_packet/node.c @@ -248,9 +248,9 @@ af_packet_device_input_fn (vlib_main_t * vm, vlib_node_runtime_t * node, { if (PREDICT_TRUE (offset == 0)) { - clib_memcpy (vlib_buffer_get_current (b0), - (u8 *) tph + tph->tp_mac, - sizeof (ethernet_header_t)); + clib_memcpy_fast (vlib_buffer_get_current (b0), + (u8 *) tph + tph->tp_mac, + sizeof (ethernet_header_t)); ethernet_header_t *eth = vlib_buffer_get_current (b0); ethernet_vlan_header_t *vlan = (ethernet_vlan_header_t *) (eth + 1); @@ -262,10 +262,10 @@ af_packet_device_input_fn (vlib_main_t * vm, vlib_node_runtime_t * node, bytes_copied = sizeof (ethernet_header_t); } } - clib_memcpy (((u8 *) vlib_buffer_get_current (b0)) + - bytes_copied + vlan_len, - (u8 *) tph + tph->tp_mac + offset + bytes_copied, - (bytes_to_copy - bytes_copied)); + clib_memcpy_fast (((u8 *) vlib_buffer_get_current (b0)) + + bytes_copied + vlan_len, + (u8 *) tph + tph->tp_mac + offset + + bytes_copied, (bytes_to_copy - bytes_copied)); /* fill buffer header */ b0->current_length = bytes_to_copy + vlan_len; @@ -319,7 +319,7 @@ af_packet_device_input_fn (vlib_main_t * vm, vlib_node_runtime_t * node, tr = vlib_add_trace (vm, node, first_b0, sizeof (*tr)); tr->next_index = next0; tr->hw_if_index = apif->hw_if_index; - clib_memcpy (&tr->tph, tph, sizeof (struct tpacket2_hdr)); + clib_memcpy_fast (&tr->tph, tph, sizeof (struct tpacket2_hdr)); } /* enque and take next packet */ |