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/l2/l2_fib.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/l2/l2_fib.c')
-rw-r--r-- | src/vnet/l2/l2_fib.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/vnet/l2/l2_fib.c b/src/vnet/l2/l2_fib.c index 48be42e8ce9..fc518fe9dbf 100644 --- a/src/vnet/l2/l2_fib.c +++ b/src/vnet/l2/l2_fib.c @@ -83,7 +83,7 @@ incr_mac_address (u8 * mac) tmp += 1 << 16; /* skip unused (least significant) octets */ tmp = clib_host_to_net_u64 (tmp); - clib_memcpy (mac, &tmp, 6); + clib_memcpy_fast (mac, &tmp, 6); } /** Format sw_if_index. If the value is ~0, use the text "N/A" */ @@ -584,7 +584,7 @@ l2fib_test_command_fn (vlib_main_t * vm, return clib_error_return (0, "noop: pick at least one of (add,del,check)"); - clib_memcpy (save_mac, mac, 6); + clib_memcpy_fast (save_mac, mac, 6); if (is_add) { @@ -601,7 +601,7 @@ l2fib_test_command_fn (vlib_main_t * vm, BVT (clib_bihash_kv) kv; l2fib_main_t *mp = &l2fib_main; - clib_memcpy (mac, save_mac, 6); + clib_memcpy_fast (mac, save_mac, 6); for (i = 0; i < count; i++) { @@ -617,7 +617,7 @@ l2fib_test_command_fn (vlib_main_t * vm, if (is_del) { - clib_memcpy (mac, save_mac, 6); + clib_memcpy_fast (mac, save_mac, 6); for (i = 0; i < count; i++) { @@ -1071,8 +1071,8 @@ l2fib_scan (vlib_main_t * vm, f64 start_time, u8 event_only) if (l2fib_entry_result_is_set_LRN_EVT (&result)) { /* copy mac entry to event msg */ - clib_memcpy (mp->mac[evt_idx].mac_addr, key.fields.mac, - 6); + clib_memcpy_fast (mp->mac[evt_idx].mac_addr, + key.fields.mac, 6); mp->mac[evt_idx].action = l2fib_entry_result_is_set_LRN_MOV (&result) ? MAC_EVENT_ACTION_MOVE : MAC_EVENT_ACTION_ADD; @@ -1116,7 +1116,8 @@ l2fib_scan (vlib_main_t * vm, f64 start_time, u8 event_only) if (client) { /* copy mac entry to event msg */ - clib_memcpy (mp->mac[evt_idx].mac_addr, key.fields.mac, 6); + clib_memcpy_fast (mp->mac[evt_idx].mac_addr, key.fields.mac, + 6); mp->mac[evt_idx].action = MAC_EVENT_ACTION_DELETE; mp->mac[evt_idx].sw_if_index = htonl (result.fields.sw_if_index); |