summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat_ipfix_logging.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/nat/nat_ipfix_logging.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/nat/nat_ipfix_logging.c')
-rw-r--r--src/plugins/nat/nat_ipfix_logging.c108
1 files changed, 54 insertions, 54 deletions
diff --git a/src/plugins/nat/nat_ipfix_logging.c b/src/plugins/nat/nat_ipfix_logging.c
index 8a3668e2759..042239fee85 100644
--- a/src/plugins/nat/nat_ipfix_logging.c
+++ b/src/plugins/nat/nat_ipfix_logging.c
@@ -674,28 +674,28 @@ snat_ipfix_logging_nat44_ses (u8 nat_event, u32 src_ip, u32 nat_src_ip,
if (PREDICT_TRUE (do_flush == 0))
{
u64 time_stamp = clib_host_to_net_u64 (now);
- clib_memcpy (b0->data + offset, &time_stamp, sizeof (time_stamp));
+ clib_memcpy_fast (b0->data + offset, &time_stamp, sizeof (time_stamp));
offset += sizeof (time_stamp);
- clib_memcpy (b0->data + offset, &nat_event, sizeof (nat_event));
+ clib_memcpy_fast (b0->data + offset, &nat_event, sizeof (nat_event));
offset += sizeof (nat_event);
- clib_memcpy (b0->data + offset, &src_ip, sizeof (src_ip));
+ clib_memcpy_fast (b0->data + offset, &src_ip, sizeof (src_ip));
offset += sizeof (src_ip);
- clib_memcpy (b0->data + offset, &nat_src_ip, sizeof (nat_src_ip));
+ clib_memcpy_fast (b0->data + offset, &nat_src_ip, sizeof (nat_src_ip));
offset += sizeof (nat_src_ip);
- clib_memcpy (b0->data + offset, &proto, sizeof (proto));
+ clib_memcpy_fast (b0->data + offset, &proto, sizeof (proto));
offset += sizeof (proto);
- clib_memcpy (b0->data + offset, &src_port, sizeof (src_port));
+ clib_memcpy_fast (b0->data + offset, &src_port, sizeof (src_port));
offset += sizeof (src_port);
- clib_memcpy (b0->data + offset, &nat_src_port, sizeof (nat_src_port));
+ clib_memcpy_fast (b0->data + offset, &nat_src_port, sizeof (nat_src_port));
offset += sizeof (nat_src_port);
- clib_memcpy (b0->data + offset, &vrf_id, sizeof (vrf_id));
+ clib_memcpy_fast (b0->data + offset, &vrf_id, sizeof (vrf_id));
offset += sizeof (vrf_id);
b0->current_length += NAT44_SESSION_CREATE_LEN;
@@ -775,13 +775,13 @@ snat_ipfix_logging_addr_exhausted (u32 pool_id, int do_flush)
if (PREDICT_TRUE (do_flush == 0))
{
u64 time_stamp = clib_host_to_net_u64 (now);
- clib_memcpy (b0->data + offset, &time_stamp, sizeof (time_stamp));
+ clib_memcpy_fast (b0->data + offset, &time_stamp, sizeof (time_stamp));
offset += sizeof (time_stamp);
- clib_memcpy (b0->data + offset, &nat_event, sizeof (nat_event));
+ clib_memcpy_fast (b0->data + offset, &nat_event, sizeof (nat_event));
offset += sizeof (nat_event);
- clib_memcpy (b0->data + offset, &pool_id, sizeof (pool_id));
+ clib_memcpy_fast (b0->data + offset, &pool_id, sizeof (pool_id));
offset += sizeof (pool_id);
b0->current_length += NAT_ADDRESSES_EXHAUTED_LEN;
@@ -862,19 +862,19 @@ snat_ipfix_logging_max_entries_per_usr (u32 limit, u32 src_ip, int do_flush)
if (PREDICT_TRUE (do_flush == 0))
{
u64 time_stamp = clib_host_to_net_u64 (now);
- clib_memcpy (b0->data + offset, &time_stamp, sizeof (time_stamp));
+ clib_memcpy_fast (b0->data + offset, &time_stamp, sizeof (time_stamp));
offset += sizeof (time_stamp);
- clib_memcpy (b0->data + offset, &nat_event, sizeof (nat_event));
+ clib_memcpy_fast (b0->data + offset, &nat_event, sizeof (nat_event));
offset += sizeof (nat_event);
- clib_memcpy (b0->data + offset, &quota_event, sizeof (quota_event));
+ clib_memcpy_fast (b0->data + offset, &quota_event, sizeof (quota_event));
offset += sizeof (quota_event);
- clib_memcpy (b0->data + offset, &limit, sizeof (limit));
+ clib_memcpy_fast (b0->data + offset, &limit, sizeof (limit));
offset += sizeof (limit);
- clib_memcpy (b0->data + offset, &src_ip, sizeof (src_ip));
+ clib_memcpy_fast (b0->data + offset, &src_ip, sizeof (src_ip));
offset += sizeof (src_ip);
b0->current_length += MAX_ENTRIES_PER_USER_LEN;
@@ -955,16 +955,16 @@ nat_ipfix_logging_max_ses (u32 limit, int do_flush)
if (PREDICT_TRUE (do_flush == 0))
{
u64 time_stamp = clib_host_to_net_u64 (now);
- clib_memcpy (b0->data + offset, &time_stamp, sizeof (time_stamp));
+ clib_memcpy_fast (b0->data + offset, &time_stamp, sizeof (time_stamp));
offset += sizeof (time_stamp);
- clib_memcpy (b0->data + offset, &nat_event, sizeof (nat_event));
+ clib_memcpy_fast (b0->data + offset, &nat_event, sizeof (nat_event));
offset += sizeof (nat_event);
- clib_memcpy (b0->data + offset, &quota_event, sizeof (quota_event));
+ clib_memcpy_fast (b0->data + offset, &quota_event, sizeof (quota_event));
offset += sizeof (quota_event);
- clib_memcpy (b0->data + offset, &limit, sizeof (limit));
+ clib_memcpy_fast (b0->data + offset, &limit, sizeof (limit));
offset += sizeof (limit);
b0->current_length += MAX_SESSIONS_LEN;
@@ -1045,16 +1045,16 @@ nat_ipfix_logging_max_bib (u32 limit, int do_flush)
if (PREDICT_TRUE (do_flush == 0))
{
u64 time_stamp = clib_host_to_net_u64 (now);
- clib_memcpy (b0->data + offset, &time_stamp, sizeof (time_stamp));
+ clib_memcpy_fast (b0->data + offset, &time_stamp, sizeof (time_stamp));
offset += sizeof (time_stamp);
- clib_memcpy (b0->data + offset, &nat_event, sizeof (nat_event));
+ clib_memcpy_fast (b0->data + offset, &nat_event, sizeof (nat_event));
offset += sizeof (nat_event);
- clib_memcpy (b0->data + offset, &quota_event, sizeof (quota_event));
+ clib_memcpy_fast (b0->data + offset, &quota_event, sizeof (quota_event));
offset += sizeof (quota_event);
- clib_memcpy (b0->data + offset, &limit, sizeof (limit));
+ clib_memcpy_fast (b0->data + offset, &limit, sizeof (limit));
offset += sizeof (limit);
b0->current_length += MAX_BIBS_LEN;
@@ -1135,19 +1135,19 @@ nat_ipfix_logging_max_frag_ip4 (u32 limit, u32 src, int do_flush)
if (PREDICT_TRUE (do_flush == 0))
{
u64 time_stamp = clib_host_to_net_u64 (now);
- clib_memcpy (b0->data + offset, &time_stamp, sizeof (time_stamp));
+ clib_memcpy_fast (b0->data + offset, &time_stamp, sizeof (time_stamp));
offset += sizeof (time_stamp);
- clib_memcpy (b0->data + offset, &nat_event, sizeof (nat_event));
+ clib_memcpy_fast (b0->data + offset, &nat_event, sizeof (nat_event));
offset += sizeof (nat_event);
- clib_memcpy (b0->data + offset, &quota_event, sizeof (quota_event));
+ clib_memcpy_fast (b0->data + offset, &quota_event, sizeof (quota_event));
offset += sizeof (quota_event);
- clib_memcpy (b0->data + offset, &limit, sizeof (limit));
+ clib_memcpy_fast (b0->data + offset, &limit, sizeof (limit));
offset += sizeof (limit);
- clib_memcpy (b0->data + offset, &src, sizeof (src));
+ clib_memcpy_fast (b0->data + offset, &src, sizeof (src));
offset += sizeof (src);
b0->current_length += MAX_FRAGMENTS_IP4_LEN;
@@ -1228,19 +1228,19 @@ nat_ipfix_logging_max_frag_ip6 (u32 limit, ip6_address_t * src, int do_flush)
if (PREDICT_TRUE (do_flush == 0))
{
u64 time_stamp = clib_host_to_net_u64 (now);
- clib_memcpy (b0->data + offset, &time_stamp, sizeof (time_stamp));
+ clib_memcpy_fast (b0->data + offset, &time_stamp, sizeof (time_stamp));
offset += sizeof (time_stamp);
- clib_memcpy (b0->data + offset, &nat_event, sizeof (nat_event));
+ clib_memcpy_fast (b0->data + offset, &nat_event, sizeof (nat_event));
offset += sizeof (nat_event);
- clib_memcpy (b0->data + offset, &quota_event, sizeof (quota_event));
+ clib_memcpy_fast (b0->data + offset, &quota_event, sizeof (quota_event));
offset += sizeof (quota_event);
- clib_memcpy (b0->data + offset, &limit, sizeof (limit));
+ clib_memcpy_fast (b0->data + offset, &limit, sizeof (limit));
offset += sizeof (limit);
- clib_memcpy (b0->data + offset, src, sizeof (ip6_address_t));
+ clib_memcpy_fast (b0->data + offset, src, sizeof (ip6_address_t));
offset += sizeof (ip6_address_t);
b0->current_length += MAX_FRAGMENTS_IP6_LEN;
@@ -1321,28 +1321,28 @@ nat_ipfix_logging_nat64_bibe (u8 nat_event, ip6_address_t * src_ip,
if (PREDICT_TRUE (do_flush == 0))
{
u64 time_stamp = clib_host_to_net_u64 (now);
- clib_memcpy (b0->data + offset, &time_stamp, sizeof (time_stamp));
+ clib_memcpy_fast (b0->data + offset, &time_stamp, sizeof (time_stamp));
offset += sizeof (time_stamp);
- clib_memcpy (b0->data + offset, &nat_event, sizeof (nat_event));
+ clib_memcpy_fast (b0->data + offset, &nat_event, sizeof (nat_event));
offset += sizeof (nat_event);
- clib_memcpy (b0->data + offset, src_ip, sizeof (ip6_address_t));
+ clib_memcpy_fast (b0->data + offset, src_ip, sizeof (ip6_address_t));
offset += sizeof (ip6_address_t);
- clib_memcpy (b0->data + offset, &nat_src_ip, sizeof (nat_src_ip));
+ clib_memcpy_fast (b0->data + offset, &nat_src_ip, sizeof (nat_src_ip));
offset += sizeof (nat_src_ip);
- clib_memcpy (b0->data + offset, &proto, sizeof (proto));
+ clib_memcpy_fast (b0->data + offset, &proto, sizeof (proto));
offset += sizeof (proto);
- clib_memcpy (b0->data + offset, &src_port, sizeof (src_port));
+ clib_memcpy_fast (b0->data + offset, &src_port, sizeof (src_port));
offset += sizeof (src_port);
- clib_memcpy (b0->data + offset, &nat_src_port, sizeof (nat_src_port));
+ clib_memcpy_fast (b0->data + offset, &nat_src_port, sizeof (nat_src_port));
offset += sizeof (nat_src_port);
- clib_memcpy (b0->data + offset, &vrf_id, sizeof (vrf_id));
+ clib_memcpy_fast (b0->data + offset, &vrf_id, sizeof (vrf_id));
offset += sizeof (vrf_id);
b0->current_length += NAT64_BIB_LEN;
@@ -1425,40 +1425,40 @@ nat_ipfix_logging_nat64_ses (u8 nat_event, ip6_address_t * src_ip,
if (PREDICT_TRUE (do_flush == 0))
{
u64 time_stamp = clib_host_to_net_u64 (now);
- clib_memcpy (b0->data + offset, &time_stamp, sizeof (time_stamp));
+ clib_memcpy_fast (b0->data + offset, &time_stamp, sizeof (time_stamp));
offset += sizeof (time_stamp);
- clib_memcpy (b0->data + offset, &nat_event, sizeof (nat_event));
+ clib_memcpy_fast (b0->data + offset, &nat_event, sizeof (nat_event));
offset += sizeof (nat_event);
- clib_memcpy (b0->data + offset, src_ip, sizeof (ip6_address_t));
+ clib_memcpy_fast (b0->data + offset, src_ip, sizeof (ip6_address_t));
offset += sizeof (ip6_address_t);
- clib_memcpy (b0->data + offset, &nat_src_ip, sizeof (nat_src_ip));
+ clib_memcpy_fast (b0->data + offset, &nat_src_ip, sizeof (nat_src_ip));
offset += sizeof (nat_src_ip);
- clib_memcpy (b0->data + offset, &proto, sizeof (proto));
+ clib_memcpy_fast (b0->data + offset, &proto, sizeof (proto));
offset += sizeof (proto);
- clib_memcpy (b0->data + offset, &src_port, sizeof (src_port));
+ clib_memcpy_fast (b0->data + offset, &src_port, sizeof (src_port));
offset += sizeof (src_port);
- clib_memcpy (b0->data + offset, &nat_src_port, sizeof (nat_src_port));
+ clib_memcpy_fast (b0->data + offset, &nat_src_port, sizeof (nat_src_port));
offset += sizeof (nat_src_port);
- clib_memcpy (b0->data + offset, dst_ip, sizeof (ip6_address_t));
+ clib_memcpy_fast (b0->data + offset, dst_ip, sizeof (ip6_address_t));
offset += sizeof (ip6_address_t);
- clib_memcpy (b0->data + offset, &nat_dst_ip, sizeof (nat_dst_ip));
+ clib_memcpy_fast (b0->data + offset, &nat_dst_ip, sizeof (nat_dst_ip));
offset += sizeof (nat_dst_ip);
- clib_memcpy (b0->data + offset, &dst_port, sizeof (dst_port));
+ clib_memcpy_fast (b0->data + offset, &dst_port, sizeof (dst_port));
offset += sizeof (dst_port);
- clib_memcpy (b0->data + offset, &nat_dst_port, sizeof (nat_dst_port));
+ clib_memcpy_fast (b0->data + offset, &nat_dst_port, sizeof (nat_dst_port));
offset += sizeof (nat_dst_port);
- clib_memcpy (b0->data + offset, &vrf_id, sizeof (vrf_id));
+ clib_memcpy_fast (b0->data + offset, &vrf_id, sizeof (vrf_id));
offset += sizeof (vrf_id);
b0->current_length += NAT64_SES_LEN;