}
+static vlib_node_registration_t l2output_node;
+
static uword
l2output_node_fn (vlib_main_t * vm,
vlib_node_runtime_t * node,
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);
}
}
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;
}
-VLIB_REGISTER_NODE (l2output_node) = {
+VLIB_REGISTER_NODE (l2output_node,static) = {
.function = l2output_node_fn,
.name = "l2-output",
.vector_size = sizeof (u32),
},
};
+VLIB_NODE_FUNCTION_MULTIARCH (l2output_node, l2output_node_fn)
+
clib_error_t *l2output_init (vlib_main_t *vm)
{
l2output_main_t * mp = &l2output_main;
u32 next; // index of next graph node
vnet_hw_interface_t *hw0;
u32 *node;
+
+ hw0 = vnet_get_sup_hw_interface (vnet_main, sw_if_index);
+
#if DPDK > 0
uword cpu_number;
if (cpu_number)
{
+ u32 oldflags;
+
+ oldflags = __sync_fetch_and_or(&hw0->flags,
+ VNET_HW_INTERFACE_FLAG_L2OUTPUT_MAPPED);
+
+ if ((oldflags & VNET_HW_INTERFACE_FLAG_L2OUTPUT_MAPPED) )
+ return L2OUTPUT_NEXT_DROP;
+
output_node_mapping_send_rpc (node_index, sw_if_index);
- return 0;
+ return L2OUTPUT_NEXT_DROP;
}
#endif
- hw0 = vnet_get_sup_hw_interface (vnet_main, sw_if_index);
-
// dynamically create graph node arc
next = vlib_node_add_next (vlib_main,
node_index,