28 #define foreach_mpls_input_next \ 29 _(DROP, "error-drop") \ 30 _(LOOKUP, "mpls-lookup") 33 #define _(s,n) MPLS_INPUT_NEXT_##s, 50 #define _(a,b) if (t->next_index == MPLS_INPUT_NEXT_##a) next_name = b; 54 s =
format (s,
"MPLS: next %s[%d] label %d ttl %d exp %d",
75 u32 n_left_from, next_index, * from, * to_next;
89 while (n_left_from > 0)
94 to_next, n_left_to_next);
96 while (n_left_from >= 4 && n_left_to_next >= 2)
98 u32 bi0, next0, sw_if_index0;
99 u32 bi1, next1, sw_if_index1;
117 bi0 = to_next[0] = from[0];
118 bi1 = to_next[1] = from[1];
137 next0 = MPLS_INPUT_NEXT_DROP;
142 next0 = MPLS_INPUT_NEXT_LOOKUP;
144 sw_if_index0, &next0, b0);
150 next1 = MPLS_INPUT_NEXT_DROP;
155 next1 = MPLS_INPUT_NEXT_LOOKUP;
157 sw_if_index1, &next1, b1);
177 to_next, n_left_to_next,
182 while (n_left_from > 0 && n_left_to_next > 0)
184 u32 sw_if_index0, next0, bi0;
202 next0 = MPLS_INPUT_NEXT_DROP;
207 next0 = MPLS_INPUT_NEXT_LOOKUP;
221 to_next, n_left_to_next,
228 MPLS_ERROR_PKTS_DECAP, from_frame->
n_vectors);
240 #define mpls_error(n,s) s, 246 .name =
"mpls-input",
248 .vector_size =
sizeof (
u32),
257 #define _(s,n) [MPLS_INPUT_NEXT_##s] = n, 266 #ifndef CLIB_MARCH_VARIANT u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
vnet_main_t * vnet_get_main(void)
vnet_interface_main_t interface_main
u8 input_feature_arc_index
static void vlib_increment_simple_counter(vlib_simple_counter_main_t *cm, u32 thread_index, u32 index, u64 increment)
Increment a simple counter.
#define VLIB_NODE_FN(node)
vlib_error_t * errors
Vector of errors for this node.
static pg_node_t * pg_get_node(uword node_index)
#define VLIB_INIT_FUNCTION(x)
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
format_function_t format_mpls_unicast_header_net_byte_order
static u32 vnet_mpls_uc_get_ttl(mpls_label_t label_exp_s_ttl)
A collection of simple counters.
vlib_error_t error
Error code for buffers to be enqueued to error handler.
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static u32 vnet_mpls_uc_get_label(mpls_label_t label_exp_s_ttl)
vlib_simple_counter_main_t * sw_if_counters
#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).
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
#define VLIB_REGISTER_NODE(x,...)
static_always_inline uword vlib_get_thread_index(void)
#define CLIB_PREFETCH(addr, size, type)
unformat_function_t unformat_pg_mpls_header
unformat_function_t * unformat_edit
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.
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
void ethernet_register_input_type(vlib_main_t *vm, ethernet_type_t type, u32 node_index)
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
VLIB buffer representation.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
static u32 vnet_mpls_uc_get_exp(mpls_label_t label_exp_s_ttl)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
static_always_inline void vnet_feature_arc_start(u8 arc, u32 sw_if_index, u32 *next0, vlib_buffer_t *b0)