|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
35 #define foreach_mpls_output_next \
36 _(DROP, "error-drop") \
40 #define _(s,n) MPLS_OUTPUT_NEXT_##s,
53 s =
format (s,
"adj-idx %d : %U flow hash: 0x%08x",
81 to_next, n_left_to_next);
88 u32 pi0, adj_index0, next0, error0;
94 u32 pi1, adj_index1, next1, error1;
111 pi0 = to_next[0] =
from[0];
112 pi1 = to_next[1] =
from[1];
135 rw_len0 = adj0[0].rewrite_header.data_bytes;
136 rw_len1 = adj1[0].rewrite_header.data_bytes;
137 vnet_buffer (p0)->mpls.save_rewrite_length = rw_len0;
138 vnet_buffer (p1)->mpls.save_rewrite_length = rw_len1;
156 adj0[0].rewrite_header.max_l3_packet_bytes))
161 adj0[0].rewrite_header.sw_if_index;
162 next0 = adj0[0].rewrite_header.next_index;
163 error0 = IP4_ERROR_NONE;
167 adj0[0].rewrite_header.sw_if_index,
172 error0 = IP4_ERROR_MTU_EXCEEDED;
173 next0 = MPLS_OUTPUT_NEXT_FRAG;
175 MPLS_ERROR_PKTS_NEED_FRAG,
179 adj1[0].rewrite_header.max_l3_packet_bytes))
184 adj1[0].rewrite_header.sw_if_index;
185 next1 = adj1[0].rewrite_header.next_index;
186 error1 = IP4_ERROR_NONE;
190 adj1[0].rewrite_header.sw_if_index,
195 error1 = IP4_ERROR_MTU_EXCEEDED;
196 next1 = MPLS_OUTPUT_NEXT_FRAG;
198 MPLS_ERROR_PKTS_NEED_FRAG,
226 n_left_to_next, pi0, pi1, next0,
235 u32 pi0, adj_index0, next0, error0;
238 pi0 = to_next[0] =
from[0];
252 rw_len0 = adj0[0].rewrite_header.data_bytes;
253 vnet_buffer (p0)->mpls.save_rewrite_length = rw_len0;
264 adj0[0].rewrite_header.max_l3_packet_bytes))
269 adj0[0].rewrite_header.sw_if_index;
270 next0 = adj0[0].rewrite_header.next_index;
271 error0 = IP4_ERROR_NONE;
275 adj0[0].rewrite_header.sw_if_index,
280 error0 = IP4_ERROR_MTU_EXCEEDED;
281 next0 = MPLS_OUTPUT_NEXT_FRAG;
283 MPLS_ERROR_PKTS_NEED_FRAG,
307 to_next, n_left_to_next,
314 MPLS_ERROR_PKTS_ENCAP,
321 #define mpls_error(n,s) s,
334 .name =
"mpls-output",
336 .vector_size =
sizeof (
u32),
342 [MPLS_OUTPUT_NEXT_DROP] =
"mpls-drop",
343 [MPLS_OUTPUT_NEXT_FRAG] =
"mpls-frag",
356 .name =
"mpls-midchain",
357 .vector_size =
sizeof (
u32),
362 .sibling_of =
"mpls-output",
367 #define _(sym,string) string,
404 to_next, n_left_to_next);
416 pi0 = to_next[0] =
from[0];
431 adj0->rewrite_header.max_l3_packet_bytes,
435 adj0->rewrite_header.max_l3_packet_bytes,
442 tr->
mtu = adj0->rewrite_header.max_l3_packet_bytes;
454 else if (is_ip4 && error0 == IP_FRAG_ERROR_DONT_FRAGMENT_SET)
457 p0, ICMP4_destination_unreachable,
458 ICMP4_destination_unreachable_fragmentation_needed_and_dont_fragment_set,
470 u32 *frag_from, frag_left;
475 while (frag_left > 0)
477 while (frag_left > 0 && n_left_to_next > 0)
480 i = to_next[0] = frag_from[0];
490 to_next, n_left_to_next,
i,
503 return frame->n_vectors;
520 .vector_size =
sizeof (
u32),
539 #define foreach_mpls_adj_incomplete_next \
540 _(DROP, "error-drop") \
542 _(IP6, "ip6-discover-neighbor")
545 #define _(s,n) MPLS_ADJ_INCOMPLETE_NEXT_##s,
583 to_next, n_left_to_next);
587 u32 pi0, next0, adj_index0;
591 pi0 = to_next[0] =
from[0];
604 next0 = MPLS_ADJ_INCOMPLETE_NEXT_IP4;
608 next0 = MPLS_ADJ_INCOMPLETE_NEXT_IP6;
619 to_next, n_left_to_next,
640 s =
format (s,
"%Unext:%d",
647 .name =
"mpls-adj-incomplete",
650 .vector_size =
sizeof (
u32),
656 #define _(s,n) [MPLS_ADJ_INCOMPLETE_NEXT_##s] = n,
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
static char * mpls_frag_error_strings[]
fib_protocol_t ia_nh_proto
The protocol of the neighbor/peer.
#define foreach_mpls_adj_incomplete_next
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
@ MPLS_ADJ_INCOMPLETE_N_NEXT
nat44_ei_hairpin_src_next_t next_index
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
@ VLIB_NODE_TYPE_INTERNAL
@ MPLS_FRAG_NEXT_ICMP_ERROR
vlib_main_t vlib_node_runtime_t * node
struct mpls_frag_trace_t_ mpls_frag_trace_t
vl_api_tunnel_mode_t mode
@ VNET_REWRITE_HAS_FEATURES
This adjacency/interface has output features configured.
@ IP_LOOKUP_NEXT_MIDCHAIN
This packets follow a mid-chain adjacency.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static char * mpls_error_strings[]
vlib_main_t vlib_node_runtime_t vlib_frame_t * from_frame
static void vlib_error_count(vlib_main_t *vm, uword node_index, uword counter, uword increment)
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
@ MPLS_FRAG_NEXT_REWRITE_MIDCHAIN
#define CLIB_PREFETCH(addr, size, type)
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
vlib_error_t * errors
Vector of errors for this node.
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
vlib_error_t error
Error code for buffers to be enqueued to error handler.
@ MPLS_OUTPUT_MIDCHAIN_MODE
vlib_node_registration_t mpls_adj_incomplete_node
(constructor) VLIB_REGISTER_NODE (mpls_adj_incomplete_node)
#define VLIB_NODE_FN(node)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
ip_lookup_next_t lookup_next_index
Next hop after ip4-lookup.
static_always_inline uword vlib_get_thread_index(void)
static uword mpls_frag(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
#define foreach_mpls_output_next
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
ip_frag_error_t ip4_frag_do_fragment(vlib_main_t *vm, u32 from_bi, u16 mtu, u16 l2unfragmentablesize, u32 **buffer)
struct _vlib_node_registration vlib_node_registration_t
#define foreach_ip_frag_error
static_always_inline void icmp4_error_set_vnet_buffer(vlib_buffer_t *b, u8 type, u8 code, u32 data)
static u8 * format_mpls_frag_trace(u8 *s, va_list *args)
#define vec_free(V)
Free vector's memory (no header).
#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.
struct mpls_adj_incomplete_trace_t_ mpls_adj_incomplete_trace_t
A struct to hold tracing information for the MPLS label imposition node.
description fragment has unexpected format
vlib_combined_counter_main_t adjacency_counters
Adjacency packet counters.
vlib_put_next_frame(vm, node, next_index, 0)
static u8 * format_mpls_adj_incomplete_trace(u8 *s, va_list *args)
vlib_node_registration_t mpls_output_node
(constructor) VLIB_REGISTER_NODE (mpls_output_node)
static u8 * format_mpls_output_trace(u8 *s, va_list *args)
static vlib_node_runtime_t * vlib_node_get_runtime(vlib_main_t *vm, u32 node_index)
Get node runtime by node index.
ip_frag_error_t ip6_frag_do_fragment(vlib_main_t *vm, u32 from_bi, u16 mtu, u16 l2unfragmentablesize, u32 **buffer)
#define vnet_rewrite_two_headers(rw0, rw1, p0, p1, most_likely_size)
A struct to hold tracing information for the MPLS label imposition node.
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
vlib_node_registration_t mpls_midchain_node
(constructor) VLIB_REGISTER_NODE (mpls_midchain_node)
#define vnet_rewrite_one_header(rw0, p0, most_likely_size)
static uword mpls_output_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame, mpls_output_mode_t mode)
static_always_inline void vnet_feature_arc_start(u8 arc, u32 sw_if_index, u32 *next0, vlib_buffer_t *b0)
vlib_node_registration_t mpls_frag_node
(constructor) VLIB_REGISTER_NODE (mpls_frag_node)
static void vlib_buffer_free_one(vlib_main_t *vm, u32 buffer_index)
Free one buffer Shorthand to free a single buffer chain.
#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.
mpls_adj_incomplete_next_t
static_always_inline void adj_midchain_fixup(vlib_main_t *vm, const ip_adjacency_t *adj, vlib_buffer_t *b, vnet_link_t lt)
#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 ip_adjacency_t * adj_get(adj_index_t adj_index)
Get a pointer to an adjacency object from its index.
vl_api_fib_path_type_t type
vlib_increment_combined_counter(ccm, ti, sw_if_index, n_buffers, n_bytes)
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
u8 output_feature_arc_index
VLIB buffer representation.
#define VLIB_REGISTER_NODE(x,...)