#include <vnet/l2/l2_output.h>
-#ifndef CLIB_MULTIARCH_VARIANT
+#ifndef CLIB_MARCH_VARIANT
/* Feature graph node names */
static char *l2output_feat_names[] = {
#define _(sym,name) name,
#undef _
};
u32 feature_bitmap = va_arg (*args, u32);
+ u32 verbose = va_arg (*args, u32);
if (feature_bitmap == 0)
{
int i;
for (i = L2OUTPUT_N_FEAT - 1; i >= 0; i--)
- if (feature_bitmap & (1 << i))
- s = format (s, "%10s (%s)\n", display_names[i], l2output_feat_names[i]);
+ {
+ if (feature_bitmap & (1 << i))
+ {
+ if (verbose)
+ s =
+ format (s, "%17s (%s)\n", display_names[i],
+ l2output_feat_names[i]);
+ else
+ s = format (s, "%s ", l2output_feat_names[i]);
+ }
+ }
+
return s;
}
u8 raw[12]; /* raw data */
} l2output_trace_t;
-#ifndef CLIB_MULTIARCH_VARIANT
/* packet trace format function */
static u8 *
format_l2output_trace (u8 * s, va_list * args)
foreach_l2output_error
#undef _
};
-#endif
/**
* Check for split horizon violations.
{
u32 feature_bitmap = config->feature_bitmap & ~L2OUTPUT_FEAT_OUTPUT;
if (config->shg == 0 && feature_bitmap == 0)
- l2output_process_batch_inline (vm, node, config, b, cdo, next, n_left,
- l2_efp, l2_vtr, l2_pbb, 0, 0);
+ {
+ if ((l2_efp | l2_vtr | l2_pbb) == 0)
+ return;
+ l2output_process_batch_inline (vm, node, config, b, cdo, next, n_left,
+ l2_efp, l2_vtr, l2_pbb, 0, 0);
+ }
else if (config->shg == 0)
l2output_process_batch_inline (vm, node, config, b, cdo, next, n_left,
l2_efp, l2_vtr, l2_pbb, 0, 1);
l2_efp, l2_vtr, l2_pbb, 1, 1);
}
-uword CLIB_CPU_OPTIMIZED
-CLIB_MULTIARCH_FN (l2output_node_fn) (vlib_main_t * vm,
- vlib_node_runtime_t * node,
- vlib_frame_t * frame)
+VLIB_NODE_FN (l2output_node) (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * frame)
{
u32 n_left, *from;
l2output_main_t *msm = &l2output_main;
vlib_add_trace (vm, node, b[0], sizeof (*t));
t->sw_if_index = vnet_buffer (b[0])->sw_if_index[VLIB_TX];
h = vlib_buffer_get_current (b[0]);
- clib_memcpy (t->src, h->src_address, 6);
- clib_memcpy (t->dst, h->dst_address, 6);
- clib_memcpy (t->raw, &h->type, sizeof (t->raw));
+ clib_memcpy_fast (t->src, h->src_address, 6);
+ clib_memcpy_fast (t->dst, h->dst_address, 6);
+ clib_memcpy_fast (t->raw, &h->type, sizeof (t->raw));
}
/* next */
n_left--;
return frame->n_vectors;
}
-#ifndef CLIB_MULTIARCH_VARIANT
/* *INDENT-OFF* */
VLIB_REGISTER_NODE (l2output_node) = {
- .function = l2output_node_fn,
.name = "l2-output",
.vector_size = sizeof (u32),
.format_trace = format_l2output_trace,
[L2OUTPUT_NEXT_BAD_INTF] = "l2-output-bad-intf",
},
};
-
-#if __x86_64__
-vlib_node_function_t __clib_weak l2output_node_fn_avx512;
-vlib_node_function_t __clib_weak l2output_node_fn_avx2;
-static void __clib_constructor
-l2output_multiarch_select (void)
-{
- if (l2output_node_fn_avx512 && clib_cpu_supports_avx512f ())
- l2output_node.function = l2output_node_fn_avx512;
- else if (l2output_node_fn_avx2 && clib_cpu_supports_avx2 ())
- l2output_node.function = l2output_node_fn_avx2;
-}
-#endif
-
/* *INDENT-ON* */
* this sw_if_index, l2-output will send packets for this sw_if_index to the
* l2-output-bad-intf node which just setup the proper drop reason before
* sending packets to the error-drop node to drop the packet. Then, stale L2FIB
- * entries for delted tunnels won't cause possible packet or memory corrpution.
+ * entries for deleted tunnels won't cause possible packet or memory corruption.
*/
-static vlib_node_registration_t l2output_bad_intf_node;
-static uword
-l2output_bad_intf_node_fn (vlib_main_t * vm,
- vlib_node_runtime_t * node, vlib_frame_t * frame)
+VLIB_NODE_FN (l2output_bad_intf_node) (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * frame)
{
u32 n_left_from, *from, *to_next;
l2output_next_t next_index = 0;
}
/* *INDENT-OFF* */
-VLIB_REGISTER_NODE (l2output_bad_intf_node,static) = {
- .function = l2output_bad_intf_node_fn,
+VLIB_REGISTER_NODE (l2output_bad_intf_node) = {
.name = "l2-output-bad-intf",
.vector_size = sizeof (u32),
.type = VLIB_NODE_TYPE_INTERNAL,
[0] = "error-drop",
},
};
-
-VLIB_NODE_FUNCTION_MULTIARCH (l2output_bad_intf_node, l2output_bad_intf_node_fn);
/* *INDENT-ON* */
static clib_error_t *
VLIB_INIT_FUNCTION (l2output_init);
+#ifndef CLIB_MARCH_VARIANT
/** Create a mapping in the next node mapping table for the given sw_if_index. */
void
l2output_create_output_node_mapping (vlib_main_t * vlib_main,
/** Enable (or disable) the feature in the bitmap for the given interface. */
void
-l2output_intf_bitmap_enable (u32 sw_if_index, u32 feature_bitmap, u32 enable)
+l2output_intf_bitmap_enable (u32 sw_if_index,
+ l2output_feat_masks_t feature_bitmap, u32 enable)
{
l2output_main_t *mp = &l2output_main;
l2_output_config_t *config;