47 s =
format (s,
"l2-input-vtr: sw_if_index %d dst %U src %U data " 48 "%02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x",
61 #define foreach_l2_invtr_error \ 62 _(L2_INVTR, "L2 inverter packets") \ 63 _(DROP, "L2 input tag rewrite drops") 66 #define _(sym,str) L2_INVTR_ERROR_##sym, 73 #define _(sym,string) string, 89 u32 n_left_from, * from, * to_next;
100 while (n_left_from > 0)
106 to_next, n_left_to_next);
108 while (n_left_from >= 6 && n_left_to_next >= 2)
113 u32 sw_if_index0, sw_if_index1;
114 u32 feature_bitmap0, feature_bitmap1;
119 u32 sw_if_index2, sw_if_index3;
143 to_next[0] = bi0 = from[0];
144 to_next[1] = bi1 = from[1];
161 feature_bitmap0 =
vnet_buffer(b0)->l2.feature_bitmap & ~L2INPUT_FEAT_VTR;
162 feature_bitmap1 =
vnet_buffer(b1)->l2.feature_bitmap & ~L2INPUT_FEAT_VTR;
165 vnet_buffer(b0)->l2.feature_bitmap = feature_bitmap0;
166 vnet_buffer(b1)->l2.feature_bitmap = feature_bitmap1;
210 to_next, n_left_to_next,
211 bi0, bi1, next0, next1);
214 while (n_left_from > 0 && n_left_to_next > 0)
238 feature_bitmap0 =
vnet_buffer(b0)->l2.feature_bitmap & ~L2INPUT_FEAT_VTR;
241 vnet_buffer(b0)->l2.feature_bitmap = feature_bitmap0;
267 to_next, n_left_to_next,
280 .name =
"l2-input-vtr",
281 .vector_size =
sizeof (
u32),
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
struct _vlib_node_registration vlib_node_registration_t
always_inline void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
vnet_main_t * vnet_get_main(void)
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.
always_inline void * vlib_frame_vector_args(vlib_frame_t *f)
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)
#define VLIB_NODE_FLAG_TRACE
#define VLIB_BUFFER_IS_TRACED
always_inline u32 feat_bitmap_get_next_node_index(u32 *next_nodes, u32 bitmap)
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)
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
#define VLIB_REGISTER_NODE(x,...)
#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.
u32 feat_next_node_index[32]
always_inline void feat_bitmap_init_next_nodes(vlib_main_t *vm, u32 node_index, u32 num_features, char **feat_names, u32 *next_nodes)