38 #define _(a,b) if (t->next_index == MPLS_INPUT_NEXT_##a) next_name = b; 42 s =
format (s,
"MPLS: next %s, lookup fib index %d, decap index %d\n",
46 s =
format (s,
" label %d",
66 u32 n_left_from, next_index, * from, * to_next;
83 while (n_left_from > 0)
88 to_next, n_left_to_next);
91 while (n_left_from >= 4 && n_left_to_next >= 2)
101 u32 fib_index0, fib_index1;
135 to_next, n_left_to_next,
136 bi0, bi1, next0, next1);
141 while (n_left_from > 0 && n_left_to_next > 0)
172 rx_fib_index0 =
vec_elt (mm->fib_index_by_sw_if_index,
193 next0 = MPLS_INPUT_NEXT_DROP;
198 key0 = ((
u64)rx_fib_index0<<32)
211 next0 = MPLS_INPUT_NEXT_DROP;
233 to_next, n_left_to_next,
240 MPLS_ERROR_PKTS_DECAP, from_frame->
n_vectors);
253 #define mpls_error(n,s) s, 260 .name =
"mpls-gre-input",
262 .vector_size =
sizeof (
u32),
271 #define _(s,n) [MPLS_INPUT_NEXT_##s] = n, 292 .name =
"mpls-ethernet-input",
294 .vector_size =
sizeof (
u32),
303 #define _(s,n) [MPLS_INPUT_NEXT_##s] = n, void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
static u32 vnet_mpls_uc_get_label(u32 label_exp_s_ttl)
always_inline pg_node_t * pg_get_node(uword node_index)
always_inline vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
format_function_t format_mpls_eth_header_with_length
static clib_error_t * mpls_input_init(vlib_main_t *vm)
struct _vlib_node_registration vlib_node_registration_t
static void mpls_setup_nodes(vlib_main_t *vm)
u32 * fib_index_by_sw_if_index
#define clib_error_report(e)
#define foreach_mpls_input_next
static u32 vnet_mpls_uc_get_s(u32 label_exp_s_ttl)
always_inline void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
#define VLIB_INIT_FUNCTION(x)
#define vlib_call_init_function(vm, x)
always_inline void * vlib_frame_vector_args(vlib_frame_t *f)
static uword mpls_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
#define pool_elt_at_index(p, i)
format_function_t format_mpls_gre_header_with_length
static uword mpls_input_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame, int is_mpls_o_gre)
static uword mpls_ethernet_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
u8 * format_mpls_rx_trace(u8 *s, va_list *args)
static u32 vnet_mpls_uc_get_ttl(u32 label_exp_s_ttl)
always_inline void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
format_function_t * format_buffer
#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)
u32 label_host_byte_order
vlib_error_t error
Error code for buffers to be enqueued to error handler.
vlib_node_registration_t mpls_input_node
(constructor) VLIB_REGISTER_NODE (mpls_input_node)
void ethernet_register_input_type(vlib_main_t *vm, ethernet_type_t type, u32 node_index)
#define CLIB_PREFETCH(addr, size, type)
static char * mpls_error_strings[]
unformat_function_t unformat_pg_mpls_header
unformat_function_t * unformat_buffer
vlib_node_registration_t mpls_ethernet_input_node
(constructor) VLIB_REGISTER_NODE (mpls_ethernet_input_node)
unformat_function_t * unformat_edit
uword * mpls_decap_by_rx_fib_and_label
#define VLIB_BUFFER_IS_TRACED
static clib_error_t * mpls_init(vlib_main_t *vm)
#define vec_elt(v, i)
Get vector value at index i.
always_inline void * vlib_node_get_runtime_data(vlib_main_t *vm, u32 node_index)
always_inline void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
unformat_function_t unformat_mpls_gre_header
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.