FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
vxlan_gpe_ioam_trace.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #include <vlib/vlib.h>
16 #include <vnet/vnet.h>
17 #include <vppinfra/error.h>
18 
21 
22 #include <vppinfra/hash.h>
23 #include <vppinfra/error.h>
24 #include <vppinfra/elog.h>
25 
29 
30 /* Timestamp precision multipliers for seconds, milliseconds, microseconds
31  * and nanoseconds respectively.
32  */
33 static f64 trace_tsp_mul[4] = { 1, 1e3, 1e6, 1e9 };
34 
35 typedef union
36 {
37  u64 as_u64;
38  u32 as_u32[2];
39 } time_u64_t;
40 
41 
42 /* *INDENT-OFF* */
43 typedef CLIB_PACKED(struct {
45  u8 ioam_trace_type;
46  u8 data_list_elts_left;
47  u32 elts[0]; /* Variable type. So keep it generic */
48 }) vxlan_gpe_ioam_trace_option_t;
49 /* *INDENT-ON* */
50 
51 
52 #define foreach_vxlan_gpe_ioam_trace_stats \
53  _(SUCCESS, "Pkts updated with TRACE records") \
54  _(FAILED, "Errors in TRACE due to lack of TRACE records")
55 
56 static char *vxlan_gpe_ioam_trace_stats_strings[] = {
57 #define _(sym,string) string,
59 #undef _
60 };
61 
62 typedef enum
63 {
64 #define _(sym,str) VXLAN_GPE_IOAM_TRACE_##sym,
66 #undef _
69 
70 
71 typedef struct
72 {
73  /* stats */
74  u64 counters[ARRAY_LEN (vxlan_gpe_ioam_trace_stats_strings)];
75 
76  /* convenience */
80 
82 
83 int
85  u8 size,
86  int rewrite_options (u8 * rewrite_string,
87  u8 * rewrite_size))
88 {
90 
91  ASSERT ((u32) option < ARRAY_LEN (hm->add_options));
92 
93  /* Already registered */
94  if (hm->add_options[option])
95  return (-1);
96 
97  hm->add_options[option] = rewrite_options;
98  hm->options_size[option] = size;
99 
100  return (0);
101 }
102 
103 int
105 {
107 
108  ASSERT ((u32) option < ARRAY_LEN (hm->add_options));
109 
110  /* Not registered */
111  if (!hm->add_options[option])
112  return (-1);
113 
114  hm->add_options[option] = NULL;
115  hm->options_size[option] = 0;
116  return (0);
117 }
118 
119 
120 int
122  int options (vlib_buffer_t * b,
124  u8 is_ipv4, u8 use_adj),
125  u8 * trace (u8 * s,
127 {
129 
130  ASSERT ((u32) option < ARRAY_LEN (im->options));
131 
132  /* Already registered */
133  if (im->options[option])
134  return (-1);
135 
136  im->options[option] = options;
137  im->trace[option] = trace;
138 
139  return (0);
140 }
141 
142 int
144 {
146 
147  ASSERT ((u32) option < ARRAY_LEN (hm->options));
148 
149  /* Not registered */
150  if (!hm->options[option])
151  return (-1);
152 
153  hm->options[option] = NULL;
154  hm->trace[option] = NULL;
155 
156  return (0);
157 }
158 
159 
160 always_inline void
162  u64 increment)
163 {
165 
166  hm->counters[counter_index] += increment;
167 }
168 
169 
170 static u8 *
171 format_ioam_data_list_element (u8 * s, va_list * args)
172 {
173  u32 *elt = va_arg (*args, u32 *);
174  u8 *trace_type_p = va_arg (*args, u8 *);
175  u8 trace_type = *trace_type_p;
176 
177 
178  if (trace_type & BIT_TTL_NODEID)
179  {
180  u32 ttl_node_id_host_byte_order = clib_net_to_host_u32 (*elt);
181  s = format (s, "ttl 0x%x node id 0x%x ",
182  ttl_node_id_host_byte_order >> 24,
183  ttl_node_id_host_byte_order & 0x00FFFFFF);
184 
185  elt++;
186  }
187 
188  if (trace_type & BIT_ING_INTERFACE && trace_type & BIT_ING_INTERFACE)
189  {
190  u32 ingress_host_byte_order = clib_net_to_host_u32 (*elt);
191  s = format (s, "ingress 0x%x egress 0x%x ",
192  ingress_host_byte_order >> 16,
193  ingress_host_byte_order & 0xFFFF);
194  elt++;
195  }
196 
197  if (trace_type & BIT_TIMESTAMP)
198  {
199  u32 ts_in_host_byte_order = clib_net_to_host_u32 (*elt);
200  s = format (s, "ts 0x%x \n", ts_in_host_byte_order);
201  elt++;
202  }
203 
204  if (trace_type & BIT_APPDATA)
205  {
206  u32 appdata_in_host_byte_order = clib_net_to_host_u32 (*elt);
207  s = format (s, "app 0x%x ", appdata_in_host_byte_order);
208  elt++;
209  }
210 
211  return s;
212 }
213 
214 
215 
216 int
217 vxlan_gpe_ioam_trace_rewrite_handler (u8 * rewrite_string, u8 * rewrite_size)
218 {
219  vxlan_gpe_ioam_trace_option_t *trace_option = NULL;
220  u8 trace_data_size = 0;
221  u8 trace_option_elts = 0;
222  trace_profile *profile = NULL;
223 
224 
225  profile = trace_profile_find ();
226 
227  if (PREDICT_FALSE (!profile))
228  {
229  return (-1);
230  }
231 
232  if (PREDICT_FALSE (!rewrite_string))
233  return -1;
234 
235  trace_option_elts = profile->num_elts;
236  trace_data_size = fetch_trace_data_size (profile->trace_type);
237  trace_option = (vxlan_gpe_ioam_trace_option_t *) rewrite_string;
238  trace_option->hdr.type = VXLAN_GPE_OPTION_TYPE_IOAM_TRACE;
239  trace_option->hdr.length = 2 /*ioam_trace_type,data_list_elts_left */ +
240  trace_option_elts * trace_data_size;
241  trace_option->ioam_trace_type = profile->trace_type & TRACE_TYPE_MASK;
242  trace_option->data_list_elts_left = trace_option_elts;
243  *rewrite_size =
244  sizeof (vxlan_gpe_ioam_trace_option_t) +
245  (trace_option_elts * trace_data_size);
246 
247  return 0;
248 }
249 
250 
251 int
254  u8 is_ipv4, u8 use_adj)
255 {
256  u8 elt_index = 0;
257  vxlan_gpe_ioam_trace_option_t *trace =
258  (vxlan_gpe_ioam_trace_option_t *) opt;
259  time_u64_t time_u64;
260  u32 *elt;
261  int rv = 0;
262  trace_profile *profile = NULL;
264 
265 
266  profile = trace_profile_find ();
267 
268  if (PREDICT_FALSE (!profile))
269  {
270  return (-1);
271  }
272 
273 
274  time_u64.as_u64 = 0;
275 
276  if (PREDICT_TRUE (trace->data_list_elts_left))
277  {
278  trace->data_list_elts_left--;
279  /* fetch_trace_data_size returns in bytes. Convert it to 4-bytes
280  * to skip to this node's location.
281  */
282  elt_index =
283  trace->data_list_elts_left *
284  fetch_trace_data_size (trace->ioam_trace_type) / 4;
285  elt = &trace->elts[elt_index];
286  if (is_ipv4)
287  {
288  if (trace->ioam_trace_type & BIT_TTL_NODEID)
289  {
291  /* The transit case is the only case where the TTL decrement happens
292  * before iOAM processing. For now, use the use_adj flag as an overload.
293  * We can probably use a separate flag instead of overloading the use_adj flag.
294  */
295  *elt = clib_host_to_net_u32 (((ip0->ttl - 1 + use_adj) << 24) |
296  profile->node_id);
297  elt++;
298  }
299 
300  if (trace->ioam_trace_type & BIT_ING_INTERFACE)
301  {
302  u16 tx_if = 0;
303  u32 adj_index = vnet_buffer (b)->ip.adj_index[VLIB_TX];
304 
305  if (use_adj)
306  {
307  ip_adjacency_t *adj = adj_get (adj_index);
308  tx_if = adj->rewrite_header.sw_if_index & 0xFFFF;
309  }
310 
311  *elt =
312  (vnet_buffer (b)->sw_if_index[VLIB_RX] & 0xFFFF) << 16 |
313  tx_if;
314  *elt = clib_host_to_net_u32 (*elt);
315  elt++;
316  }
317  }
318  else
319  {
320  if (trace->ioam_trace_type & BIT_TTL_NODEID)
321  {
323  *elt = clib_host_to_net_u32 ((ip0->hop_limit << 24) |
324  profile->node_id);
325  elt++;
326  }
327  if (trace->ioam_trace_type & BIT_ING_INTERFACE)
328  {
329  u16 tx_if = 0;
330  u32 adj_index = vnet_buffer (b)->ip.adj_index[VLIB_TX];
331 
332  if (use_adj)
333  {
334  ip_adjacency_t *adj = adj_get (adj_index);
335  tx_if = adj->rewrite_header.sw_if_index & 0xFFFF;
336  }
337 
338  *elt =
339  (vnet_buffer (b)->sw_if_index[VLIB_RX] & 0xFFFF) << 16 |
340  tx_if;
341  *elt = clib_host_to_net_u32 (*elt);
342  elt++;
343  }
344  }
345 
346  if (trace->ioam_trace_type & BIT_TIMESTAMP)
347  {
348  /* Send least significant 32 bits */
349  f64 time_f64 =
350  (f64) (((f64) hm->unix_time_0) +
351  (vlib_time_now (hm->vlib_main) - hm->vlib_time_0));
352 
353  time_u64.as_u64 = time_f64 * trace_tsp_mul[profile->trace_tsp];
354  *elt = clib_host_to_net_u32 (time_u64.as_u32[0]);
355  elt++;
356  }
357 
358  if (trace->ioam_trace_type & BIT_APPDATA)
359  {
360  /* $$$ set elt0->app_data */
361  *elt = clib_host_to_net_u32 (profile->app_data);
362  elt++;
363  }
365  (VXLAN_GPE_IOAM_TRACE_SUCCESS, 1);
366  }
367  else
368  {
370  (VXLAN_GPE_IOAM_TRACE_FAILED, 1);
371  }
372  return (rv);
373 }
374 
375 u8 *
378 {
379  vxlan_gpe_ioam_trace_option_t *trace;
380  u8 trace_data_size_in_words = 0;
381  u32 *elt;
382  int elt_index = 0;
383 
384  trace = (vxlan_gpe_ioam_trace_option_t *) opt;
385  s =
386  format (s, " Trace Type 0x%x , %d elts left\n", trace->ioam_trace_type,
387  trace->data_list_elts_left);
388  trace_data_size_in_words =
389  fetch_trace_data_size (trace->ioam_trace_type) / 4;
390  elt = &trace->elts[0];
391  while ((u8 *) elt < ((u8 *) (&trace->elts[0]) + trace->hdr.length - 2
392  /* -2 accounts for ioam_trace_type,elts_left */ ))
393  {
394  s = format (s, " [%d] %U\n", elt_index,
396  elt, &trace->ioam_trace_type);
397  elt_index++;
398  elt += trace_data_size_in_words;
399  }
400  return (s);
401 }
402 
403 
404 static clib_error_t *
406  unformat_input_t * input,
407  vlib_cli_command_t * cmd)
408 {
410  u8 *s = 0;
411  int i = 0;
412 
413  for (i = 0; i < VXLAN_GPE_IOAM_TRACE_N_STATS; i++)
414  {
415  s = format (s, " %s - %lu\n", vxlan_gpe_ioam_trace_stats_strings[i],
416  hm->counters[i]);
417  }
418 
419  vlib_cli_output (vm, "%v", s);
420  vec_free (s);
421  return 0;
422 }
423 
424 
425 /* *INDENT-OFF* */
427  .path = "show ioam vxlan-gpe trace",
428  .short_help = "iOAM trace statistics",
430 };
431 /* *INDENT-ON* */
432 
433 
434 static clib_error_t *
436 {
438 
439  hm->vlib_main = vm;
440  hm->vnet_main = vnet_get_main ();
441  clib_memset (hm->counters, 0, sizeof (hm->counters));
442 
447  return (clib_error_create
448  ("registration of VXLAN_GPE_OPTION_TYPE_IOAM_TRACE failed"));
449 
450 
453  sizeof (vxlan_gpe_ioam_trace_option_t),
455  return (clib_error_create
456  ("registration of VXLAN_GPE_OPTION_TYPE_IOAM_TRACE for rewrite failed"));
457 
458 
459  return (0);
460 }
461 
462 /* *INDENT-OFF* */
464 {
465  .runs_after = VLIB_INITS("ip_main_init", "ip6_lookup_init",
466  "vxlan_gpe_init"),
467 };
468 /* *INDENT-ON* */
469 
470 
471 int
473 {
475 
477 
478  return 0;
479 
480 }
481 
482 static int
484 {
485  u16 size = 0;
486  u8 trace_data_size = 0;
487  trace_profile *profile = NULL;
488 
489  *result = 0;
490 
491  profile = trace_profile_find ();
492 
493  if (PREDICT_FALSE (!profile))
494  {
495  return (-1);
496  }
497 
498  trace_data_size = fetch_trace_data_size (profile->trace_type);
499  if (PREDICT_FALSE (trace_data_size == 0))
500  return VNET_API_ERROR_INVALID_VALUE;
501 
502  if (PREDICT_FALSE (profile->num_elts * trace_data_size > 254))
503  return VNET_API_ERROR_INVALID_VALUE;
504 
505  size +=
506  sizeof (vxlan_gpe_ioam_trace_option_t) +
507  profile->num_elts * trace_data_size;
508  *result = size;
509 
510  return 0;
511 }
512 
513 
514 int
516 {
517  u32 trace_size = 0;
519 
520  trace_profile *profile = NULL;
521 
522 
523  profile = trace_profile_find ();
524 
525  if (PREDICT_FALSE (!profile))
526  {
527  return (-1);
528  }
529 
530 
531  if (vxlan_gpe_ioam_trace_get_sizeof_handler (&trace_size) < 0)
532  return (-1);
533 
535 
536  return (0);
537 }
538 
539 
540 
541 /*
542  * fd.io coding-style-patch-verification: ON
543  *
544  * Local Variables:
545  * eval: (c-set-style "gnu")
546  * End:
547  */
vxlan_gpe_ioam_main_::options_size
u8 options_size[256]
Definition: vxlan_gpe_ioam.h:67
vlib.h
im
vnet_interface_main_t * im
Definition: interface_output.c:395
vxlan_gpe_ioam_register_option
int vxlan_gpe_ioam_register_option(u8 option, int options(vlib_buffer_t *b, vxlan_gpe_ioam_option_t *opt, u8 is_ipv4, u8 use_adj), u8 *trace(u8 *s, vxlan_gpe_ioam_option_t *opt))
Definition: vxlan_gpe_ioam_trace.c:121
trace
static vlib_cli_command_t trace
(constructor) VLIB_CLI_COMMAND (trace)
Definition: vlib_api_cli.c:899
vxlan_gpe_ioam_trace_stats_t
vxlan_gpe_ioam_trace_stats_t
Definition: vxlan_gpe_ioam_trace.c:62
BIT_TIMESTAMP
#define BIT_TIMESTAMP
Definition: trace_util.h:92
elog.h
vxlan_gpe_ioam_trace_main_t
Definition: vxlan_gpe_ioam_trace.c:71
trace_profile_find
static trace_profile * trace_profile_find(void)
Definition: trace_config.h:24
vxlan_gpe_ioam_add_register_option
int vxlan_gpe_ioam_add_register_option(u8 option, u8 size, int rewrite_options(u8 *rewrite_string, u8 *rewrite_size))
Definition: vxlan_gpe_ioam_trace.c:84
vxlan_gpe_ioam_main_::vlib_time_0
f64 vlib_time_0
Definition: vxlan_gpe_ioam.h:47
vxlan_gpe_ioam_main
vxlan_gpe_ioam_main_t vxlan_gpe_ioam_main
Definition: vxlan_gpe_ioam.c:23
ip6_header_t::hop_limit
u8 hop_limit
Definition: ip6_packet.h:307
vlib_cli_command_t::path
char * path
Definition: cli.h:96
vxlan_gpe_show_ioam_trace_cmd_fn
static clib_error_t * vxlan_gpe_show_ioam_trace_cmd_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: vxlan_gpe_ioam_trace.c:405
u16
unsigned short u16
Definition: types.h:57
vxlan_gpe_trace_profile_cleanup
int vxlan_gpe_trace_profile_cleanup(void)
Definition: vxlan_gpe_ioam_trace.c:472
vxlan_gpe_ioam_main_::vlib_main
vlib_main_t * vlib_main
State convenience vlib_main_t.
Definition: vxlan_gpe_ioam.h:100
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
counter_index
static u32 counter_index(vlib_main_t *vm, vlib_error_t e)
Definition: drop.c:67
VLIB_RX
@ VLIB_RX
Definition: defs.h:46
VXLAN_GPE_IOAM_TRACE_N_STATS
@ VXLAN_GPE_IOAM_TRACE_N_STATS
Definition: vxlan_gpe_ioam_trace.c:67
trace_profile_::num_elts
u8 num_elts
Definition: trace_util.h:45
vxlan_gpe_ioam_trace_main_t::counters
u64 counters[ARRAY_LEN(vxlan_gpe_ioam_trace_stats_strings)]
Definition: vxlan_gpe_ioam_trace.c:74
unformat_input_t
struct _unformat_input_t unformat_input_t
trace_profile_::trace_tsp
u32 trace_tsp
Definition: trace_util.h:49
foreach_vxlan_gpe_ioam_trace_stats
#define foreach_vxlan_gpe_ioam_trace_stats
vxlan_gpe_ioam_main_::unix_time_0
u32 unix_time_0
Definition: vxlan_gpe_ioam.h:46
vxlan_gpe_show_ioam_trace_cmd
static vlib_cli_command_t vxlan_gpe_show_ioam_trace_cmd
(constructor) VLIB_CLI_COMMAND (vxlan_gpe_show_ioam_trace_cmd)
Definition: vxlan_gpe_ioam_trace.c:426
vxlan_gpe_ioam.h
ip4_header_t
Definition: ip4_packet.h:87
trace_profile_::node_id
u32 node_id
Definition: trace_util.h:47
vxlan_gpe_ioam_trace_main_t::vnet_main
vnet_main_t * vnet_main
Definition: vxlan_gpe_ioam_trace.c:78
trace_profile_
Usage:
Definition: trace_util.h:41
vxlan_gpe_add_unregister_option
int vxlan_gpe_add_unregister_option(u8 option)
Definition: vxlan_gpe_ioam_trace.c:104
vxlan_gpe.h
VXLAN GPE definitions.
vxlan_gpe_ioam_trace_data_list_trace_handler
u8 * vxlan_gpe_ioam_trace_data_list_trace_handler(u8 *s, vxlan_gpe_ioam_option_t *opt)
Definition: vxlan_gpe_ioam_trace.c:376
clib_error_create
#define clib_error_create(args...)
Definition: error.h:96
trace_util.h
error.h
vxlan_gpe_ioam_trace_init
static clib_error_t * vxlan_gpe_ioam_trace_init(vlib_main_t *vm)
Definition: vxlan_gpe_ioam_trace.c:435
vnet_buffer
#define vnet_buffer(b)
Definition: buffer.h:437
vnet_get_main
vnet_main_t * vnet_get_main(void)
Definition: pnat_test_stubs.h:56
PREDICT_FALSE
#define PREDICT_FALSE(x)
Definition: clib.h:124
ARRAY_LEN
#define ARRAY_LEN(x)
Definition: clib.h:70
vxlan_gpe_ioam_trace_main
vxlan_gpe_ioam_trace_main_t vxlan_gpe_ioam_trace_main
Definition: vxlan_gpe_ioam_trace.c:81
vxlan_gpe_ioam_trace_stats_increment_counter
static void vxlan_gpe_ioam_trace_stats_increment_counter(u32 counter_index, u64 increment)
Definition: vxlan_gpe_ioam_trace.c:161
i
sll srl srl sll sra u16x4 i
Definition: vector_sse42.h:261
f64
double f64
Definition: types.h:142
VLIB_CLI_COMMAND
#define VLIB_CLI_COMMAND(x,...)
Definition: cli.h:163
vxlan_gpe_ioam_trace_main_t::vlib_main
vlib_main_t * vlib_main
Definition: vxlan_gpe_ioam_trace.c:77
TRACE_TYPE_MASK
#define TRACE_TYPE_MASK
Definition: trace_util.h:96
ip_adjacency_t_
IP unicast adjacency.
Definition: adj.h:235
vxlan_gpe_trace_profile_setup
int vxlan_gpe_trace_profile_setup(void)
Definition: vxlan_gpe_ioam_trace.c:515
vxlan_gpe_ioam_unregister_option
int vxlan_gpe_ioam_unregister_option(u8 option)
Definition: vxlan_gpe_ioam_trace.c:143
vlib_cli_output
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
Definition: cli.c:716
vxlan_gpe_ioam_trace_get_sizeof_handler
static int vxlan_gpe_ioam_trace_get_sizeof_handler(u32 *result)
Definition: vxlan_gpe_ioam_trace.c:483
trace_profile_::app_data
u32 app_data
Definition: trace_util.h:48
vnet_main_t
Definition: vnet.h:76
vec_free
#define vec_free(V)
Free vector's memory (no header).
Definition: vec.h:395
size
u32 size
Definition: vhost_user.h:125
always_inline
#define always_inline
Definition: rdma_mlx5dv.h:23
time_u64_t::as_u32
u32 as_u32[2]
Definition: ip6_ioam_trace.c:44
vxlan_gpe_packet.h
VXLAN GPE packet header structure.
vxlan_gpe_ioam_main_::add_options
int(* add_options[256])(u8 *rewrite_string, u8 *rewrite_size)
Definition: vxlan_gpe_ioam.h:68
format_ioam_data_list_element
static u8 * format_ioam_data_list_element(u8 *s, va_list *args)
Definition: vxlan_gpe_ioam_trace.c:171
u64
unsigned long u64
Definition: types.h:89
format
description fragment has unexpected format
Definition: map.api:433
ASSERT
#define ASSERT(truth)
Definition: error_bootstrap.h:69
trace_config.h
vxlan_gpe_ioam_main_
Definition: vxlan_gpe_ioam.h:38
u32
unsigned int u32
Definition: types.h:88
VLIB_INIT_FUNCTION
#define VLIB_INIT_FUNCTION(x)
Definition: init.h:172
ip4_header_t::ttl
u8 ttl
Definition: ip4_packet.h:112
options
static struct option options[]
Definition: main.c:52
vxlan_gpe_ioam_option_t
Definition: vxlan_gpe_ioam_packet.h:43
vxlan_gpe_ioam_trace_rewrite_handler
int vxlan_gpe_ioam_trace_rewrite_handler(u8 *rewrite_string, u8 *rewrite_size)
Definition: vxlan_gpe_ioam_trace.c:217
BIT_ING_INTERFACE
#define BIT_ING_INTERFACE
Definition: trace_util.h:90
as_u64
u64 as_u64
Definition: bihash_doc.h:63
ip6_header_t
Definition: ip6_packet.h:294
elt
app_rx_mq_elt_t * elt
Definition: application.c:488
clib_memset
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
vlib_main_t
Definition: main.h:102
time_u64_t::as_u64
u64 as_u64
Definition: ip6_ioam_trace.c:43
CLIB_PACKED
typedef CLIB_PACKED(struct { vxlan_gpe_ioam_option_t hdr;u8 ioam_trace_type;u8 data_list_elts_left;u32 elts[0];})
Definition: vxlan_gpe_ioam_trace.c:43
VLIB_INITS
#define VLIB_INITS(...)
Definition: init.h:352
hash.h
b
vlib_buffer_t ** b
Definition: nat44_ei_out2in.c:717
u8
unsigned char u8
Definition: types.h:56
clib_error_t
Definition: clib_error.h:21
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
BIT_APPDATA
#define BIT_APPDATA
Definition: trace_util.h:93
trace_profile_::trace_type
u8 trace_type
Definition: trace_util.h:44
vlib_init_function_t
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
Definition: init.h:51
vxlan_gpe_ioam_main_::options
int(* options[256])(vlib_buffer_t *b, vxlan_gpe_ioam_option_t *opt, u8 is_ipv4, u8 use_adj)
Definition: vxlan_gpe_ioam.h:72
rv
int __clib_unused rv
Definition: application.c:491
vlib_time_now
static f64 vlib_time_now(vlib_main_t *vm)
Definition: main.h:325
vnet.h
time_u64_t
Definition: ip6_ioam_trace.c:41
VXLAN_GPE_OPTION_TYPE_IOAM_TRACE
#define VXLAN_GPE_OPTION_TYPE_IOAM_TRACE
Definition: vxlan_gpe_ioam_packet.h:24
vlib_cli_command_t
Definition: cli.h:92
PREDICT_TRUE
#define PREDICT_TRUE(x)
Definition: clib.h:125
vxlan_gpe_ioam_main_::trace
u8 *(* trace[256])(u8 *s, vxlan_gpe_ioam_option_t *opt)
Definition: vxlan_gpe_ioam.h:74
VLIB_TX
@ VLIB_TX
Definition: defs.h:47
fetch_trace_data_size
static u8 fetch_trace_data_size(u16 trace_type)
Definition: trace_util.h:209
vxlan_gpe_ioam_trace_data_list_handler
int vxlan_gpe_ioam_trace_data_list_handler(vlib_buffer_t *b, vxlan_gpe_ioam_option_t *opt, u8 is_ipv4, u8 use_adj)
Definition: vxlan_gpe_ioam_trace.c:252
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
trace_tsp_mul
static f64 trace_tsp_mul[4]
Definition: vxlan_gpe_ioam_trace.c:33
BIT_TTL_NODEID
#define BIT_TTL_NODEID
Definition: trace_util.h:89
vlib_buffer_t
VLIB buffer representation.
Definition: buffer.h:111