X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Finterface_output.c;h=e79ad451c55f5adf7eec4bb780f1e484ab393ff1;hb=3d5f08a825a978cd6853989a5df8c9b9811e7fb8;hp=52c07accc4ac39bcecbabc5d6f2eea882ca0641d;hpb=b040f98a88954ccf2e63fd7b2676865a2dbe0078;p=vpp.git diff --git a/src/vnet/interface_output.c b/src/vnet/interface_output.c index 52c07accc4a..e79ad451c55 100644 --- a/src/vnet/interface_output.c +++ b/src/vnet/interface_output.c @@ -91,6 +91,7 @@ format_vnet_interface_output_trace (u8 * s, va_list * va) } return s; } +#endif /* CLIB_MARCH_VARIANT */ static void vnet_interface_output_trace (vlib_main_t * vm, @@ -427,7 +428,6 @@ vnet_interface_output_node_inline (vlib_main_t * vm, rt->sw_if_index, n_packets, n_bytes); return n_buffers; } -#endif /* CLIB_MARCH_VARIANT */ static_always_inline void vnet_interface_pcap_tx_trace (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame, @@ -486,11 +486,12 @@ static_always_inline void vnet_interface_pcap_tx_trace } } -#ifndef CLIB_MARCH_VARIANT +static vlib_node_function_t CLIB_MULTIARCH_FN (vnet_interface_output_node); -uword -vnet_interface_output_node (vlib_main_t * vm, vlib_node_runtime_t * node, - vlib_frame_t * frame) +static uword +CLIB_MULTIARCH_FN (vnet_interface_output_node) (vlib_main_t * vm, + vlib_node_runtime_t * node, + vlib_frame_t * frame) { vnet_main_t *vnm = vnet_get_main (); vnet_hw_interface_t *hi; @@ -507,6 +508,41 @@ vnet_interface_output_node (vlib_main_t * vm, vlib_node_runtime_t * node, return vnet_interface_output_node_inline (vm, node, frame, vnm, hi, /* do_tx_offloads */ 1); } + +CLIB_MARCH_FN_REGISTRATION (vnet_interface_output_node); + +#ifndef CLIB_MARCH_VARIANT +vlib_node_function_t * +vnet_interface_output_node_get (vlib_main_t * vm) +{ + vlib_node_function_t *fn = 0; + vlib_node_fn_registration_t *fnr; + char *name = 0; + vlib_node_t *node = vlib_get_node_by_name (vm, (u8 *) "interface-output"); + ASSERT (node); + + /* search for the same name */ + fnr = node->node_fn_registrations; + while (fnr) + { + if (fnr->function == node->function) + { + name = fnr->name; + break; + } + fnr = fnr->next_registration; + } + + if (name) + { + fn = CLIB_MARCH_FN_POINTER_BY_NAME (vnet_interface_output_node, name); + } + if (!fn) /* revert to march type selection if search failed */ + { + fn = CLIB_MARCH_FN_POINTER (vnet_interface_output_node); + } + return fn; +} #endif /* CLIB_MARCH_VARIANT */ /* Use buffer's sw_if_index[VNET_TX] to choose output interface. */ @@ -800,19 +836,21 @@ interface_drop_punt (vlib_main_t * vm, node->flags |= VLIB_NODE_FLAG_TRACE; while (n_trace && n_left) { - vlib_trace_buffer (vm, node, 0 /* next_index */ , - b[0], 0 /* follow chain */ ); - /* - * Here we have a wireshark dissector problem. - * Packets may be well-formed, or not. We - * must not blow chunks in any case. - * - * Try to produce trace records which will help - * folks understand what's going on. - */ - drop_catchup_trace (vm, node, b[0]); - - n_trace--; + if (PREDICT_TRUE + (vlib_trace_buffer (vm, node, 0 /* next_index */ , b[0], + 0 /* follow chain */ ))) + { + /* + * Here we have a wireshark dissector problem. + * Packets may be well-formed, or not. We + * must not blow chunks in any case. + * + * Try to produce trace records which will help + * folks understand what's going on. + */ + drop_catchup_trace (vm, node, b[0]); + n_trace--; + } n_left--; b++; }