29 u8 packet_data[64 - 1*
sizeof(
u32)];
41 s =
format (s,
"adj-idx %d : %U flow hash: 0x%08x",
59 u32 n_left_from, next_index, * from, * to_next, cpu_index;
69 while (n_left_from > 0)
72 to_next, n_left_to_next);
74 while (n_left_from >= 4 && n_left_to_next >= 2)
79 u32 pi0, rw_len0, adj_index0, next0, error0;
84 u32 pi1, rw_len1, adj_index1, next1, error1;
100 pi0 = to_next[0] = from[0];
101 pi1 = to_next[1] = from[1];
128 rw_len0 = adj0[0].rewrite_header.data_bytes;
129 rw_len1 = adj1[0].rewrite_header.data_bytes;
134 cpu_index, adj_index0,
140 cpu_index, adj_index1,
146 adj0[0].rewrite_header.max_l3_packet_bytes))
152 adj0[0].rewrite_header.sw_if_index;
153 next0 = adj0[0].rewrite_header.next_index;
154 error0 = IP4_ERROR_NONE;
163 error0 = IP4_ERROR_MTU_EXCEEDED;
164 next0 = MPLS_OUTPUT_NEXT_DROP;
167 adj1[0].rewrite_header.max_l3_packet_bytes))
173 adj1[0].rewrite_header.sw_if_index;
174 next1 = adj1[0].rewrite_header.next_index;
175 error1 = IP4_ERROR_NONE;
184 error1 = IP4_ERROR_MTU_EXCEEDED;
185 next1 = MPLS_OUTPUT_NEXT_DROP;
207 to_next, n_left_to_next,
208 pi0, pi1, next0, next1);
211 while (n_left_from > 0 && n_left_to_next > 0)
216 u32 pi0, rw_len0, adj_index0, next0, error0;
218 pi0 = to_next[0] = from[0];
235 rw_len0 = adj0[0].rewrite_header.data_bytes;
240 cpu_index, adj_index0,
246 adj0[0].rewrite_header.max_l3_packet_bytes))
252 adj0[0].rewrite_header.sw_if_index;
253 next0 = adj0[0].rewrite_header.next_index;
254 error0 = IP4_ERROR_NONE;
263 error0 = IP4_ERROR_MTU_EXCEEDED;
264 next0 = MPLS_OUTPUT_NEXT_DROP;
282 to_next, n_left_to_next,
289 MPLS_ERROR_PKTS_ENCAP,
296 #define mpls_error(n,s) s, 311 .name =
"mpls-output",
313 .vector_size =
sizeof (
u32),
314 .n_errors = MPLS_N_ERROR,
319 #define _(s,n) [MPLS_OUTPUT_NEXT_##s] = n, 339 .name =
"mpls-midchain",
340 .vector_size =
sizeof (
u32),
344 .sibling_of =
"mpls-output",
352 #define foreach_mpls_adj_incomplete_next \ 353 _(DROP, "error-drop") \ 355 _(IP6, "ip6-discover-neighbor") 358 #define _(s,n) MPLS_ADJ_INCOMPLETE_NEXT_##s, 386 u32 n_left_from, next_index, * from, * to_next;
392 while (n_left_from > 0)
397 to_next, n_left_to_next);
399 while (n_left_from > 0 && n_left_to_next > 0)
401 u32 pi0, next0, adj_index0;
405 pi0 = to_next[0] = from[0];
419 next0 = MPLS_ADJ_INCOMPLETE_NEXT_IP4;
423 next0 = MPLS_ADJ_INCOMPLETE_NEXT_IP6;
434 to_next, n_left_to_next,
455 s =
format (s,
"%Unext:%d",
463 .name =
"mpls-adj-incomplete",
466 .vector_size =
sizeof (
u32),
467 .n_errors = MPLS_N_ERROR,
472 #define _(s,n) [MPLS_ADJ_INCOMPLETE_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.
#define vnet_rewrite_one_header(rw0, p0, most_likely_size)
A struct to hold tracing information for the MPLS label imposition node.
static u8 * format_mpls_adj_incomplete_trace(u8 *s, va_list *args)
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
union ip_adjacency_t_::@175 sub_type
static u8 * format_mpls_output_trace(u8 *s, va_list *args)
vlib_node_registration_t mpls_midchain_node
(constructor) VLIB_REGISTER_NODE (mpls_midchain_node)
vlib_node_registration_t mpls_output_node
(constructor) VLIB_REGISTER_NODE (mpls_output_node)
vnet_main_t * vnet_get_main(void)
static ip_adjacency_t * adj_get(adj_index_t adj_index)
Get a pointer to an adjacency object from its index.
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
mpls_adj_incomplete_next_t
u16 current_length
Nbytes between current data and the end of this buffer.
uword os_get_cpu_number(void)
static uword mpls_adj_incomplete(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Graph node for incomplete MPLS adjacency.
#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_combined_counter_main_t adjacency_counters
Adjacency packet counters.
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)
static uword mpls_output(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
#define CLIB_PREFETCH(addr, size, type)
#define foreach_mpls_adj_incomplete_next
Next index values from the MPLS incomplete adj node.
static vlib_node_runtime_t * vlib_node_get_runtime(vlib_main_t *vm, u32 node_index)
Get node runtime by node index.
static uword mpls_output_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame, int is_midchain)
static void vlib_increment_combined_counter(vlib_combined_counter_main_t *cm, u32 cpu_index, u32 index, u32 packet_increment, u32 byte_increment)
Increment a combined counter.
#define foreach_mpls_output_next
#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 char * mpls_error_strings[]
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_NODE_FUNCTION_MULTIARCH(node, fn)
#define VLIB_REGISTER_NODE(x,...)
struct mpls_adj_incomplete_trace_t_ mpls_adj_incomplete_trace_t
A struct to hold tracing information for the MPLS label imposition node.
u8 packet_data[64-1 *sizeof(u32)]
vlib_node_registration_t mpls_adj_incomplete_node
(constructor) VLIB_REGISTER_NODE (mpls_adj_incomplete_node)
#define vnet_rewrite_two_headers(rw0, rw1, p0, p1, most_likely_size)
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.
static uword mpls_midchain(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
struct ip_adjacency_t_::@175::@177 midchain
IP_LOOKUP_NEXT_MIDCHAIN.