32 #define _(sym,name) name, 57 s =
format (s,
"l2-output: sw_if_index %d dst %U src %U",
65 #define foreach_l2output_error \ 66 _(L2OUTPUT, "L2 output packets") \ 67 _(EFP_DROP, "L2 EFP filter pre-rewrite drops") \ 68 _(VTR_DROP, "L2 output tag rewrite drops") \ 69 _(SHG_DROP, "L2 split horizon drops") \ 70 _(DROP, "L2 output drops") 73 #define _(sym,str) L2OUTPUT_ERROR_##sym, 80 #define _(sym,string) string, 112 u32 n_left_from, * from, * to_next;
113 l2output_next_t next_index;
118 u32 cached_sw_if_index;
119 u32 cached_next_index;
122 cached_sw_if_index = ~0;
123 cached_next_index = ~0;
129 while (n_left_from > 0)
135 to_next, n_left_to_next);
137 while (n_left_from >= 6 && n_left_to_next >= 2)
142 u32 sw_if_index0, sw_if_index1;
145 u32 feature_bitmap0, feature_bitmap1;
150 u32 sw_if_index2, sw_if_index3;
172 to_next[0] = bi0 = from[0];
173 to_next[1] = bi1 = from[1];
208 em->
counters[node_counter_base_index + L2OUTPUT_ERROR_L2OUTPUT] += 2;
251 u32 failed1 = (feature_bitmap0 & L2OUTPUT_FEAT_EFP_FILTER) &&
268 u32 failed1 = (feature_bitmap1 & L2OUTPUT_FEAT_EFP_FILTER) &&
300 to_next, n_left_to_next,
301 bi0, bi1, next0, next1);
304 while (n_left_from > 0 && n_left_to_next > 0)
336 em->
counters[node_counter_base_index + L2OUTPUT_ERROR_L2OUTPUT] += 1;
365 u32 failed1 = (feature_bitmap0 & L2OUTPUT_FEAT_EFP_FILTER) &&
388 to_next, n_left_to_next,
402 .vector_size =
sizeof (
u32),
406 .n_errors =
ARRAY_LEN(l2output_error_strings),
449 static void output_node_rpc_callback
452 static void output_node_mapping_send_rpc
463 (
u8 *) &args,
sizeof (args));
473 u32 * output_node_index_vec,
491 oldflags = __sync_fetch_and_or(&hw0->
flags,
497 output_node_mapping_send_rpc (node_index, sw_if_index);
#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)
always_inline 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)
char ** l2output_get_feat_names(void)
clib_error_t * l2output_init(vlib_main_t *vm)
static void(BVT(clib_bihash)*h, BVT(clib_bihash_value)*v)
always_inline vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
static vlib_node_registration_t l2output_node
(constructor) VLIB_REGISTER_NODE (l2output_node)
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
always_inline void l2output_init_output_node_vec(u32 **output_node_index_vec)
l2_output_next_nodes_st next_nodes
always_inline void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
always_inline vlib_main_t * vlib_get_main(void)
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)
vnet_main_t * vnet_get_main(void)
static_always_inline u32 split_horizon_violation(u8 shg1, u8 shg2)
#define static_always_inline
u8 * format_ethernet_address(u8 *s, va_list *args)
#define VLIB_INIT_FUNCTION(x)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
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)
always_inline void * vlib_frame_vector_args(vlib_frame_t *f)
void l2output_intf_bitmap_enable(u32 sw_if_index, u32 feature_bitmap, u32 enable)
u32 feat_next_node_index[32]
l2_output_config_t * l2output_intf_config(u32 sw_if_index)
vlib_error_main_t error_main
#define VNET_HW_INTERFACE_FLAG_L2OUTPUT_MAPPED
uword os_get_cpu_number(void)
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)
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
always_inline u32 l2_vtr_process(vlib_buffer_t *b0, vtr_config_t *config)
vlib_error_t error
Error code for buffers to be enqueued to error handler.
#define CLIB_PREFETCH(addr, size, type)
#define clib_memcpy(a, b, c)
always_inline vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
static char * l2output_feat_names[]
#define VLIB_NODE_FLAG_TRACE
static char * l2output_error_strings[]
always_inline uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
#define VLIB_BUFFER_IS_TRACED
u32 * output_node_index_vec
l2_output_config_t * configs
always_inline void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
always_inline u8 l2_efp_filter_process(vlib_buffer_t *b0, vtr_config_t *in_config)
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
#define VLIB_REGISTER_NODE(x,...)
static u8 * format_l2output_trace(u8 *s, va_list *args)
#define CLIB_CACHE_LINE_BYTES
u32 flags
buffer flags: VLIB_BUFFER_IS_TRACED: trace this buffer.
always_inline vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
#define foreach_l2output_error
always_inline void feat_bitmap_init_next_nodes(vlib_main_t *vm, u32 node_index, u32 num_features, char **feat_names, u32 *next_nodes)