38 #define _(a,b) if (t->next_index == MPLS_INPUT_NEXT_##a) next_name = b; 42 s =
format (s,
"MPLS: next %s[%d] label %d ttl %d",
64 u32 n_left_from, next_index, * from, * to_next;
86 while (n_left_from > 0)
91 to_next, n_left_to_next);
93 while (n_left_from >= 4 && n_left_to_next >= 2)
95 u32 label0, bi0, next0, sw_if_index0;
96 u32 label1, bi1, next1, sw_if_index1;
115 bi0 = to_next[0] = from[0];
116 bi1 = to_next[1] = from[1];
138 next0 = MPLS_INPUT_NEXT_DROP;
143 next0 = MPLS_INPUT_NEXT_LOOKUP;
150 next1 = MPLS_INPUT_NEXT_DROP;
155 next1 = MPLS_INPUT_NEXT_LOOKUP;
176 to_next, n_left_to_next,
177 bi0, bi1, next0, next1);
180 while (n_left_from > 0 && n_left_to_next > 0)
204 next0 = MPLS_INPUT_NEXT_DROP;
222 to_next, n_left_to_next,
229 MPLS_ERROR_PKTS_DECAP, from_frame->
n_vectors);
242 #define mpls_error(n,s) s, 249 .name =
"mpls-input",
251 .vector_size =
sizeof (
u32),
255 .n_errors = MPLS_N_ERROR,
260 #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)
Release pointer to next frame vector data.
static void vlib_increment_simple_counter(vlib_simple_counter_main_t *cm, u32 cpu_index, u32 index, u32 increment)
Increment a simple counter.
vnet_interface_main_t interface_main
u8 input_feature_arc_index
static uword mpls_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
struct _vlib_node_registration vlib_node_registration_t
static void mpls_setup_nodes(vlib_main_t *vm)
#define clib_error_report(e)
#define foreach_mpls_input_next
static clib_error_t * mpls_input_init(vlib_main_t *vm)
static pg_node_t * pg_get_node(uword node_index)
vnet_main_t * vnet_get_main(void)
#define VLIB_INIT_FUNCTION(x)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
#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)
static u8 * format_mpls_input_trace(u8 *s, va_list *args)
uword os_get_cpu_number(void)
static uword mpls_input_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
static void * vlib_node_get_runtime_data(vlib_main_t *vm, u32 node_index)
Get node runtime private data by node index.
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)
void ethernet_register_input_type(vlib_main_t *vm, ethernet_type_t type, u32 node_index)
#define CLIB_PREFETCH(addr, size, type)
unformat_function_t unformat_pg_mpls_header
unformat_function_t * unformat_edit
VLIB_NODE_FUNCTION_MULTIARCH(dpdk_input_node, dpdk_input)
#define VLIB_BUFFER_IS_TRACED
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)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
#define VLIB_REGISTER_NODE(x,...)
static char * mpls_error_strings[]
u32 flags
buffer flags: 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.
vlib_node_registration_t mpls_input_node
(constructor) VLIB_REGISTER_NODE (mpls_input_node)
static_always_inline void vnet_feature_arc_start(u8 arc, u32 sw_if_index, u32 *next0, vlib_buffer_t *b0)