FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
nsh_output.c
Go to the documentation of this file.
1 /*
2  * nsh_output.c: NSH Adj rewrite
3  *
4  * Copyright (c) 2017-2019 Intel and/or its affiliates.
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at:
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #include <vlib/vlib.h>
19 #include <vnet/ip/ip.h>
20 #include <nsh/nsh.h>
21 
22 typedef struct {
23  /* Adjacency taken. */
26 
27  /* Packet data, possibly *after* rewrite. */
28  u8 packet_data[64 - 1*sizeof(u32)];
30 
31 #define foreach_nsh_output_next \
32 _(DROP, "error-drop") \
33 _(INTERFACE, "interface-output" )
34 
35 typedef enum {
36 #define _(s,n) NSH_OUTPUT_NEXT_##s,
38 #undef _
41 
42 static u8 *
43 format_nsh_output_trace (u8 * s, va_list * args)
44 {
45  CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
46  CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
47  nsh_output_trace_t * t = va_arg (*args, nsh_output_trace_t *);
48  uword indent = format_get_indent (s);
49 
50  s = format (s, "adj-idx %d : %U flow hash: 0x%08x",
51  t->adj_index,
53  t->flow_hash);
54  s = format (s, "\n%U%U",
55  format_white_space, indent,
57  t->adj_index, t->packet_data, sizeof (t->packet_data));
58  return s;
59 }
60 
61 static inline uword
65  int is_midchain)
66 {
67  u32 n_left_from, next_index, * from, * to_next, thread_index;
68  vlib_node_runtime_t * error_node;
69  u32 n_left_to_next;
70  nsh_main_t *nm;
71 
73  error_node = vlib_node_get_runtime (vm, nsh_eth_output_node.index);
75  n_left_from = from_frame->n_vectors;
76  next_index = node->cached_next_index;
77  nm = &nsh_main;
78 
79  while (n_left_from > 0)
80  {
82  to_next, n_left_to_next);
83 
84  while (n_left_from >= 4 && n_left_to_next >= 2)
85  {
86  ip_adjacency_t * adj0;
87  nsh_base_header_t *hdr0;
88  ethernet_header_t * eth_hdr0;
89  vlib_buffer_t * p0;
90  u32 pi0, adj_index0, next0, error0;
91 
92  ip_adjacency_t * adj1;
93  nsh_base_header_t *hdr1;
94  ethernet_header_t * eth_hdr1;
95  vlib_buffer_t * p1;
96  u32 pi1, adj_index1, next1, error1;
97  int pkt_len0, pkt_len1;
98  word rw_len0, rw_len1;
99 
100  /* Prefetch next iteration. */
101  {
102  vlib_buffer_t * p2, * p3;
103 
104  p2 = vlib_get_buffer (vm, from[2]);
105  p3 = vlib_get_buffer (vm, from[3]);
106 
107  vlib_prefetch_buffer_header (p2, STORE);
108  vlib_prefetch_buffer_header (p3, STORE);
109 
110  CLIB_PREFETCH (p2->data, sizeof (hdr0[0]), STORE);
111  CLIB_PREFETCH (p3->data, sizeof (hdr1[0]), STORE);
112  }
113 
114  pi0 = to_next[0] = from[0];
115  pi1 = to_next[1] = from[1];
116 
117  from += 2;
118  n_left_from -= 2;
119  to_next += 2;
120  n_left_to_next -= 2;
121 
122  p0 = vlib_get_buffer (vm, pi0);
123  p1 = vlib_get_buffer (vm, pi1);
124 
125  adj_index0 = vnet_buffer (p0)->ip.adj_index[VLIB_TX];
126  adj_index1 = vnet_buffer (p1)->ip.adj_index[VLIB_TX];
127 
128  adj0 = adj_get(adj_index0);
129  adj1 = adj_get(adj_index1);
130  hdr0 = vlib_buffer_get_current (p0);
131  hdr1 = vlib_buffer_get_current (p1);
132 
133  /* Guess we are only writing on simple Ethernet header. */
134  vnet_rewrite_two_headers (adj0[0], adj1[0], hdr0, hdr1,
135  sizeof (ethernet_header_t));
136 
137  eth_hdr0 = (ethernet_header_t*)((u8 *)hdr0-sizeof(ethernet_header_t));
138  eth_hdr0->type = clib_host_to_net_u16(ETHERNET_TYPE_NSH);
139  eth_hdr1 = (ethernet_header_t*)((u8 *)hdr1-sizeof(ethernet_header_t));
140  eth_hdr1->type = clib_host_to_net_u16(ETHERNET_TYPE_NSH);
141 
142  /* Update packet buffer attributes/set output interface. */
143  rw_len0 = adj0[0].rewrite_header.data_bytes;
144  rw_len1 = adj1[0].rewrite_header.data_bytes;
145  pkt_len0 = vlib_buffer_length_in_chain (vm, p0);
146  pkt_len1 = vlib_buffer_length_in_chain (vm, p1);
147 
148  /* Bump the adj counters for packet and bytes */
149  if (adj_index0 == adj_index1)
150  {
152  pkt_len0 + rw_len0 + pkt_len1 + rw_len1);
153  }
154  else
155  {
157  pkt_len0 + rw_len0);
159  pkt_len1 + rw_len1);
160  }
161  /* Check MTU of outgoing interface. */
162  if (PREDICT_TRUE(pkt_len0 <=
163  adj0[0].rewrite_header.max_l3_packet_bytes))
164  {
165  vlib_buffer_advance (p0, -rw_len0);
166 
167  vnet_buffer (p0)->sw_if_index[VLIB_TX] =
168  adj0[0].rewrite_header.sw_if_index;
169  next0 = NSH_OUTPUT_NEXT_INTERFACE;
170  error0 = IP4_ERROR_NONE;
171 
172  if (PREDICT_FALSE(adj0[0].rewrite_header.flags & VNET_REWRITE_HAS_FEATURES))
173  vnet_feature_arc_start (nm->output_feature_arc_index,
174  adj0[0].rewrite_header.sw_if_index,
175  &next0, p0);
176  }
177  else
178  {
179  error0 = IP4_ERROR_MTU_EXCEEDED;
180  next0 = NSH_OUTPUT_NEXT_DROP;
181  }
182  if (PREDICT_TRUE(pkt_len1 <=
183  adj1[0].rewrite_header.max_l3_packet_bytes))
184  {
185  vlib_buffer_advance (p1, -rw_len1);
186 
187  vnet_buffer (p1)->sw_if_index[VLIB_TX] =
188  adj1[0].rewrite_header.sw_if_index;
189  next1 = NSH_OUTPUT_NEXT_INTERFACE;
190  error1 = IP4_ERROR_NONE;
191 
192  if (PREDICT_FALSE(adj1[0].rewrite_header.flags & VNET_REWRITE_HAS_FEATURES))
193  vnet_feature_arc_start (nm->output_feature_arc_index,
194  adj1[0].rewrite_header.sw_if_index,
195  &next1, p1);
196  }
197  else
198  {
199  error1 = IP4_ERROR_MTU_EXCEEDED;
200  next1 = NSH_OUTPUT_NEXT_DROP;
201  }
202  if (is_midchain)
203  {
204  adj0->sub_type.midchain.fixup_func
205  (vm, adj0, p0, adj0->sub_type.midchain.fixup_data);
206  adj1->sub_type.midchain.fixup_func
207  (vm, adj1, p1, adj1->sub_type.midchain.fixup_data);
208  }
209 
210  p0->error = error_node->errors[error0];
211  p1->error = error_node->errors[error1];
212 
213  if (PREDICT_FALSE(p0->flags & VLIB_BUFFER_IS_TRACED))
214  {
216  p0, sizeof (*tr));
217  tr->adj_index = vnet_buffer(p0)->ip.adj_index[VLIB_TX];
218  tr->flow_hash = vnet_buffer(p0)->ip.flow_hash;
219  }
220  if (PREDICT_FALSE(p1->flags & VLIB_BUFFER_IS_TRACED))
221  {
223  p1, sizeof (*tr));
224  tr->adj_index = vnet_buffer(p1)->ip.adj_index[VLIB_TX];
225  tr->flow_hash = vnet_buffer(p1)->ip.flow_hash;
226  }
227 
229  to_next, n_left_to_next,
230  pi0, pi1, next0, next1);
231  }
232 
233  while (n_left_from > 0 && n_left_to_next > 0)
234  {
235  ip_adjacency_t * adj0;
236  nsh_base_header_t *hdr0;
237  ethernet_header_t * eth_hdr0;
238  vlib_buffer_t * p0;
239  u32 pi0, adj_index0, next0, error0;
240  int pkt_len0;
241  word rw_len0;
242 
243  pi0 = to_next[0] = from[0];
244 
245  p0 = vlib_get_buffer (vm, pi0);
246 
247  adj_index0 = vnet_buffer (p0)->ip.adj_index[VLIB_TX];
248 
249  adj0 = adj_get(adj_index0);
250  hdr0 = vlib_buffer_get_current (p0);
251 
252  /* Guess we are only writing on simple Ethernet header. */
253  vnet_rewrite_one_header (adj0[0], hdr0,
254  sizeof (ethernet_header_t));
255 
256  eth_hdr0 = (ethernet_header_t*)((u8 *)hdr0-sizeof(ethernet_header_t));
257  eth_hdr0->type = clib_host_to_net_u16(ETHERNET_TYPE_NSH);
258 
259  /* Update packet buffer attributes/set output interface. */
260  rw_len0 = adj0[0].rewrite_header.data_bytes;
261  pkt_len0 = vlib_buffer_length_in_chain (vm, p0);
262 
264  pkt_len0 + rw_len0);
265 
266  /* Check MTU of outgoing interface. */
267  if (PREDICT_TRUE(pkt_len0 <= adj0[0].rewrite_header.max_l3_packet_bytes))
268  {
269  vlib_buffer_advance (p0, -rw_len0);
270 
271  vnet_buffer (p0)->sw_if_index[VLIB_TX] =
272  adj0[0].rewrite_header.sw_if_index;
273  next0 = NSH_OUTPUT_NEXT_INTERFACE;
274  error0 = IP4_ERROR_NONE;
275 
276  if (PREDICT_FALSE(adj0[0].rewrite_header.flags & VNET_REWRITE_HAS_FEATURES))
277  vnet_feature_arc_start (nm->output_feature_arc_index,
278  adj0[0].rewrite_header.sw_if_index,
279  &next0, p0);
280  }
281  else
282  {
283  error0 = IP4_ERROR_MTU_EXCEEDED;
284  next0 = NSH_OUTPUT_NEXT_DROP;
285  }
286  if (is_midchain)
287  {
288  adj0->sub_type.midchain.fixup_func
289  (vm, adj0, p0, adj0->sub_type.midchain.fixup_data);
290  }
291 
292  p0->error = error_node->errors[error0];
293 
294  from += 1;
295  n_left_from -= 1;
296  to_next += 1;
297  n_left_to_next -= 1;
298 
299  if (PREDICT_FALSE(p0->flags & VLIB_BUFFER_IS_TRACED))
300  {
302  p0, sizeof (*tr));
303  tr->adj_index = vnet_buffer(p0)->ip.adj_index[VLIB_TX];
304  tr->flow_hash = vnet_buffer(p0)->ip.flow_hash;
305  }
306 
308  to_next, n_left_to_next,
309  pi0, next0);
310  }
311 
312  vlib_put_next_frame (vm, node, next_index, n_left_to_next);
313  }
314 
315  return from_frame->n_vectors;
316 }
317 
319 {
322 
326 {
327  return (nsh_output_inline(vm, node, from_frame, /* is_midchain */ 0));
328 }
329 
331  .name = "nsh-eth-output",
332  /* Takes a vector of packets. */
333  .vector_size = sizeof (u32),
334  .n_next_nodes = NSH_OUTPUT_N_NEXT,
335  .next_nodes = {
336 #define _(s,n) [NSH_OUTPUT_NEXT_##s] = n,
338 #undef _
339  },
340 
341  .format_trace = format_nsh_output_trace,
342 };
343 
347 {
348  return (nsh_output_inline(vm, node, from_frame, /* is_midchain */ 1));
349 }
350 
352  .name = "nsh-midchain",
353  .vector_size = sizeof (u32),
354  .format_trace = format_nsh_output_trace,
355  .n_next_nodes = 1,
356  .next_nodes = {
357  [NSH_MIDCHAIN_NEXT_DROP] = "error-drop",
358  },
359 };
360 
361 /* Built-in nsh tx feature path definition */
362 VNET_FEATURE_INIT (nsh_interface_output, static) = {
363  .arc_name = "nsh-eth-output",
364  .node_name = "interface-output",
365  .runs_before = 0, /* not before any other features */
366 };
367 
368 /* Built-in ip4 tx feature path definition */
369 /* *INDENT-OFF* */
370 VNET_FEATURE_ARC_INIT (nsh_eth_output, static) =
371 {
372  .arc_name = "nsh-eth-output",
373  .start_nodes = VNET_FEATURES ("nsh-midchain"),
374 };
375 
376 VNET_FEATURE_INIT (nsh_eth_tx_drop, static) =
377 {
378  .arc_name = "nsh-eth-output",
379  .node_name = "error-drop",
380  .runs_before = 0, /* not before any other features */
381 };
382 /* *INDENT-ON* */
383 /**
384  * @brief Next index values from the NSH incomplete adj node
385  */
386 #define foreach_nsh_adj_incomplete_next \
387 _(DROP, "error-drop") \
388 _(IP4, "ip4-arp") \
389 _(IP6, "ip6-discover-neighbor")
390 
391 typedef enum {
392 #define _(s,n) NSH_ADJ_INCOMPLETE_NEXT_##s,
394 #undef _
397 
398 /**
399  * @brief A struct to hold tracing information for the NSH label imposition
400  * node.
401  */
403 {
406 
407 
408 /**
409  * @brief Graph node for incomplete NSH adjacency.
410  * This node will push traffic to either the v4-arp or v6-nd node
411  * based on the next-hop proto of the adj.
412  * We pay a cost for this 'routing' node, but an incomplete adj is the
413  * exception case.
414  */
418 {
419  u32 n_left_from, next_index, * from, * to_next;
420 
422  n_left_from = from_frame->n_vectors;
423  next_index = node->cached_next_index;
424 
425  while (n_left_from > 0)
426  {
427  u32 n_left_to_next;
428 
430  to_next, n_left_to_next);
431 
432  while (n_left_from > 0 && n_left_to_next > 0)
433  {
434  u32 pi0, next0, adj_index0;
435  ip_adjacency_t * adj0;
436  vlib_buffer_t * p0;
437 
438  pi0 = to_next[0] = from[0];
439  p0 = vlib_get_buffer (vm, pi0);
440  from += 1;
441  n_left_from -= 1;
442  to_next += 1;
443  n_left_to_next -= 1;
444 
445  adj_index0 = vnet_buffer (p0)->ip.adj_index[VLIB_TX];
446 
447  adj0 = adj_get(adj_index0);
448 
450  {
451  next0 = NSH_ADJ_INCOMPLETE_NEXT_IP4;
452  }
453  else
454  {
455  next0 = NSH_ADJ_INCOMPLETE_NEXT_IP6;
456  }
457 
458  if (PREDICT_FALSE(p0->flags & VLIB_BUFFER_IS_TRACED))
459  {
461  vlib_add_trace (vm, node, p0, sizeof (*tr));
462  tr->next = next0;
463  }
464 
466  to_next, n_left_to_next,
467  pi0, next0);
468  }
469 
470  vlib_put_next_frame (vm, node, next_index, n_left_to_next);
471  }
472 
473  return from_frame->n_vectors;
474 }
475 
476 static u8 *
477 format_nsh_adj_incomplete_trace (u8 * s, va_list * args)
478 {
479  CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
480  CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
482  uword indent;
483 
484  t = va_arg (*args, nsh_adj_incomplete_trace_t *);
485  indent = format_get_indent (s);
486 
487  s = format (s, "%Unext:%d",
488  format_white_space, indent,
489  t->next);
490  return (s);
491 }
492 
494  .name = "nsh-adj-incomplete",
495  .format_trace = format_nsh_adj_incomplete_trace,
496  /* Takes a vector of packets. */
497  .vector_size = sizeof (u32),
498  .n_next_nodes = NSH_ADJ_INCOMPLETE_N_NEXT,
499  .next_nodes = {
500 #define _(s,n) [NSH_ADJ_INCOMPLETE_NEXT_##s] = n,
502 #undef _
503  },
504 };
505 
vlib.h
nsh_output_trace_t::adj_index
u32 adj_index
Definition: nsh_output.c:24
nsh_output_trace_t::flow_hash
u32 flow_hash
Definition: nsh_output.c:25
ip_adjacency_t_::ia_nh_proto
fib_protocol_t ia_nh_proto
The protocol of the neighbor/peer.
Definition: adj.h:350
VNET_FEATURE_INIT
VNET_FEATURE_INIT(nsh_interface_output, static)
thread_index
u32 thread_index
Definition: nat44_ei_hairpinning.c:495
vlib_prefetch_buffer_header
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
Definition: buffer.h:231
nsh_midchain_next_t
enum nsh_midchain_next_t_ nsh_midchain_next_t
next_index
nat44_ei_hairpin_src_next_t next_index
Definition: nat44_ei_hairpinning.c:412
vlib_get_buffer
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
Definition: buffer_funcs.h:111
format_ip_adjacency
format_function_t format_ip_adjacency
Definition: format.h:58
nsh_adj_incomplete_node
vlib_node_registration_t nsh_adj_incomplete_node
(constructor) VLIB_REGISTER_NODE (nsh_adj_incomplete_node)
Definition: nsh_output.c:493
node
vlib_main_t vlib_node_runtime_t * node
Definition: nat44_ei.c:3047
nsh_output_next_t
nsh_output_next_t
Definition: nsh_output.c:35
format_nsh_adj_incomplete_trace
static u8 * format_nsh_adj_incomplete_trace(u8 *s, va_list *args)
Definition: nsh_output.c:477
FORMAT_IP_ADJACENCY_NONE
@ FORMAT_IP_ADJACENCY_NONE
Definition: format.h:53
VNET_REWRITE_HAS_FEATURES
@ VNET_REWRITE_HAS_FEATURES
This adjacency/interface has output features configured.
Definition: rewrite.h:57
ethernet_header_t::type
u16 type
Definition: packet.h:59
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
nsh_adj_incomplete_trace_t_
A struct to hold tracing information for the NSH label imposition node.
Definition: nsh_output.c:402
from_frame
vlib_main_t vlib_node_runtime_t vlib_frame_t * from_frame
Definition: esp_encrypt.c:1328
vlib_frame_t
Definition: node.h:372
vlib_buffer_length_in_chain
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
Definition: buffer_funcs.h:433
foreach_nsh_output_next
#define foreach_nsh_output_next
Definition: nsh_output.c:31
nsh_main_t
Definition: nsh.h:105
CLIB_PREFETCH
#define CLIB_PREFETCH(addr, size, type)
Definition: cache.h:76
vlib_node_runtime_t::errors
vlib_error_t * errors
Vector of errors for this node.
Definition: node.h:460
format_ip_adjacency_packet_data
format_function_t format_ip_adjacency_packet_data
Definition: format.h:59
vlib_buffer_advance
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
Definition: buffer.h:276
vlib_buffer_t::error
vlib_error_t error
Error code for buffers to be enqueued to error handler.
Definition: buffer.h:145
VLIB_NODE_FN
#define VLIB_NODE_FN(node)
Definition: node.h:202
NSH_ADJ_INCOMPLETE_N_NEXT
@ NSH_ADJ_INCOMPLETE_N_NEXT
Definition: nsh_output.c:395
CLIB_UNUSED
#define CLIB_UNUSED(x)
Definition: clib.h:90
vnet_buffer
#define vnet_buffer(b)
Definition: buffer.h:441
PREDICT_FALSE
#define PREDICT_FALSE(x)
Definition: clib.h:124
vlib_get_thread_index
static_always_inline uword vlib_get_thread_index(void)
Definition: threads.h:187
vlib_frame_vector_args
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
Definition: node_funcs.h:301
nsh_output_trace_t::packet_data
u8 packet_data[64 - 1 *sizeof(u32)]
Definition: nsh_output.c:28
nsh_midchain_node
vlib_node_registration_t nsh_midchain_node
(constructor) VLIB_REGISTER_NODE (nsh_midchain_node)
Definition: nsh_output.c:351
uword
u64 uword
Definition: types.h:112
ethernet_header_t
Definition: packet.h:52
ip_adjacency_t_
IP unicast adjacency.
Definition: adj.h:235
FIB_PROTOCOL_IP4
@ FIB_PROTOCOL_IP4
Definition: fib_types.h:36
vlib_node_registration_t
struct _vlib_node_registration vlib_node_registration_t
nsh_eth_output_node
vlib_node_registration_t nsh_eth_output_node
(constructor) VLIB_REGISTER_NODE (nsh_eth_output_node)
Definition: nsh_output.c:330
nsh_output_trace_t
Definition: nsh_output.c:22
ip_adjacency_t_::sub_type
union ip_adjacency_t_::@144 sub_type
vlib_validate_buffer_enqueue_x1
#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.
Definition: buffer_node.h:224
nsh_adj_incomplete_trace_t
struct nsh_adj_incomplete_trace_t_ nsh_adj_incomplete_trace_t
A struct to hold tracing information for the NSH label imposition node.
format_nsh_output_trace
static u8 * format_nsh_output_trace(u8 *s, va_list *args)
Definition: nsh_output.c:43
nsh_adj_incomplete_next_t
nsh_adj_incomplete_next_t
Definition: nsh_output.c:391
nsh_main
nsh_main_t nsh_main
Definition: nsh.c:28
format
description fragment has unexpected format
Definition: map.api:433
nsh.h
adjacency_counters
vlib_combined_counter_main_t adjacency_counters
Adjacency packet counters.
Definition: adj.c:26
format_get_indent
static u32 format_get_indent(u8 *s)
Definition: format.h:72
NSH_MIDCHAIN_NEXT_DROP
@ NSH_MIDCHAIN_NEXT_DROP
Definition: nsh_output.c:320
vlib_put_next_frame
vlib_put_next_frame(vm, node, next_index, 0)
ip.h
u32
unsigned int u32
Definition: types.h:88
VNET_FEATURE_ARC_INIT
VNET_FEATURE_ARC_INIT(nsh_eth_output, static)
nsh_output_inline
static uword nsh_output_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame, int is_midchain)
Definition: nsh_output.c:62
nm
nat44_ei_main_t * nm
Definition: nat44_ei_hairpinning.c:413
vlib_node_get_runtime
static vlib_node_runtime_t * vlib_node_get_runtime(vlib_main_t *vm, u32 node_index)
Get node runtime by node index.
Definition: node_funcs.h:116
vnet_rewrite_two_headers
#define vnet_rewrite_two_headers(rw0, rw1, p0, p1, most_likely_size)
Definition: rewrite.h:222
vlib_main_t
Definition: main.h:102
vlib_node_t
Definition: node.h:247
vlib_add_trace
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
Definition: trace.c:628
VNET_FEATURES
#define VNET_FEATURES(...)
Definition: feature.h:470
u8
unsigned char u8
Definition: types.h:56
vlib_buffer_get_current
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
Definition: buffer.h:257
vlib_buffer_t::data
u8 data[]
Packet data.
Definition: buffer.h:204
vnet_rewrite_one_header
#define vnet_rewrite_one_header(rw0, p0, most_likely_size)
Definition: rewrite.h:218
nsh_adj_incomplete_trace_t_::next
u32 next
Definition: nsh_output.c:404
vnet_feature_arc_start
static_always_inline void vnet_feature_arc_start(u8 arc, u32 sw_if_index, u32 *next0, vlib_buffer_t *b0)
Definition: feature.h:302
word
i64 word
Definition: types.h:111
nsh_midchain_next_t_
nsh_midchain_next_t_
Definition: nsh_output.c:318
vlib_validate_buffer_enqueue_x2
#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.
Definition: buffer_node.h:70
NSH_OUTPUT_N_NEXT
@ NSH_OUTPUT_N_NEXT
Definition: nsh_output.c:39
vlib_node_runtime_t
Definition: node.h:454
from
from
Definition: nat44_ei_hairpinning.c:415
PREDICT_TRUE
#define PREDICT_TRUE(x)
Definition: clib.h:125
vlib_get_next_frame
#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).
Definition: node_funcs.h:395
foreach_nsh_adj_incomplete_next
#define foreach_nsh_adj_incomplete_next
Next index values from the NSH incomplete adj node.
Definition: nsh_output.c:386
VLIB_TX
@ VLIB_TX
Definition: defs.h:47
adj_get
static ip_adjacency_t * adj_get(adj_index_t adj_index)
Get a pointer to an adjacency object from its index.
Definition: adj.h:470
n_left_from
n_left_from
Definition: nat44_ei_hairpinning.c:416
vlib_increment_combined_counter
vlib_increment_combined_counter(ccm, ti, sw_if_index, n_buffers, n_bytes)
format_white_space
u8 * format_white_space(u8 *s, va_list *va)
Definition: std-formats.c:129
vlib_buffer_t::flags
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
Definition: buffer.h:133
vlib_buffer_t
VLIB buffer representation.
Definition: buffer.h:111
VLIB_REGISTER_NODE
#define VLIB_REGISTER_NODE(x,...)
Definition: node.h:169
ip_adjacency_t_::midchain
struct ip_adjacency_t_::@144::@146 midchain
IP_LOOKUP_NEXT_MIDCHAIN.