32 #define _(sym,name) name, 61 s =
format (s,
"l2-output: sw_if_index %d dst %U src %U",
70 #define _(sym,string) string, 102 u32 n_left_from, *from, *to_next;
108 u32 cached_sw_if_index;
109 u32 cached_next_index;
112 cached_sw_if_index = ~0;
113 cached_next_index = ~0;
119 while (n_left_from > 0)
126 while (n_left_from >= 6 && n_left_to_next >= 2)
131 u32 sw_if_index0, sw_if_index1;
134 u32 feature_bitmap0, feature_bitmap1;
139 u32 sw_if_index2, sw_if_index3;
166 to_next[0] = bi0 = from[0];
167 to_next[1] = bi1 = from[1];
202 em->
counters[node_counter_base_index + L2OUTPUT_ERROR_L2OUTPUT] +=
224 b0, sw_if_index0, feature_bitmap0, &next0);
233 b1, sw_if_index1, feature_bitmap1, &next1);
245 u32 failed1 = (feature_bitmap0 & L2OUTPUT_FEAT_EFP_FILTER) &&
266 u32 failed1 = (feature_bitmap1 & L2OUTPUT_FEAT_EFP_FILTER) &&
308 to_next, n_left_to_next,
309 bi0, bi1, next0, next1);
312 while (n_left_from > 0 && n_left_to_next > 0)
345 em->
counters[node_counter_base_index + L2OUTPUT_ERROR_L2OUTPUT] +=
365 b0, sw_if_index0, feature_bitmap0, &next0);
377 u32 failed1 = (feature_bitmap0 & L2OUTPUT_FEAT_EFP_FILTER) &&
406 to_next, n_left_to_next,
421 .vector_size =
sizeof (
u32),
439 #define foreach_l2output_del_tunnel_error \ 440 _(DROP, "L2 output to deleted tunnel") 443 #define _(sym,string) string, 450 #define _(sym,str) L2OUTPUT_DEL_TUNNEL_ERROR_##sym, 474 u32 n_left_from, *from, *to_next;
480 while (n_left_from > 0)
487 while (n_left_from >= 4 && n_left_to_next >= 2)
492 to_next[0] = bi0 = from[0];
493 to_next[1] = bi1 = from[1];
500 b0->
error = node->
errors[L2OUTPUT_DEL_TUNNEL_ERROR_DROP];
501 b1->
error = node->
errors[L2OUTPUT_DEL_TUNNEL_ERROR_DROP];
504 while (n_left_from > 0 && n_left_to_next > 0)
516 b0->
error = node->
errors[L2OUTPUT_DEL_TUNNEL_ERROR_DROP];
528 .name =
"l2-output-del-tunnel",
529 .vector_size =
sizeof (
u32),
591 (
u8 *) & args,
sizeof (args));
599 u32 * output_node_index_vec,
618 oldflags = __sync_fetch_and_or (&hw0->
flags,
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Release pointer to next frame vector data.
#define foreach_l2output_error
char ** l2output_get_feat_names(void)
clib_error_t * l2output_init(vlib_main_t *vm)
static vlib_main_t * vlib_get_main(void)
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
static uword l2output_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
struct _vlib_node_registration vlib_node_registration_t
l2_output_next_nodes_st next_nodes
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
u32 l2output_create_output_node_mapping(vlib_main_t *vlib_main, vnet_main_t *vnet_main, u32 node_index, u32 *output_node_index_vec, u32 sw_if_index)
Create a mapping in the next node mapping table for the given sw_if_index.
vnet_main_t * vnet_get_main(void)
static_always_inline u32 split_horizon_violation(u8 shg1, u8 shg2)
Check for split horizon violations.
#define static_always_inline
u8 * format_ethernet_address(u8 *s, va_list *args)
#define VLIB_INIT_FUNCTION(x)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static uword l2output_del_tunnel_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
static void output_node_mapping_send_rpc(u32 node_index, u32 sw_if_index)
void vl_api_rpc_call_main_thread(void *fp, u8 *data, u32 data_length)
int vlib_main(vlib_main_t *vm, unformat_input_t *input)
void l2output_intf_bitmap_enable(u32 sw_if_index, u32 feature_bitmap, u32 enable)
Enable (or disable) the feature in the bitmap for the given interface.
static u32 l2_vtr_process(vlib_buffer_t *b0, vtr_config_t *config)
Perform the configured tag rewrite on the packet.
u32 feat_next_node_index[32]
l2_output_config_t * l2output_intf_config(u32 sw_if_index)
Get a pointer to the config for the given interface.
vlib_error_main_t error_main
#define VNET_HW_INTERFACE_FLAG_L2OUTPUT_MAPPED
uword os_get_cpu_number(void)
#define foreach_l2output_del_tunnel_error
l2output_main_t l2output_main
#define vlib_validate_buffer_enqueue_x2(vm, node, next_index, to_next, n_left_to_next, bi0, bi1, next0, next1)
Finish enqueueing two buffers forward in the graph.
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
Finish enqueueing one buffer forward in the graph.
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
vlib_error_t error
Error code for buffers to be enqueued to error handler.
#define CLIB_PREFETCH(addr, size, type)
static void feat_bitmap_init_next_nodes(vlib_main_t *vm, u32 node_index, u32 num_features, char **feat_names, u32 *next_nodes)
Initialize the feature next-node indexes of a graph node.
static u8 l2_efp_filter_process(vlib_buffer_t *b0, vtr_config_t *in_config)
#define clib_memcpy(a, b, c)
static char * l2output_feat_names[]
#define VLIB_NODE_FLAG_TRACE
static char * l2output_error_strings[]
#define VLIB_BUFFER_IS_TRACED
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
u32 * output_node_index_vec
static void output_node_rpc_callback(output_node_mapping_rpc_args_t *a)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
l2_output_config_t * configs
static vlib_node_registration_t l2output_node
(constructor) VLIB_REGISTER_NODE (l2output_node)
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
#define VLIB_NODE_FUNCTION_MULTIARCH(node, fn)
#define VLIB_REGISTER_NODE(x,...)
static vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
Get vlib node by index.
static u8 * format_l2output_trace(u8 *s, va_list *args)
static void l2_output_dispatch(vlib_main_t *vlib_main, vnet_main_t *vnet_main, vlib_node_runtime_t *node, u32 node_index, u32 *cached_sw_if_index, u32 *cached_next_index, l2_output_next_nodes_st *next_nodes, vlib_buffer_t *b0, u32 sw_if_index, u32 feature_bitmap, u32 *next0)
Determine the next L2 node based on the output feature bitmap.
static char * l2output_del_tunnel_error_strings[]
#define CLIB_CACHE_LINE_BYTES
u32 flags
buffer flags: VLIB_BUFFER_IS_TRACED: trace this buffer.
static vlib_node_registration_t l2output_del_tunnel_node
Output node for tunnels which was in L2 BD's but were deleted.
static void l2output_init_output_node_vec(u32 **output_node_index_vec)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
l2output_del_tunnel_error_t