X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fl2%2Fl2_input_vtr.c;h=be3e6ba85f4e090d096802e543032e40b8f8846e;hb=ba6deb96e923f71aa9387c06000412c3fb1362fa;hp=9470752f0e032b475671c757bd9ca84a4bd3e163;hpb=beb0b2e346c63e21ffe892ae0e04b67bb10fba5e;p=vpp.git diff --git a/src/vnet/l2/l2_input_vtr.c b/src/vnet/l2/l2_input_vtr.c index 9470752f0e0..be3e6ba85f4 100644 --- a/src/vnet/l2/l2_input_vtr.c +++ b/src/vnet/l2/l2_input_vtr.c @@ -57,9 +57,9 @@ format_l2_invtr_trace (u8 * s, va_list * args) return s; } +#ifndef CLIB_MARCH_VARIANT l2_invtr_main_t l2_invtr_main; - -static vlib_node_registration_t l2_invtr_node; +#endif /* CLIB_MARCH_VARIANT */ #define foreach_l2_invtr_error \ _(L2_INVTR, "L2 inverter packets") \ @@ -86,9 +86,9 @@ typedef enum } l2_invtr_next_t; -static uword -l2_invtr_node_fn (vlib_main_t * vm, - vlib_node_runtime_t * node, vlib_frame_t * frame) +VLIB_NODE_FN (l2_invtr_node) (vlib_main_t * vm, + vlib_node_runtime_t * node, + vlib_frame_t * frame) { u32 n_left_from, *from, *to_next; l2_invtr_next_t next_index; @@ -222,9 +222,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; - 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)); + clib_memcpy_fast (t->src, h0->src_address, 6); + clib_memcpy_fast (t->dst, h0->dst_address, 6); + clib_memcpy_fast (t->raw, &h0->type, sizeof (t->raw)); } if (b1->flags & VLIB_BUFFER_IS_TRACED) { @@ -232,9 +232,9 @@ l2_invtr_node_fn (vlib_main_t * vm, vlib_add_trace (vm, node, b1, sizeof (*t)); ethernet_header_t *h1 = vlib_buffer_get_current (b1); t->sw_if_index = sw_if_index0; - 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)); + clib_memcpy_fast (t->src, h1->src_address, 6); + clib_memcpy_fast (t->dst, h1->dst_address, 6); + clib_memcpy_fast (t->raw, &h1->type, sizeof (t->raw)); } } @@ -301,9 +301,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; - 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)); + clib_memcpy_fast (t->src, h0->src_address, 6); + clib_memcpy_fast (t->dst, h0->dst_address, 6); + clib_memcpy_fast (t->raw, &h0->type, sizeof (t->raw)); } /* verify speculative enqueue, maybe switch current next frame */ @@ -320,8 +320,7 @@ l2_invtr_node_fn (vlib_main_t * vm, /* *INDENT-OFF* */ -VLIB_REGISTER_NODE (l2_invtr_node,static) = { - .function = l2_invtr_node_fn, +VLIB_REGISTER_NODE (l2_invtr_node) = { .name = "l2-input-vtr", .vector_size = sizeof (u32), .format_trace = format_l2_invtr_trace, @@ -339,8 +338,9 @@ VLIB_REGISTER_NODE (l2_invtr_node,static) = { }; /* *INDENT-ON* */ -VLIB_NODE_FUNCTION_MULTIARCH (l2_invtr_node, l2_invtr_node_fn) - clib_error_t *l2_invtr_init (vlib_main_t * vm) +#ifndef CLIB_MARCH_VARIANT +clib_error_t * +l2_invtr_init (vlib_main_t * vm) { l2_invtr_main_t *mp = &l2_invtr_main; @@ -358,6 +358,7 @@ VLIB_NODE_FUNCTION_MULTIARCH (l2_invtr_node, l2_invtr_node_fn) } VLIB_INIT_FUNCTION (l2_invtr_init); +#endif /* CLIB_MARCH_VARIANT */ /*