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",
77 u32 n_left_from, next_index, * from, * to_next;
91 while (n_left_from > 0)
96 to_next, n_left_to_next);
98 while (n_left_from >= 4 && n_left_to_next >= 2)
100 u32 bi0, next0, sw_if_index0;
101 u32 bi1, next1, sw_if_index1;
119 bi0 = to_next[0] = from[0];
120 bi1 = to_next[1] = from[1];
139 next0 = MPLS_INPUT_NEXT_DROP;
144 next0 = MPLS_INPUT_NEXT_LOOKUP;
146 sw_if_index0, &next0, b0);
152 next1 = MPLS_INPUT_NEXT_DROP;
157 next1 = MPLS_INPUT_NEXT_LOOKUP;
159 sw_if_index1, &next1, b1);
179 to_next, n_left_to_next,
184 while (n_left_from > 0 && n_left_to_next > 0)
186 u32 sw_if_index0, next0, bi0;
204 next0 = MPLS_INPUT_NEXT_DROP;
209 next0 = MPLS_INPUT_NEXT_LOOKUP;
223 to_next, n_left_to_next,
230 MPLS_ERROR_PKTS_DECAP, from_frame->
n_vectors);
243 #define mpls_error(n,s) s, 250 .name =
"mpls-input",
252 .vector_size =
sizeof (
u32),
261 #define _(s,n) [MPLS_INPUT_NEXT_##s] = n,
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.
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.
#define vlib_call_init_function(vm, x)
#define VLIB_NODE_FUNCTION_MULTIARCH(node, fn)
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).
vlib_error_t error
Error code for buffers to be enqueued to error handler.
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.
#define clib_error_report(e)
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)
static clib_error_t * mpls_init(vlib_main_t *vm)
struct _vlib_node_registration vlib_node_registration_t
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)
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
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)