diff options
author | 2016-03-13 02:22:06 +0100 | |
---|---|---|
committer | 2016-04-22 17:29:47 +0200 | |
commit | f1213b82771ce929c076339c24a777cfd59690e6 (patch) | |
tree | 3c74305e8848047d8ccd1228ee511d57cbf1b1a6 /vnet/vnet/l2 | |
parent | 2b836cf4d1e4e59ca34229a9fdf49d79216da20e (diff) |
Add clib_memcpy macro based on DPDK rte_memcpy implementation
Change-Id: I22cb443c4bd0bf298abb6f06e8e4ca65a44a2854
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'vnet/vnet/l2')
-rw-r--r-- | vnet/vnet/l2/l2_efp_filter.c | 18 | ||||
-rw-r--r-- | vnet/vnet/l2/l2_flood.c | 12 | ||||
-rw-r--r-- | vnet/vnet/l2/l2_fwd.c | 12 | ||||
-rw-r--r-- | vnet/vnet/l2/l2_input.c | 12 | ||||
-rw-r--r-- | vnet/vnet/l2/l2_input_vtr.c | 18 | ||||
-rw-r--r-- | vnet/vnet/l2/l2_learn.c | 12 | ||||
-rw-r--r-- | vnet/vnet/l2/l2_output.c | 12 | ||||
-rw-r--r-- | vnet/vnet/l2/l2_output_acl.c | 12 | ||||
-rw-r--r-- | vnet/vnet/l2/l2_rw.c | 4 |
9 files changed, 56 insertions, 56 deletions
diff --git a/vnet/vnet/l2/l2_efp_filter.c b/vnet/vnet/l2/l2_efp_filter.c index a8bceca1..b865c375 100644 --- a/vnet/vnet/l2/l2_efp_filter.c +++ b/vnet/vnet/l2/l2_efp_filter.c @@ -347,18 +347,18 @@ l2_efp_filter_node_fn (vlib_main_t * vm, l2_efp_filter_trace_t *t = vlib_add_trace (vm, node, b0, sizeof (*t)); t->sw_if_index = sw_if_index0; - memcpy(t->src, h0->src_address, 6); - memcpy(t->dst, h0->dst_address, 6); - memcpy(t->raw, &h0->type, sizeof(t->raw)); + clib_memcpy(t->src, h0->src_address, 6); + clib_memcpy(t->dst, h0->dst_address, 6); + clib_memcpy(t->raw, &h0->type, sizeof(t->raw)); } if (b1->flags & VLIB_BUFFER_IS_TRACED) { ethernet_header_t * h1 = vlib_buffer_get_current (b1); l2_efp_filter_trace_t *t = vlib_add_trace (vm, node, b1, sizeof (*t)); t->sw_if_index = sw_if_index1; - memcpy(t->src, h1->src_address, 6); - memcpy(t->dst, h1->dst_address, 6); - memcpy(t->raw, &h1->type, sizeof(t->raw)); + clib_memcpy(t->src, h1->src_address, 6); + clib_memcpy(t->dst, h1->dst_address, 6); + clib_memcpy(t->raw, &h1->type, sizeof(t->raw)); } } @@ -462,9 +462,9 @@ l2_efp_filter_node_fn (vlib_main_t * vm, l2_efp_filter_trace_t *t = vlib_add_trace (vm, node, b0, sizeof (*t)); t->sw_if_index = sw_if_index0; - memcpy(t->src, h0->src_address, 6); - memcpy(t->dst, h0->dst_address, 6); - memcpy(t->raw, &h0->type, sizeof(t->raw)); + clib_memcpy(t->src, h0->src_address, 6); + clib_memcpy(t->dst, h0->dst_address, 6); + clib_memcpy(t->raw, &h0->type, sizeof(t->raw)); } /* verify speculative enqueue, maybe switch current next frame */ diff --git a/vnet/vnet/l2/l2_flood.c b/vnet/vnet/l2/l2_flood.c index e0c4bb7a..ca8c171c 100644 --- a/vnet/vnet/l2/l2_flood.c +++ b/vnet/vnet/l2/l2_flood.c @@ -350,8 +350,8 @@ l2flood_node_fn (vlib_main_t * vm, ethernet_header_t * h0 = vlib_buffer_get_current (b0); t->sw_if_index = sw_if_index0; t->bd_index = vnet_buffer(b0)->l2.bd_index; - memcpy(t->src, h0->src_address, 6); - memcpy(t->dst, h0->dst_address, 6); + clib_memcpy(t->src, h0->src_address, 6); + clib_memcpy(t->dst, h0->dst_address, 6); } if (PREDICT_FALSE(b1->flags & VLIB_BUFFER_IS_TRACED)) { @@ -359,8 +359,8 @@ l2flood_node_fn (vlib_main_t * vm, ethernet_header_t * h1 = vlib_buffer_get_current (b1); t->sw_if_index = sw_if_index1; t->bd_index = vnet_buffer(b1)->l2.bd_index; - memcpy(t->src, h1->src_address, 6); - memcpy(t->dst, h1->dst_address, 6); + clib_memcpy(t->src, h1->src_address, 6); + clib_memcpy(t->dst, h1->dst_address, 6); } } @@ -406,8 +406,8 @@ l2flood_node_fn (vlib_main_t * vm, ethernet_header_t * h0 = vlib_buffer_get_current (b0); t->sw_if_index = sw_if_index0; t->bd_index = vnet_buffer(b0)->l2.bd_index; - memcpy(t->src, h0->src_address, 6); - memcpy(t->dst, h0->dst_address, 6); + clib_memcpy(t->src, h0->src_address, 6); + clib_memcpy(t->dst, h0->dst_address, 6); } /* verify speculative enqueue, maybe switch current next frame */ diff --git a/vnet/vnet/l2/l2_fwd.c b/vnet/vnet/l2/l2_fwd.c index 089d4008..88a6b69c 100644 --- a/vnet/vnet/l2/l2_fwd.c +++ b/vnet/vnet/l2/l2_fwd.c @@ -250,8 +250,8 @@ l2fwd_node_fn (vlib_main_t * vm, vlib_add_trace (vm, node, b0, sizeof (*t)); t->sw_if_index = sw_if_index0; t->bd_index = vnet_buffer(b0)->l2.bd_index; - memcpy(t->src, h0->src_address, 6); - memcpy(t->dst, h0->dst_address, 6); + clib_memcpy(t->src, h0->src_address, 6); + clib_memcpy(t->dst, h0->dst_address, 6); } if (b1->flags & VLIB_BUFFER_IS_TRACED) { @@ -259,8 +259,8 @@ l2fwd_node_fn (vlib_main_t * vm, vlib_add_trace (vm, node, b1, sizeof (*t)); t->sw_if_index = sw_if_index1; t->bd_index = vnet_buffer(b1)->l2.bd_index; - memcpy(t->src, h1->src_address, 6); - memcpy(t->dst, h1->dst_address, 6); + clib_memcpy(t->src, h1->src_address, 6); + clib_memcpy(t->dst, h1->dst_address, 6); } } @@ -320,8 +320,8 @@ l2fwd_node_fn (vlib_main_t * vm, vlib_add_trace (vm, node, b0, sizeof (*t)); t->sw_if_index = sw_if_index0; t->bd_index = vnet_buffer(b0)->l2.bd_index; - memcpy(t->src, h0->src_address, 6); - memcpy(t->dst, h0->dst_address, 6); + clib_memcpy(t->src, h0->src_address, 6); + clib_memcpy(t->dst, h0->dst_address, 6); } /* process 1 pkt */ diff --git a/vnet/vnet/l2/l2_input.c b/vnet/vnet/l2/l2_input.c index 3d3d51f5..ee8f788f 100644 --- a/vnet/vnet/l2/l2_input.c +++ b/vnet/vnet/l2/l2_input.c @@ -338,16 +338,16 @@ l2input_node_fn (vlib_main_t * vm, l2input_trace_t *t = vlib_add_trace (vm, node, b0, sizeof (*t)); t->sw_if_index = sw_if_index0; - memcpy(t->src, h0->src_address, 6); - memcpy(t->dst, h0->dst_address, 6); + clib_memcpy(t->src, h0->src_address, 6); + clib_memcpy(t->dst, h0->dst_address, 6); } if (b1->flags & VLIB_BUFFER_IS_TRACED) { ethernet_header_t * h1 = vlib_buffer_get_current (b1); l2input_trace_t *t = vlib_add_trace (vm, node, b1, sizeof (*t)); t->sw_if_index = sw_if_index1; - memcpy(t->src, h1->src_address, 6); - memcpy(t->dst, h1->dst_address, 6); + clib_memcpy(t->src, h1->src_address, 6); + clib_memcpy(t->dst, h1->dst_address, 6); } } @@ -398,8 +398,8 @@ l2input_node_fn (vlib_main_t * vm, vlib_add_trace (vm, node, b0, sizeof (*t)); sw_if_index0 = vnet_buffer(b0)->sw_if_index[VLIB_RX]; t->sw_if_index = sw_if_index0; - memcpy(t->src, h0->src_address, 6); - memcpy(t->dst, h0->dst_address, 6); + clib_memcpy(t->src, h0->src_address, 6); + clib_memcpy(t->dst, h0->dst_address, 6); } em->counters[node_counter_base_index + L2INPUT_ERROR_L2INPUT] += 1; diff --git a/vnet/vnet/l2/l2_input_vtr.c b/vnet/vnet/l2/l2_input_vtr.c index d07a0287..bbef33a9 100644 --- a/vnet/vnet/l2/l2_input_vtr.c +++ b/vnet/vnet/l2/l2_input_vtr.c @@ -189,18 +189,18 @@ l2_invtr_node_fn (vlib_main_t * vm, vlib_add_trace (vm, node, b0, sizeof (*t)); ethernet_header_t * h0 = vlib_buffer_get_current (b0); t->sw_if_index = sw_if_index0; - memcpy(t->src, h0->src_address, 6); - memcpy(t->dst, h0->dst_address, 6); - memcpy(t->raw, &h0->type, sizeof(t->raw)); + clib_memcpy(t->src, h0->src_address, 6); + clib_memcpy(t->dst, h0->dst_address, 6); + clib_memcpy(t->raw, &h0->type, sizeof(t->raw)); } if (b1->flags & VLIB_BUFFER_IS_TRACED) { l2_invtr_trace_t *t = vlib_add_trace (vm, node, b1, sizeof (*t)); ethernet_header_t * h1 = vlib_buffer_get_current (b1); t->sw_if_index = sw_if_index0; - memcpy(t->src, h1->src_address, 6); - memcpy(t->dst, h1->dst_address, 6); - memcpy(t->raw, &h1->type, sizeof(t->raw)); + clib_memcpy(t->src, h1->src_address, 6); + clib_memcpy(t->dst, h1->dst_address, 6); + clib_memcpy(t->raw, &h1->type, sizeof(t->raw)); } } @@ -257,9 +257,9 @@ l2_invtr_node_fn (vlib_main_t * vm, vlib_add_trace (vm, node, b0, sizeof (*t)); ethernet_header_t * h0 = vlib_buffer_get_current (b0); t->sw_if_index = sw_if_index0; - memcpy(t->src, h0->src_address, 6); - memcpy(t->dst, h0->dst_address, 6); - memcpy(t->raw, &h0->type, sizeof(t->raw)); + clib_memcpy(t->src, h0->src_address, 6); + clib_memcpy(t->dst, h0->dst_address, 6); + clib_memcpy(t->raw, &h0->type, sizeof(t->raw)); } /* verify speculative enqueue, maybe switch current next frame */ diff --git a/vnet/vnet/l2/l2_learn.c b/vnet/vnet/l2/l2_learn.c index 29315bed..a891cb3c 100644 --- a/vnet/vnet/l2/l2_learn.c +++ b/vnet/vnet/l2/l2_learn.c @@ -291,8 +291,8 @@ l2learn_node_fn (vlib_main_t * vm, vlib_add_trace (vm, node, b0, sizeof (*t)); t->sw_if_index = sw_if_index0; t->bd_index = vnet_buffer(b0)->l2.bd_index; - memcpy(t->src, h0->src_address, 6); - memcpy(t->dst, h0->dst_address, 6); + clib_memcpy(t->src, h0->src_address, 6); + clib_memcpy(t->dst, h0->dst_address, 6); } if (b1->flags & VLIB_BUFFER_IS_TRACED) { @@ -300,8 +300,8 @@ l2learn_node_fn (vlib_main_t * vm, vlib_add_trace (vm, node, b1, sizeof (*t)); t->sw_if_index = sw_if_index1; t->bd_index = vnet_buffer(b1)->l2.bd_index; - memcpy(t->src, h1->src_address, 6); - memcpy(t->dst, h1->dst_address, 6); + clib_memcpy(t->src, h1->src_address, 6); + clib_memcpy(t->dst, h1->dst_address, 6); } } @@ -366,8 +366,8 @@ l2learn_node_fn (vlib_main_t * vm, vlib_add_trace (vm, node, b0, sizeof (*t)); t->sw_if_index = sw_if_index0; t->bd_index = vnet_buffer(b0)->l2.bd_index; - memcpy(t->src, h0->src_address, 6); - memcpy(t->dst, h0->dst_address, 6); + clib_memcpy(t->src, h0->src_address, 6); + clib_memcpy(t->dst, h0->dst_address, 6); } /* process 1 pkt */ diff --git a/vnet/vnet/l2/l2_output.c b/vnet/vnet/l2/l2_output.c index bea640c8..a550d075 100644 --- a/vnet/vnet/l2/l2_output.c +++ b/vnet/vnet/l2/l2_output.c @@ -192,16 +192,16 @@ l2output_node_fn (vlib_main_t * vm, l2output_trace_t *t = vlib_add_trace (vm, node, b0, sizeof (*t)); t->sw_if_index = sw_if_index0; - memcpy(t->src, h0->src_address, 6); - memcpy(t->dst, h0->dst_address, 6); + clib_memcpy(t->src, h0->src_address, 6); + clib_memcpy(t->dst, h0->dst_address, 6); } if (b1->flags & VLIB_BUFFER_IS_TRACED) { l2output_trace_t *t = vlib_add_trace (vm, node, b1, sizeof (*t)); t->sw_if_index = sw_if_index1; - memcpy(t->src, h1->src_address, 6); - memcpy(t->dst, h1->dst_address, 6); + clib_memcpy(t->src, h1->src_address, 6); + clib_memcpy(t->dst, h1->dst_address, 6); } } @@ -329,8 +329,8 @@ l2output_node_fn (vlib_main_t * vm, vlib_add_trace (vm, node, b0, sizeof (*t)); t->sw_if_index = sw_if_index0; h0 = vlib_buffer_get_current (b0); - memcpy(t->src, h0->src_address, 6); - memcpy(t->dst, h0->dst_address, 6); + clib_memcpy(t->src, h0->src_address, 6); + clib_memcpy(t->dst, h0->dst_address, 6); } em->counters[node_counter_base_index + L2OUTPUT_ERROR_L2OUTPUT] += 1; diff --git a/vnet/vnet/l2/l2_output_acl.c b/vnet/vnet/l2/l2_output_acl.c index 2f6c1dce..f75345f1 100644 --- a/vnet/vnet/l2/l2_output_acl.c +++ b/vnet/vnet/l2/l2_output_acl.c @@ -165,8 +165,8 @@ l2_outacl_node_fn (vlib_main_t * vm, vlib_add_trace (vm, node, b0, sizeof (*t)); t->sw_if_index = sw_if_index0; t->next_index = next0; - memcpy(t->src, h0->src_address, 6); - memcpy(t->dst, h0->dst_address, 6); + clib_memcpy(t->src, h0->src_address, 6); + clib_memcpy(t->dst, h0->dst_address, 6); } if (b1->flags & VLIB_BUFFER_IS_TRACED) { @@ -174,8 +174,8 @@ l2_outacl_node_fn (vlib_main_t * vm, vlib_add_trace (vm, node, b1, sizeof (*t)); t->sw_if_index = sw_if_index1; t->next_index = next1; - memcpy(t->src, h1->src_address, 6); - memcpy(t->dst, h1->dst_address, 6); + clib_memcpy(t->src, h1->src_address, 6); + clib_memcpy(t->dst, h1->dst_address, 6); } } @@ -217,8 +217,8 @@ l2_outacl_node_fn (vlib_main_t * vm, l2_outacl_trace_t *t = vlib_add_trace (vm, node, b0, sizeof (*t)); t->sw_if_index = sw_if_index0; - memcpy(t->src, h0->src_address, 6); - memcpy(t->dst, h0->dst_address, 6); + clib_memcpy(t->src, h0->src_address, 6); + clib_memcpy(t->dst, h0->dst_address, 6); } em->counters[node_counter_base_index + L2_OUTACL_ERROR_L2_OUTACL] += 1; diff --git a/vnet/vnet/l2/l2_rw.c b/vnet/vnet/l2/l2_rw.c index c325ecec..8c62b888 100644 --- a/vnet/vnet/l2/l2_rw.c +++ b/vnet/vnet/l2/l2_rw.c @@ -331,8 +331,8 @@ int l2_rw_mod_entry(u32 *index, vec_alloc_aligned(e->value, e->rewrite_n_vectors, sizeof(u32x4)); memset(e->value, 0, e->rewrite_n_vectors * sizeof(u32x4)); - memcpy(((u8 *)e->value) + skip, value, len); - memcpy(((u8 *)e->mask) + skip, mask, len); + clib_memcpy(((u8 *)e->value) + skip, value, len); + clib_memcpy(((u8 *)e->mask) + skip, mask, len); int i; for (i = 0; i < e->rewrite_n_vectors; i++) { |