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/session_rules_table.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/session_rules_table.c')
-rw-r--r-- | src/vnet/session/session_rules_table.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/vnet/session/session_rules_table.c b/src/vnet/session/session_rules_table.c index 33f7de07944..6304606ca43 100644 --- a/src/vnet/session/session_rules_table.c +++ b/src/vnet/session/session_rules_table.c @@ -270,8 +270,10 @@ session_rules_table_init_rule_40 (mma_rule_40_t * rule, fib_pref_normalize (lcl); fib_pref_normalize (rmt); match = (session_mask_or_match_6_t *) & rule->match; - clib_memcpy (&match->lcl_ip, &lcl->fp_addr.ip6, sizeof (match->lcl_ip)); - clib_memcpy (&match->rmt_ip, &rmt->fp_addr.ip6, sizeof (match->rmt_ip)); + clib_memcpy_fast (&match->lcl_ip, &lcl->fp_addr.ip6, + sizeof (match->lcl_ip)); + clib_memcpy_fast (&match->rmt_ip, &rmt->fp_addr.ip6, + sizeof (match->rmt_ip)); match->lcl_port = lcl_port; match->rmt_port = rmt_port; mask = (session_mask_or_match_6_t *) & rule->mask; @@ -355,8 +357,8 @@ session_rules_table_lookup_rule6 (session_rules_table_t * srt, .lcl_port = lcl_port, .rmt_port = rmt_port, }; - clib_memcpy (&key.lcl_ip, lcl_ip, sizeof (*lcl_ip)); - clib_memcpy (&key.rmt_ip, rmt_ip, sizeof (*rmt_ip)); + clib_memcpy_fast (&key.lcl_ip, lcl_ip, sizeof (*lcl_ip)); + clib_memcpy_fast (&key.rmt_ip, rmt_ip, sizeof (*rmt_ip)); return mma_rules_table_lookup_rule_40 (srt6, (mma_mask_or_match_40_t *) & key, srt6->root_index); @@ -372,8 +374,8 @@ session_rules_table_lookup6 (session_rules_table_t * srt, .lcl_port = lcl_port, .rmt_port = rmt_port, }; - clib_memcpy (&key.lcl_ip, lcl_ip, sizeof (*lcl_ip)); - clib_memcpy (&key.rmt_ip, rmt_ip, sizeof (*rmt_ip)); + clib_memcpy_fast (&key.lcl_ip, lcl_ip, sizeof (*lcl_ip)); + clib_memcpy_fast (&key.rmt_ip, rmt_ip, sizeof (*rmt_ip)); return mma_rules_table_lookup_40 (srt6, (mma_mask_or_match_40_t *) & key, srt6->root_index); } @@ -577,8 +579,8 @@ session_rules_table_show_rule (vlib_main_t * vm, session_rules_table_t * srt, .lcl_port = lcl_port, .rmt_port = rmt_port, }; - clib_memcpy (&key.lcl_ip, &lcl_ip->ip6, sizeof (lcl_ip->ip6)); - clib_memcpy (&key.rmt_ip, &rmt_ip->ip6, sizeof (rmt_ip->ip6)); + clib_memcpy_fast (&key.lcl_ip, &lcl_ip->ip6, sizeof (lcl_ip->ip6)); + clib_memcpy_fast (&key.rmt_ip, &rmt_ip->ip6, sizeof (rmt_ip->ip6)); ri = mma_rules_table_lookup_rule_40 (srt6, (mma_mask_or_match_40_t *) & key, srt6->root_index); |