FD.io VPP  v16.06
Vector Packet Processing
decap.c
Go to the documentation of this file.
1 /*
2  * decap.c: vxlan tunnel decap packet processing
3  *
4  * Copyright (c) 2013 Cisco 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/pg/pg.h>
20 #include <vnet/vxlan/vxlan.h>
21 
23 
24 typedef struct {
30 
31 static u8 * format_vxlan_rx_trace (u8 * s, va_list * args)
32 {
33  CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
34  CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
35  vxlan_rx_trace_t * t = va_arg (*args, vxlan_rx_trace_t *);
36 
37  if (t->tunnel_index != ~0)
38  {
39  s = format (s, "VXLAN: tunnel %d vni %d next %d error %d",
40  t->tunnel_index, t->vni, t->next_index, t->error);
41  }
42  else
43  {
44  s = format (s, "VXLAN: no tunnel for vni %d next %d error %d",
45  t->vni, t->next_index, t->error);
46  }
47  return s;
48 }
49 
52  vlib_node_runtime_t * node,
53  vlib_frame_t * from_frame,
54  char is_ip4)
55 {
56  u32 n_left_from, next_index, * from, * to_next;
57  vxlan_main_t * vxm = &vxlan_main;
58  vnet_main_t * vnm = vxm->vnet_main;
60  u32 last_tunnel_index = ~0;
61  vxlan4_tunnel_key_t last_key4;
62  vxlan6_tunnel_key_t last_key6;
63  u32 pkts_decapsulated = 0;
64  u32 cpu_index = os_get_cpu_number();
65  u32 stats_sw_if_index, stats_n_packets, stats_n_bytes;
66 
67  last_key4.as_u64 = ~0;
68 
69  from = vlib_frame_vector_args (from_frame);
70  n_left_from = from_frame->n_vectors;
71 
72  next_index = node->cached_next_index;
73  stats_sw_if_index = node->runtime_data[0];
74  stats_n_packets = stats_n_bytes = 0;
75 
76  while (n_left_from > 0)
77  {
78  u32 n_left_to_next;
79 
80  vlib_get_next_frame (vm, node, next_index,
81  to_next, n_left_to_next);
82  while (n_left_from >= 4 && n_left_to_next >= 2)
83  {
84  u32 bi0, bi1;
85  vlib_buffer_t * b0, * b1;
86  u32 next0, next1;
87  ip4_header_t * ip4_0, * ip4_1;
88  ip6_header_t * ip6_0, * ip6_1;
89  vxlan_header_t * vxlan0, * vxlan1;
90  uword * p0, * p1;
91  u32 tunnel_index0, tunnel_index1;
92  vxlan_tunnel_t * t0, * t1;
93  vxlan4_tunnel_key_t key4_0, key4_1;
94  vxlan6_tunnel_key_t key6_0, key6_1;
95  u32 error0, error1;
96  u32 sw_if_index0, sw_if_index1, len0, len1;
97 
98  /* Prefetch next iteration. */
99  {
100  vlib_buffer_t * p2, * p3;
101 
102  p2 = vlib_get_buffer (vm, from[2]);
103  p3 = vlib_get_buffer (vm, from[3]);
104 
105  vlib_prefetch_buffer_header (p2, LOAD);
106  vlib_prefetch_buffer_header (p3, LOAD);
107 
110  }
111 
112  bi0 = from[0];
113  bi1 = from[1];
114  to_next[0] = bi0;
115  to_next[1] = bi1;
116  from += 2;
117  to_next += 2;
118  n_left_to_next -= 2;
119  n_left_from -= 2;
120 
121  b0 = vlib_get_buffer (vm, bi0);
122  b1 = vlib_get_buffer (vm, bi1);
123 
124  /* udp leaves current_data pointing at the vxlan header */
125  vxlan0 = vlib_buffer_get_current (b0);
126  vxlan1 = vlib_buffer_get_current (b1);
127 
128  if (is_ip4) {
130  (b0, -(word)(sizeof(udp_header_t)+sizeof(ip4_header_t)));
132  (b1, -(word)(sizeof(udp_header_t)+sizeof(ip4_header_t)));
133  ip4_0 = vlib_buffer_get_current (b0);
134  ip4_1 = vlib_buffer_get_current (b1);
135  } else {
137  (b0, -(word)(sizeof(udp_header_t)+sizeof(ip6_header_t)));
139  (b1, -(word)(sizeof(udp_header_t)+sizeof(ip6_header_t)));
140  ip6_0 = vlib_buffer_get_current (b0);
141  ip6_1 = vlib_buffer_get_current (b1);
142  }
143 
144  /* pop (ip, udp, vxlan) */
145  if (is_ip4) {
147  (b0, sizeof(*ip4_0)+sizeof(udp_header_t)+sizeof(*vxlan0));
149  (b1, sizeof(*ip4_1)+sizeof(udp_header_t)+sizeof(*vxlan1));
150  } else {
152  (b0, sizeof(*ip6_0)+sizeof(udp_header_t)+sizeof(*vxlan0));
154  (b1, sizeof(*ip6_1)+sizeof(udp_header_t)+sizeof(*vxlan1));
155  }
156 
157  tunnel_index0 = ~0;
158  error0 = 0;
159 
160  tunnel_index1 = ~0;
161  error1 = 0;
162 
163  if (is_ip4) {
164  key4_0.src = ip4_0->src_address.as_u32;
165  key4_0.vni = vxlan0->vni_reserved;
166 
167  if (PREDICT_FALSE (key4_0.as_u64 != last_key4.as_u64))
168  {
169  p0 = hash_get (vxm->vxlan4_tunnel_by_key, key4_0.as_u64);
170 
171  if (p0 == 0)
172  {
173  error0 = VXLAN_ERROR_NO_SUCH_TUNNEL;
174  next0 = VXLAN_INPUT_NEXT_DROP;
175  goto trace0;
176  }
177 
178  last_key4.as_u64 = key4_0.as_u64;
179  tunnel_index0 = last_tunnel_index = p0[0];
180  }
181  else
182  tunnel_index0 = last_tunnel_index;
183  } else /* !is_ip4 */ {
184  key6_0.src.as_u64[0] = ip6_0->src_address.as_u64[0];
185  key6_0.src.as_u64[1] = ip6_0->src_address.as_u64[1];
186  key6_0.vni = vxlan0->vni_reserved;
187 
188  if (PREDICT_FALSE (memcmp(&key6_0, &last_key6, sizeof(last_key6)) != 0))
189  {
190  p0 = hash_get_mem (vxm->vxlan6_tunnel_by_key, &key6_0);
191 
192  if (p0 == 0)
193  {
194  error0 = VXLAN_ERROR_NO_SUCH_TUNNEL;
195  next0 = VXLAN_INPUT_NEXT_DROP;
196  goto trace0;
197  }
198 
199  clib_memcpy (&last_key6, &key6_0, sizeof(key6_0));
200  tunnel_index0 = last_tunnel_index = p0[0];
201  }
202  else
203  tunnel_index0 = last_tunnel_index;
204  }
205 
206  t0 = pool_elt_at_index (vxm->tunnels, tunnel_index0);
207 
208  next0 = t0->decap_next_index;
209  sw_if_index0 = t0->sw_if_index;
210  len0 = vlib_buffer_length_in_chain (vm, b0);
211 
212  /* Required to make the l2 tag push / pop code work on l2 subifs */
213  if (PREDICT_TRUE(next0 == VXLAN_INPUT_NEXT_L2_INPUT))
214  vnet_update_l2_len (b0);
215 
216  /* Set input sw_if_index to VXLAN tunnel for learning */
217  vnet_buffer(b0)->sw_if_index[VLIB_RX] = sw_if_index0;
218 
219  pkts_decapsulated ++;
220  stats_n_packets += 1;
221  stats_n_bytes += len0;
222 
223  /* Batch stats increment on the same vxlan tunnel so counter
224  is not incremented per packet */
225  if (PREDICT_FALSE (sw_if_index0 != stats_sw_if_index))
226  {
227  stats_n_packets -= 1;
228  stats_n_bytes -= len0;
229  if (stats_n_packets)
232  cpu_index, stats_sw_if_index,
233  stats_n_packets, stats_n_bytes);
234  stats_n_packets = 1;
235  stats_n_bytes = len0;
236  stats_sw_if_index = sw_if_index0;
237  }
238 
239  trace0:
240  b0->error = error0 ? node->errors[error0] : 0;
241 
243  {
244  vxlan_rx_trace_t *tr
245  = vlib_add_trace (vm, node, b0, sizeof (*tr));
246  tr->next_index = next0;
247  tr->error = error0;
248  tr->tunnel_index = tunnel_index0;
249  tr->vni = vnet_get_vni (vxlan0);
250  }
251 
252 
253  if (is_ip4) {
254  key4_1.src = ip4_1->src_address.as_u32;
255  key4_1.vni = vxlan1->vni_reserved;
256 
257  if (PREDICT_FALSE (key4_1.as_u64 != last_key4.as_u64))
258  {
259  p1 = hash_get (vxm->vxlan4_tunnel_by_key, key4_1.as_u64);
260 
261  if (p1 == 0)
262  {
263  error1 = VXLAN_ERROR_NO_SUCH_TUNNEL;
264  next1 = VXLAN_INPUT_NEXT_DROP;
265  goto trace1;
266  }
267 
268  last_key4.as_u64 = key4_1.as_u64;
269  tunnel_index1 = last_tunnel_index = p1[0];
270  }
271  else
272  tunnel_index1 = last_tunnel_index;
273  } else /* !is_ip4 */ {
274  key6_1.src.as_u64[0] = ip6_1->src_address.as_u64[0];
275  key6_1.src.as_u64[1] = ip6_1->src_address.as_u64[1];
276  key6_1.vni = vxlan1->vni_reserved;
277 
278  if (PREDICT_FALSE (memcmp(&key6_1, &last_key6, sizeof(last_key6)) != 0))
279  {
280  p1 = hash_get_mem (vxm->vxlan6_tunnel_by_key, &key6_1);
281 
282  if (p1 == 0)
283  {
284  error1 = VXLAN_ERROR_NO_SUCH_TUNNEL;
285  next1 = VXLAN_INPUT_NEXT_DROP;
286  goto trace1;
287  }
288 
289  clib_memcpy (&last_key6, &key6_1, sizeof(key6_1));
290  tunnel_index1 = last_tunnel_index = p1[0];
291  }
292  else
293  tunnel_index1 = last_tunnel_index;
294  }
295 
296  t1 = pool_elt_at_index (vxm->tunnels, tunnel_index1);
297 
298  next1 = t1->decap_next_index;
299  sw_if_index1 = t1->sw_if_index;
300  len1 = vlib_buffer_length_in_chain (vm, b1);
301 
302  /* Required to make the l2 tag push / pop code work on l2 subifs */
303  if (PREDICT_TRUE(next1 == VXLAN_INPUT_NEXT_L2_INPUT))
304  vnet_update_l2_len (b1);
305 
306  /* Set input sw_if_index to VXLAN tunnel for learning */
307  vnet_buffer(b1)->sw_if_index[VLIB_RX] = sw_if_index1;
308 
309  pkts_decapsulated ++;
310  stats_n_packets += 1;
311  stats_n_bytes += len1;
312 
313  /* Batch stats increment on the same vxlan tunnel so counter
314  is not incremented per packet */
315  if (PREDICT_FALSE (sw_if_index1 != stats_sw_if_index))
316  {
317  stats_n_packets -= 1;
318  stats_n_bytes -= len1;
319  if (stats_n_packets)
322  cpu_index, stats_sw_if_index,
323  stats_n_packets, stats_n_bytes);
324  stats_n_packets = 1;
325  stats_n_bytes = len1;
326  stats_sw_if_index = sw_if_index1;
327  }
328 
329  trace1:
330  b1->error = error1 ? node->errors[error1] : 0;
331 
333  {
334  vxlan_rx_trace_t *tr
335  = vlib_add_trace (vm, node, b1, sizeof (*tr));
336  tr->next_index = next1;
337  tr->error = error1;
338  tr->tunnel_index = tunnel_index1;
339  tr->vni = vnet_get_vni (vxlan1);
340  }
341 
342  vlib_validate_buffer_enqueue_x2 (vm, node, next_index,
343  to_next, n_left_to_next,
344  bi0, bi1, next0, next1);
345  }
346 
347  while (n_left_from > 0 && n_left_to_next > 0)
348  {
349  u32 bi0;
350  vlib_buffer_t * b0;
351  u32 next0;
352  ip4_header_t * ip4_0;
353  ip6_header_t * ip6_0;
354  vxlan_header_t * vxlan0;
355  uword * p0;
356  u32 tunnel_index0;
357  vxlan_tunnel_t * t0;
358  vxlan4_tunnel_key_t key4_0;
359  vxlan6_tunnel_key_t key6_0;
360  u32 error0;
361  u32 sw_if_index0, len0;
362 
363  bi0 = from[0];
364  to_next[0] = bi0;
365  from += 1;
366  to_next += 1;
367  n_left_from -= 1;
368  n_left_to_next -= 1;
369 
370  b0 = vlib_get_buffer (vm, bi0);
371 
372  /* udp leaves current_data pointing at the vxlan header */
373  vxlan0 = vlib_buffer_get_current (b0);
374 
375  if (is_ip4) {
377  (b0, -(word)(sizeof(udp_header_t)+sizeof(ip4_header_t)));
378  ip4_0 = vlib_buffer_get_current (b0);
379  } else {
381  (b0, -(word)(sizeof(udp_header_t)+sizeof(ip6_header_t)));
382  ip6_0 = vlib_buffer_get_current (b0);
383  }
384 
385  /* pop (ip, udp, vxlan) */
386  if (is_ip4) {
388  (b0, sizeof(*ip4_0)+sizeof(udp_header_t)+sizeof(*vxlan0));
389  } else {
391  (b0, sizeof(*ip6_0)+sizeof(udp_header_t)+sizeof(*vxlan0));
392  }
393 
394  tunnel_index0 = ~0;
395  error0 = 0;
396 
397  if (is_ip4) {
398  key4_0.src = ip4_0->src_address.as_u32;
399  key4_0.vni = vxlan0->vni_reserved;
400 
401  if (PREDICT_FALSE (key4_0.as_u64 != last_key4.as_u64))
402  {
403  p0 = hash_get (vxm->vxlan4_tunnel_by_key, key4_0.as_u64);
404 
405  if (p0 == 0)
406  {
407  error0 = VXLAN_ERROR_NO_SUCH_TUNNEL;
408  next0 = VXLAN_INPUT_NEXT_DROP;
409  goto trace00;
410  }
411 
412  last_key4.as_u64 = key4_0.as_u64;
413  tunnel_index0 = last_tunnel_index = p0[0];
414  }
415  else
416  tunnel_index0 = last_tunnel_index;
417  } else /* !is_ip4 */ {
418  key6_0.src.as_u64[0] = ip6_0->src_address.as_u64[0];
419  key6_0.src.as_u64[1] = ip6_0->src_address.as_u64[1];
420  key6_0.vni = vxlan0->vni_reserved;
421 
422  if (PREDICT_FALSE (memcmp(&key6_0, &last_key6, sizeof(last_key6)) != 0))
423  {
424  p0 = hash_get_mem (vxm->vxlan6_tunnel_by_key, &key6_0);
425 
426  if (p0 == 0)
427  {
428  error0 = VXLAN_ERROR_NO_SUCH_TUNNEL;
429  next0 = VXLAN_INPUT_NEXT_DROP;
430  goto trace00;
431  }
432 
433  clib_memcpy (&last_key6, &key6_0, sizeof(key6_0));
434  tunnel_index0 = last_tunnel_index = p0[0];
435  }
436  else
437  tunnel_index0 = last_tunnel_index;
438  }
439 
440  t0 = pool_elt_at_index (vxm->tunnels, tunnel_index0);
441 
442  next0 = t0->decap_next_index;
443  sw_if_index0 = t0->sw_if_index;
444  len0 = vlib_buffer_length_in_chain (vm, b0);
445 
446  /* Required to make the l2 tag push / pop code work on l2 subifs */
447  if (PREDICT_TRUE(next0 == VXLAN_INPUT_NEXT_L2_INPUT))
448  vnet_update_l2_len (b0);
449 
450  /* Set input sw_if_index to VXLAN tunnel for learning */
451  vnet_buffer(b0)->sw_if_index[VLIB_RX] = sw_if_index0;
452 
453  pkts_decapsulated ++;
454  stats_n_packets += 1;
455  stats_n_bytes += len0;
456 
457  /* Batch stats increment on the same vxlan tunnel so counter
458  is not incremented per packet */
459  if (PREDICT_FALSE (sw_if_index0 != stats_sw_if_index))
460  {
461  stats_n_packets -= 1;
462  stats_n_bytes -= len0;
463  if (stats_n_packets)
466  cpu_index, stats_sw_if_index,
467  stats_n_packets, stats_n_bytes);
468  stats_n_packets = 1;
469  stats_n_bytes = len0;
470  stats_sw_if_index = sw_if_index0;
471  }
472 
473  trace00:
474  b0->error = error0 ? node->errors[error0] : 0;
475 
477  {
478  vxlan_rx_trace_t *tr
479  = vlib_add_trace (vm, node, b0, sizeof (*tr));
480  tr->next_index = next0;
481  tr->error = error0;
482  tr->tunnel_index = tunnel_index0;
483  tr->vni = vnet_get_vni (vxlan0);
484  }
485  vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
486  to_next, n_left_to_next,
487  bi0, next0);
488  }
489 
490  vlib_put_next_frame (vm, node, next_index, n_left_to_next);
491  }
492  /* Do we still need this now that tunnel tx stats is kept? */
494  VXLAN_ERROR_DECAPSULATED,
495  pkts_decapsulated);
496 
497  /* Increment any remaining batch stats */
498  if (stats_n_packets)
499  {
502  cpu_index, stats_sw_if_index, stats_n_packets, stats_n_bytes);
503  node->runtime_data[0] = stats_sw_if_index;
504  }
505 
506  return from_frame->n_vectors;
507 }
508 
509 static uword
511  vlib_node_runtime_t * node,
512  vlib_frame_t * from_frame)
513 {
514  return vxlan_input(vm, node, from_frame, /* is_ip4 */ 1);
515 }
516 
517 static uword
519  vlib_node_runtime_t * node,
520  vlib_frame_t * from_frame)
521 {
522  return vxlan_input(vm, node, from_frame, /* is_ip4 */ 0);
523 }
524 
525 static char * vxlan_error_strings[] = {
526 #define vxlan_error(n,s) s,
528 #undef vxlan_error
529 #undef _
530 };
531 
533  .function = vxlan4_input,
534  .name = "vxlan4-input",
535  /* Takes a vector of packets. */
536  .vector_size = sizeof (u32),
537 
538  .n_errors = VXLAN_N_ERROR,
539  .error_strings = vxlan_error_strings,
540 
541  .n_next_nodes = VXLAN_INPUT_N_NEXT,
542  .next_nodes = {
543 #define _(s,n) [VXLAN_INPUT_NEXT_##s] = n,
545 #undef _
546  },
547 
548 //temp .format_buffer = format_vxlan_header,
549  .format_trace = format_vxlan_rx_trace,
550  // $$$$ .unformat_buffer = unformat_vxlan_header,
551 };
552 
554  .function = vxlan6_input,
555  .name = "vxlan6-input",
556  /* Takes a vector of packets. */
557  .vector_size = sizeof (u32),
558 
559  .n_errors = VXLAN_N_ERROR,
560  .error_strings = vxlan_error_strings,
561 
562  .n_next_nodes = VXLAN_INPUT_N_NEXT,
563  .next_nodes = {
564 #define _(s,n) [VXLAN_INPUT_NEXT_##s] = n,
566 #undef _
567  },
568 
569 //temp .format_buffer = format_vxlan_header,
570  .format_trace = format_vxlan_rx_trace,
571  // $$$$ .unformat_buffer = unformat_vxlan_header,
572 };
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Definition: main.c:459
#define CLIB_UNUSED(x)
Definition: clib.h:79
ip4_address_t src_address
Definition: ip4_packet.h:138
vnet_interface_main_t interface_main
Definition: vnet.h:62
vlib_node_registration_t vxlan4_input_node
(constructor) VLIB_REGISTER_NODE (vxlan4_input_node)
Definition: decap.c:532
#define foreach_vxlan_input_next
Definition: vxlan.h:98
#define PREDICT_TRUE(x)
Definition: clib.h:98
u64 as_u64[2]
Definition: ip6_packet.h:50
struct _vlib_node_registration vlib_node_registration_t
vlib_node_registration_t vxlan_input_node
Definition: decap.c:22
vlib_error_t * errors
Definition: node.h:378
ip6_address_t src_address
Definition: ip6_packet.h:293
always_inline void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
Definition: buffer.h:184
vnet_main_t * vnet_main
Definition: vxlan.h:141
u32 tunnel_index
Definition: decap.c:26
#define always_inline
Definition: clib.h:84
vlib_combined_counter_main_t * combined_sw_if_counters
Definition: interface.h:458
always_inline void vlib_increment_combined_counter(vlib_combined_counter_main_t *cm, u32 cpu_index, u32 index, u32 packet_increment, u32 byte_increment)
Definition: counter.h:210
always_inline 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:112
always_inline void * vlib_frame_vector_args(vlib_frame_t *f)
Definition: node_funcs.h:202
#define hash_get(h, key)
Definition: hash.h:231
#define pool_elt_at_index(p, i)
Definition: pool.h:346
uword * vxlan4_tunnel_by_key
Definition: vxlan.h:123
uword os_get_cpu_number(void)
Definition: unix-misc.c:206
vxlan_main_t vxlan_main
Definition: vxlan.c:18
#define PREDICT_FALSE(x)
Definition: clib.h:97
always_inline void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
Definition: node_funcs.h:970
vlib_node_registration_t vxlan6_input_node
(constructor) VLIB_REGISTER_NODE (vxlan6_input_node)
Definition: decap.c:553
#define vlib_validate_buffer_enqueue_x2(vm, node, next_index, to_next, n_left_to_next, bi0, bi1, next0, next1)
Definition: buffer_node.h:43
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
Definition: buffer_node.h:83
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Definition: node_funcs.h:265
vlib_error_t error
Error code for buffers to be enqueued to error handler.
Definition: buffer.h:129
static u32 vnet_get_vni(vxlan_header_t *h)
Definition: vxlan_packet.h:52
static uword vxlan4_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: decap.c:510
u16 n_vectors
Definition: node.h:307
#define CLIB_PREFETCH(addr, size, type)
Definition: cache.h:82
static char * vxlan_error_strings[]
Definition: decap.c:525
#define clib_memcpy(a, b, c)
Definition: string.h:63
always_inline uword vxlan_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame, char is_ip4)
Definition: decap.c:51
u32 decap_next_index
Definition: vxlan.h:77
u16 cached_next_index
Definition: node.h:422
unsigned int u32
Definition: types.h:88
#define vnet_buffer(b)
Definition: buffer.h:300
u8 * format(u8 *s, char *fmt,...)
Definition: format.c:405
uword * vxlan6_tunnel_by_key
Definition: vxlan.h:124
u32 sw_if_index
Definition: vxlan.h:84
#define VLIB_BUFFER_IS_TRACED
Definition: buffer.h:91
u64 uword
Definition: types.h:112
i64 word
Definition: types.h:111
always_inline void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
Definition: buffer.h:197
unsigned char u8
Definition: types.h:56
static void vnet_update_l2_len(vlib_buffer_t *b)
Definition: l2_input.h:226
always_inline void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
Definition: trace_funcs.h:55
#define hash_get_mem(h, key)
Definition: hash.h:251
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
Definition: buffer.h:162
static u8 * format_vxlan_rx_trace(u8 *s, va_list *args)
Definition: decap.c:31
#define VLIB_REGISTER_NODE(x,...)
Definition: node.h:140
u8 data[0]
Packet data.
Definition: buffer.h:150
u32 next_index
Definition: decap.c:25
#define CLIB_CACHE_LINE_BYTES
Definition: cache.h:67
u32 flags
buffer flags: VLIB_BUFFER_IS_TRACED: trace this buffer.
Definition: buffer.h:84
uword runtime_data[(128-1 *sizeof(vlib_node_function_t *)-1 *sizeof(vlib_error_t *)-11 *sizeof(u32)-5 *sizeof(u16))/sizeof(uword)]
Definition: node.h:432
always_inline vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
Definition: buffer_funcs.h:69
vxlan_tunnel_t * tunnels
Definition: vxlan.h:120
static uword vxlan6_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: decap.c:518
Definition: defs.h:45