35 #define foreach_mpls_output_next \ 36 _(DROP, "error-drop") \ 37 _(IP4_FRAG, "ip4-frag") \ 38 _(IP6_FRAG, "ip6-frag") 41 #define _(s,n) MPLS_OUTPUT_NEXT_##s, 54 s =
format (s,
"adj-idx %d : %U flow hash: 0x%08x",
92 u32 n_left_from, next_index, * from, * to_next, thread_index;
104 while (n_left_from > 0)
107 to_next, n_left_to_next);
109 while (n_left_from >= 4 && n_left_to_next >= 2)
114 u32 pi0, adj_index0, next0, error0;
120 u32 pi1, adj_index1, next1, error1;
137 pi0 = to_next[0] = from[0];
138 pi1 = to_next[1] = from[1];
161 rw_len0 = adj0[0].rewrite_header.data_bytes;
162 rw_len1 = adj1[0].rewrite_header.data_bytes;
163 vnet_buffer (p0)->mpls.save_rewrite_length = rw_len0;
164 vnet_buffer (p1)->mpls.save_rewrite_length = rw_len1;
182 adj0[0].rewrite_header.max_l3_packet_bytes))
187 adj0[0].rewrite_header.sw_if_index;
188 next0 = adj0[0].rewrite_header.next_index;
189 error0 = IP4_ERROR_NONE;
193 adj0[0].rewrite_header.sw_if_index,
198 error0 = IP4_ERROR_MTU_EXCEEDED;
201 MPLS_ERROR_PKTS_NEED_FRAG,
205 adj1[0].rewrite_header.max_l3_packet_bytes))
210 adj1[0].rewrite_header.sw_if_index;
211 next1 = adj1[0].rewrite_header.next_index;
212 error1 = IP4_ERROR_NONE;
216 adj1[0].rewrite_header.sw_if_index,
221 error1 = IP4_ERROR_MTU_EXCEEDED;
224 MPLS_ERROR_PKTS_NEED_FRAG,
256 to_next, n_left_to_next,
257 pi0, pi1, next0, next1);
260 while (n_left_from > 0 && n_left_to_next > 0)
265 u32 pi0, adj_index0, next0, error0;
268 pi0 = to_next[0] = from[0];
282 rw_len0 = adj0[0].rewrite_header.data_bytes;
283 vnet_buffer (p0)->mpls.save_rewrite_length = rw_len0;
294 adj0[0].rewrite_header.max_l3_packet_bytes))
299 adj0[0].rewrite_header.sw_if_index;
300 next0 = adj0[0].rewrite_header.next_index;
301 error0 = IP4_ERROR_NONE;
305 adj0[0].rewrite_header.sw_if_index,
310 error0 = IP4_ERROR_MTU_EXCEEDED;
313 MPLS_ERROR_PKTS_NEED_FRAG,
339 to_next, n_left_to_next,
346 MPLS_ERROR_PKTS_ENCAP,
353 #define mpls_error(n,s) s, 366 .name =
"mpls-output",
368 .vector_size =
sizeof (
u32),
374 #define _(s,n) [MPLS_OUTPUT_NEXT_##s] = n, 390 .name =
"mpls-midchain",
391 .vector_size =
sizeof (
u32),
395 .sibling_of =
"mpls-output",
401 #define foreach_mpls_adj_incomplete_next \ 402 _(DROP, "error-drop") \ 404 _(IP6, "ip6-discover-neighbor") 407 #define _(s,n) MPLS_ADJ_INCOMPLETE_NEXT_##s, 434 u32 n_left_from, next_index, * from, * to_next;
437 n_left_from = from_frame->n_vectors;
438 next_index = node->cached_next_index;
440 while (n_left_from > 0)
445 to_next, n_left_to_next);
447 while (n_left_from > 0 && n_left_to_next > 0)
449 u32 pi0, next0, adj_index0;
453 pi0 = to_next[0] = from[0];
466 next0 = MPLS_ADJ_INCOMPLETE_NEXT_IP4;
470 next0 = MPLS_ADJ_INCOMPLETE_NEXT_IP6;
481 to_next, n_left_to_next,
488 return from_frame->n_vectors;
502 s =
format (s,
"%Unext:%d",
509 .name =
"mpls-adj-incomplete",
512 .vector_size =
sizeof (
u32),
518 #define _(s,n) [MPLS_ADJ_INCOMPLETE_NEXT_##s] = n, #define vnet_rewrite_one_header(rw0, p0, most_likely_size)
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
#define foreach_mpls_output_next
void ip_frag_set_vnet_buffer(vlib_buffer_t *b, u16 mtu, u8 next_index, u8 flags)
static void vlib_increment_combined_counter(vlib_combined_counter_main_t *cm, u32 thread_index, u32 index, u64 n_packets, u64 n_bytes)
Increment a combined counter.
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
A struct to hold tracing information for the MPLS label imposition node.
#define IP_FRAG_FLAG_MPLS_HEADER
static u8 * format_mpls_adj_incomplete_trace(u8 *s, va_list *args)
#define VLIB_NODE_FN(node)
vlib_error_t * errors
Vector of errors for this node.
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
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)
union ip_adjacency_t_::@48 sub_type
vlib_node_registration_t mpls_output_node
(constructor) VLIB_REGISTER_NODE (mpls_output_node)
static ip_adjacency_t * adj_get(adj_index_t adj_index)
Get a pointer to an adjacency object from its index.
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
mpls_adj_incomplete_next_t
struct ip_adjacency_t_::@48::@50 midchain
IP_LOOKUP_NEXT_MIDCHAIN.
u8 output_feature_arc_index
static uword mpls_output_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame, mpls_output_mode_t mode)
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.
#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.
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)
#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.
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.
vl_api_vxlan_gbp_api_tunnel_mode_t mode
#define IP_FRAG_FLAG_IP6_HEADER
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
#define IP_FRAG_FLAG_IP4_HEADER
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
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[]
fib_protocol_t ia_nh_proto
The protocol of the neighbor/peer.
VLIB buffer representation.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
struct mpls_adj_incomplete_trace_t_ mpls_adj_incomplete_trace_t
A struct to hold tracing information for the MPLS label imposition node.
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)
This adjacency/interface has output features configured.
static u32 set_mpls_fragmentation(vlib_buffer_t *p0, ip_adjacency_t *adj0)
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)