|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
28 u8 packet_data[64 - 1*
sizeof(
u32)];
31 #define foreach_nsh_output_next \
32 _(DROP, "error-drop") \
33 _(INTERFACE, "interface-output" )
36 #define _(s,n) NSH_OUTPUT_NEXT_##s,
50 s =
format (s,
"adj-idx %d : %U flow hash: 0x%08x",
82 to_next, n_left_to_next);
87 nsh_base_header_t *hdr0;
90 u32 pi0, adj_index0, next0, error0;
93 nsh_base_header_t *hdr1;
96 u32 pi1, adj_index1, next1, error1;
97 int pkt_len0, pkt_len1;
98 word rw_len0, rw_len1;
114 pi0 = to_next[0] =
from[0];
115 pi1 = to_next[1] =
from[1];
138 eth_hdr0->
type = clib_host_to_net_u16(ETHERNET_TYPE_NSH);
140 eth_hdr1->
type = clib_host_to_net_u16(ETHERNET_TYPE_NSH);
143 rw_len0 = adj0[0].rewrite_header.data_bytes;
144 rw_len1 = adj1[0].rewrite_header.data_bytes;
149 if (adj_index0 == adj_index1)
152 pkt_len0 + rw_len0 + pkt_len1 + rw_len1);
163 adj0[0].rewrite_header.max_l3_packet_bytes))
168 adj0[0].rewrite_header.sw_if_index;
169 next0 = NSH_OUTPUT_NEXT_INTERFACE;
170 error0 = IP4_ERROR_NONE;
174 adj0[0].rewrite_header.sw_if_index,
179 error0 = IP4_ERROR_MTU_EXCEEDED;
180 next0 = NSH_OUTPUT_NEXT_DROP;
183 adj1[0].rewrite_header.max_l3_packet_bytes))
188 adj1[0].rewrite_header.sw_if_index;
189 next1 = NSH_OUTPUT_NEXT_INTERFACE;
190 error1 = IP4_ERROR_NONE;
194 adj1[0].rewrite_header.sw_if_index,
199 error1 = IP4_ERROR_MTU_EXCEEDED;
200 next1 = NSH_OUTPUT_NEXT_DROP;
229 to_next, n_left_to_next,
230 pi0, pi1, next0, next1);
236 nsh_base_header_t *hdr0;
239 u32 pi0, adj_index0, next0, error0;
243 pi0 = to_next[0] =
from[0];
257 eth_hdr0->
type = clib_host_to_net_u16(ETHERNET_TYPE_NSH);
260 rw_len0 = adj0[0].rewrite_header.data_bytes;
267 if (
PREDICT_TRUE(pkt_len0 <= adj0[0].rewrite_header.max_l3_packet_bytes))
272 adj0[0].rewrite_header.sw_if_index;
273 next0 = NSH_OUTPUT_NEXT_INTERFACE;
274 error0 = IP4_ERROR_NONE;
278 adj0[0].rewrite_header.sw_if_index,
283 error0 = IP4_ERROR_MTU_EXCEEDED;
284 next0 = NSH_OUTPUT_NEXT_DROP;
308 to_next, n_left_to_next,
331 .name =
"nsh-eth-output",
333 .vector_size =
sizeof (
u32),
336 #define _(s,n) [NSH_OUTPUT_NEXT_##s] = n,
352 .name =
"nsh-midchain",
353 .vector_size =
sizeof (
u32),
363 .arc_name =
"nsh-eth-output",
364 .node_name =
"interface-output",
372 .arc_name =
"nsh-eth-output",
378 .arc_name =
"nsh-eth-output",
379 .node_name =
"error-drop",
386 #define foreach_nsh_adj_incomplete_next \
387 _(DROP, "error-drop") \
389 _(IP6, "ip6-discover-neighbor")
392 #define _(s,n) NSH_ADJ_INCOMPLETE_NEXT_##s,
430 to_next, n_left_to_next);
434 u32 pi0, next0, adj_index0;
438 pi0 = to_next[0] =
from[0];
451 next0 = NSH_ADJ_INCOMPLETE_NEXT_IP4;
455 next0 = NSH_ADJ_INCOMPLETE_NEXT_IP6;
466 to_next, n_left_to_next,
487 s =
format (s,
"%Unext:%d",
494 .name =
"nsh-adj-incomplete",
497 .vector_size =
sizeof (
u32),
500 #define _(s,n) [NSH_ADJ_INCOMPLETE_NEXT_##s] = n,
fib_protocol_t ia_nh_proto
The protocol of the neighbor/peer.
VNET_FEATURE_INIT(nsh_interface_output, static)
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
enum nsh_midchain_next_t_ nsh_midchain_next_t
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_registration_t nsh_adj_incomplete_node
(constructor) VLIB_REGISTER_NODE (nsh_adj_incomplete_node)
vlib_main_t vlib_node_runtime_t * node
static u8 * format_nsh_adj_incomplete_trace(u8 *s, va_list *args)
@ VNET_REWRITE_HAS_FEATURES
This adjacency/interface has output features configured.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
A struct to hold tracing information for the NSH label imposition node.
vlib_main_t vlib_node_runtime_t vlib_frame_t * from_frame
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
#define foreach_nsh_output_next
#define CLIB_PREFETCH(addr, size, type)
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.
vlib_error_t error
Error code for buffers to be enqueued to error handler.
#define VLIB_NODE_FN(node)
@ NSH_ADJ_INCOMPLETE_N_NEXT
static_always_inline uword vlib_get_thread_index(void)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
u8 packet_data[64 - 1 *sizeof(u32)]
vlib_node_registration_t nsh_midchain_node
(constructor) VLIB_REGISTER_NODE (nsh_midchain_node)
struct _vlib_node_registration vlib_node_registration_t
vlib_node_registration_t nsh_eth_output_node
(constructor) VLIB_REGISTER_NODE (nsh_eth_output_node)
union ip_adjacency_t_::@144 sub_type
#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 nsh_adj_incomplete_trace_t_ nsh_adj_incomplete_trace_t
A struct to hold tracing information for the NSH label imposition node.
static u8 * format_nsh_output_trace(u8 *s, va_list *args)
nsh_adj_incomplete_next_t
description fragment has unexpected format
vlib_combined_counter_main_t adjacency_counters
Adjacency packet counters.
vlib_put_next_frame(vm, node, next_index, 0)
VNET_FEATURE_ARC_INIT(nsh_eth_output, static)
static uword nsh_output_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame, int is_midchain)
static vlib_node_runtime_t * vlib_node_get_runtime(vlib_main_t *vm, u32 node_index)
Get node runtime by node index.
#define vnet_rewrite_two_headers(rw0, rw1, p0, p1, most_likely_size)
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
#define VNET_FEATURES(...)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
#define vnet_rewrite_one_header(rw0, p0, most_likely_size)
static_always_inline void vnet_feature_arc_start(u8 arc, u32 sw_if_index, u32 *next0, vlib_buffer_t *b0)
#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_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).
#define foreach_nsh_adj_incomplete_next
Next index values from the NSH incomplete adj node.
static ip_adjacency_t * adj_get(adj_index_t adj_index)
Get a pointer to an adjacency object from its index.
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,...
VLIB buffer representation.
#define VLIB_REGISTER_NODE(x,...)
struct ip_adjacency_t_::@144::@146 midchain
IP_LOOKUP_NEXT_MIDCHAIN.