FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
main.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 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 /*
16  * main.h: VLIB main data structure
17  *
18  * Copyright (c) 2008 Eliot Dresselhaus
19  *
20  * Permission is hereby granted, free of charge, to any person obtaining
21  * a copy of this software and associated documentation files (the
22  * "Software"), to deal in the Software without restriction, including
23  * without limitation the rights to use, copy, modify, merge, publish,
24  * distribute, sublicense, and/or sell copies of the Software, and to
25  * permit persons to whom the Software is furnished to do so, subject to
26  * the following conditions:
27  *
28  * The above copyright notice and this permission notice shall be
29  * included in all copies or substantial portions of the Software.
30  *
31  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
32  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
33  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
34  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
35  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
36  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
37  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
38  */
39 
40 #ifndef included_vlib_main_h
41 #define included_vlib_main_h
42 
43 #include <vppinfra/callback_data.h>
44 #include <vppinfra/elog.h>
45 #include <vppinfra/format.h>
46 #include <vppinfra/longjmp.h>
47 #include <vppinfra/pool.h>
48 #include <vppinfra/random_buffer.h>
49 #include <vppinfra/time.h>
50 
51 #include <pthread.h>
52 
53 
54 /* By default turn off node/error event logging.
55  Override with -DVLIB_ELOG_MAIN_LOOP */
56 #ifndef VLIB_ELOG_MAIN_LOOP
57 #define VLIB_ELOG_MAIN_LOOP 0
58 #endif
59 
60 typedef struct
61 {
65 
66 typedef enum
67 {
72 
73 typedef struct
74 {
75  struct vlib_main_t *vm;
82 
84 
88 
90 {
92  union
93  {
94  void *v;
95  u64 u;
96  } u[3];
98 
99 clib_callback_data_typedef (vlib_node_runtime_perf_callback_set_t,
101 
102 typedef struct vlib_main_t
103 {
104  CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
105  /* Instruction level timing state. */
107  /* Offset from main thread time */
110 
111  /* Time stamp of last node dispatch. */
113 
114  /* Time stamp when main loop was entered (time 0). */
116 
117  /* Incremented once for each main loop. */
119 
120  /* Count of vectors processed this main loop. */
123 
124  /* Internal node vectors, calls */
129 
130  /* Instantaneous vector rate */
132 
133  /* Main loop hw / sw performance counters */
134  vlib_node_runtime_perf_callback_set_t vlib_node_runtime_perf_callbacks;
135 
136  /* dispatch wrapper function */
138 
139  /* Every so often we switch to the next counter. */
140 #define VLIB_LOG2_MAIN_LOOPS_PER_STATS_UPDATE 7
141 
142  /* Jump target to exit main loop with given code. */
144  /* Set e.g. in the SIGTERM signal handler, checked in a safe place... */
147 #define VLIB_MAIN_LOOP_EXIT_NONE 0
148 #define VLIB_MAIN_LOOP_EXIT_PANIC 1
149  /* Exit via CLI. */
150 #define VLIB_MAIN_LOOP_EXIT_CLI 2
151 
152  /* Error marker to use when exiting main loop. */
154 
155  /* Start of the heap. */
156  void *heap_base;
157 
158  /* Truncated version, to create frame indices */
160 
161  /* Size of the heap */
163 
164  /* buffer main structure. */
166 
167  /* physical memory main structure. */
169 
170  /* Node graph main structure. */
172 
173  /* Packet trace buffer. */
175 
176  /* Error handling. */
178 
179  /* Punt packets to underlying operating system for when fast switching
180  code does not know what to do. */
181  void (*os_punt_frame) (struct vlib_main_t * vm,
182  struct vlib_node_runtime_t * node,
183  vlib_frame_t * frame);
184 
185  /* Stream index to use for distribution when MC is enabled. */
187 
188  /* Hash table to record which init functions have been called. */
190 
192 
193  /* Event logger trace flags */
199 
200  /* Node call and return event types. */
203 
205 
206  /* Seed for random number generator. */
208 
209  /* Buffer of random data for various uses. */
211 
212  /* thread, cpu and numa_node indices */
216 
217  /* control-plane API queue signal pending, length indication */
220  void (*queue_signal_callback) (struct vlib_main_t *);
221  u8 **argv;
222 
223  /* Top of (worker) dispatch loop callback */
224  void (**volatile worker_thread_main_loop_callbacks)
225  (struct vlib_main_t *, u64 t);
226  void (**volatile worker_thread_main_loop_callback_tmp)
227  (struct vlib_main_t *, u64 t);
229 
230  /* debugging */
231  volatile int parked_at_barrier;
232 
233  /* Dispatch loop time accounting */
240 
241  /*
242  * Barrier epoch - Set to current time, each time barrier_sync or
243  * barrier_release is called with zero recursion.
244  */
246 
247  /* Earliest barrier can be closed again */
249 
250  /* Barrier counter callback */
251  void (**volatile barrier_perf_callbacks)
252  (struct vlib_main_t *, u64 t, int leave);
253  void (**volatile barrier_perf_callbacks_tmp)
254  (struct vlib_main_t *, u64 t, int leave);
255 
256  /* Need to check the frame queues */
258 
259  /* RPC requests, main thread only */
263 
264  /* buffer fault injector */
267 
268 #ifdef CLIB_SANITIZE_ADDR
269  /* address sanitizer stack save */
270  void *asan_stack_save;
271 #endif
272 } vlib_main_t;
273 
274 typedef struct vlib_global_main_t
275 {
276  CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
277 
278  /* Per-thread Mains */
280 
281  /* Name for e.g. syslog. */
282  char *name;
283 
284  /* post-mortem callbacks */
285  void (**post_mortem_callbacks) (void);
286 
287  /*
288  * Need to call vlib_worker_thread_node_runtime_update before
289  * releasing worker thread barrier.
290  */
292 
293  /* Command line interface. */
295 
296  /* Node registrations added by constructors */
298 
299  /* Event logger. */
302 
303  /* Packet trace capture filter */
305 
306  /* List of init functions to call, setup by constructors */
307  _vlib_init_function_list_elt_t *init_function_registrations;
308  _vlib_init_function_list_elt_t *main_loop_enter_function_registrations;
309  _vlib_init_function_list_elt_t *main_loop_exit_function_registrations;
310  _vlib_init_function_list_elt_t *worker_init_function_registrations;
311  _vlib_init_function_list_elt_t *api_init_function_registrations;
313 
314  /* Hash table to record which init functions have been called. */
316 
318 
319 /* Global main structure. */
321 
323 
326 {
327 #if CLIB_DEBUG > 0
328  extern __thread uword __os_thread_index;
329 #endif
330  /*
331  * Make sure folks don't pass &vlib_global_main from a worker thread.
332  */
333  ASSERT (vm->thread_index == __os_thread_index);
334  return clib_time_now (&vm->clib_time) + vm->time_offset;
335 }
336 
339 {
340  return clib_time_now_internal (&vm->clib_time, n);
341 }
342 
343 /* Busy wait for specified time. */
344 always_inline void
346 {
347  f64 t = vlib_time_now (vm);
348  f64 limit = t + wait;
349  while (t < limit)
350  t = vlib_time_now (vm);
351 }
352 
353 /* Time a piece of code. */
354 #define vlib_time_code(vm,body) \
355 do { \
356  f64 _t[2]; \
357  _t[0] = vlib_time_now (vm); \
358  do { body; } while (0); \
359  _t[1] = vlib_time_now (vm); \
360  clib_warning ("%.7e", _t[1] - _t[0]); \
361 } while (0)
362 
363 #define vlib_wait_with_timeout(vm,suspend_time,timeout_time,test) \
364 ({ \
365  uword __vlib_wait_with_timeout = 0; \
366  f64 __vlib_wait_time = 0; \
367  while (! (__vlib_wait_with_timeout = (test)) \
368  && __vlib_wait_time < (timeout_time)) \
369  { \
370  vlib_process_suspend (vm, suspend_time); \
371  __vlib_wait_time += suspend_time; \
372  } \
373  __vlib_wait_with_timeout; \
374 })
375 
376 always_inline void
378 {
381 }
382 
383 #define vlib_panic_with_msg(vm,args...) \
384  vlib_panic_with_error (vm, clib_error_return (0, args))
385 
386 always_inline void
388 {
390 }
391 
392 
395 {
396  u64 vectors;
397  u64 calls;
398 
400 
401  if (PREDICT_FALSE (calls == 0))
402  return 0.0;
403 
405 
406  return (f64) vectors / (f64) calls;
407 }
408 
409 always_inline void
411 {
414 }
415 
416 always_inline void
418 {
419  vm->main_loop_count++;
421 
424 }
425 
428 {
430 }
431 
432 always_inline void
434  vlib_frame_t * frame, uword n, u64 t,
436 {
439  if (vec_len (v))
440  {
442  .vm = vm,
443  .node = node,
444  .frame = frame,
445  .packets = n,
446  .cpu_time_now = t,
447  .call_type = call_type,
448  };
449  clib_callback_data_call_vec (v, &args);
450  }
451 }
452 
454  (vlib_main_t * vm, void (*fp) (vlib_main_t *))
455 {
457 }
458 
459 always_inline void
461 {
463  vlib_main_t *vm;
464 
465  vgm->init_functions_called = hash_create (0, /* value bytes */ 0);
466 
468  vec_add1 (vgm->vlib_mains, vm);
469 }
470 
471 /* Main routine. */
472 int vlib_main (vlib_main_t * vm, unformat_input_t * input);
473 
474 /* Thread stacks, for os_get_thread_index */
475 extern u8 **vlib_thread_stacks;
476 
477 /* Number of thread stacks that the application needs */
478 u32 vlib_app_num_thread_stacks_needed (void) __attribute__ ((weak));
479 
480 void vlib_add_del_post_mortem_callback (void *cb, int is_add);
481 
484 
485 #endif /* included_vlib_main_h */
486 
487 /*
488  * fd.io coding-style-patch-verification: ON
489  *
490  * Local Variables:
491  * eval: (c-set-style "gnu")
492  * End:
493  */
vlib_buffer_main_t
Definition: buffer.h:475
vlib_error_main_t
Definition: error.h:61
vlib_main_t::cpu_id
u32 cpu_id
Definition: main.h:214
vlib_main_t::random_buffer
clib_random_buffer_t random_buffer
Definition: main.h:210
vlib_main_t::barrier_no_close_before
f64 barrier_no_close_before
Definition: main.h:248
vlib_main_t::mc_stream_index
u32 mc_stream_index
Definition: main.h:186
vlib_main_t::procs_waiting_for_mc_stream_join
vlib_one_time_waiting_process_t * procs_waiting_for_mc_stream_join
Definition: main.h:191
vlib_global_main_t
Definition: main.h:274
frame
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
Definition: nat44_ei.c:3048
vlib_main_t::main_loop_count
volatile u32 main_loop_count
Definition: main.h:118
vlib_main_t::time_offset
f64 time_offset
Definition: main.h:108
vlib_main_t::clib_time
clib_time_t clib_time
Definition: main.h:106
vlib_global_main_t
struct vlib_global_main_t vlib_global_main_t
vlib_main_t::internal_node_calls
u64 internal_node_calls
Definition: main.h:126
vlib_trace_filter_t::classify_table_index
u32 classify_table_index
Definition: main.h:63
elog.h
vlib_global_main_t::main_loop_exit_function_registrations
_vlib_init_function_list_elt_t * main_loop_exit_function_registrations
Definition: main.h:309
vlib_global_main_t::main_loop_enter_function_registrations
_vlib_init_function_list_elt_t * main_loop_enter_function_registrations
Definition: main.h:308
clib_time_now_internal
static f64 clib_time_now_internal(clib_time_t *c, u64 n)
Definition: time.h:210
vlib_main_t::pending_rpc_lock
clib_spinlock_t pending_rpc_lock
Definition: main.h:262
vlib_main_t::dispatch_wrapper_fn
vlib_node_function_t * dispatch_wrapper_fn
Definition: main.h:137
node
vlib_main_t vlib_node_runtime_t * node
Definition: nat44_ei.c:3047
vlib_main_t::heap_aligned_base
void * heap_aligned_base
Definition: main.h:159
vlib_clear_internal_node_vector_rate
static void vlib_clear_internal_node_vector_rate(vlib_main_t *vm)
Definition: main.h:410
vlib_app_num_thread_stacks_needed
u32 vlib_app_num_thread_stacks_needed(void)
Definition: main.c:458
vlib_main_t::node_call_elog_event_types
elog_event_type_t * node_call_elog_event_types
Definition: main.h:201
vlib_main_t::error_main
vlib_error_main_t error_main
Definition: main.h:177
vlib_main_t::node_main
vlib_node_main_t node_main
Definition: main.h:171
vlib_main_t::barrier_perf_callbacks
void(**volatile barrier_perf_callbacks)(struct vlib_main_t *, u64 t, int leave)
Definition: main.h:252
vlib_main
int vlib_main(vlib_main_t *vm, unformat_input_t *input)
Definition: main.c:1914
vlib_main_t::parked_at_barrier
volatile int parked_at_barrier
Definition: main.h:231
vlib_global_main
vlib_global_main_t vlib_global_main
Definition: main.c:1786
vlib_main_t::elog_trace_graph_circuit_node_index
u32 elog_trace_graph_circuit_node_index
Definition: main.h:198
vlib_main_t::buffer_main
vlib_buffer_main_t * buffer_main
Definition: main.h:165
vlib_time_wait
static void vlib_time_wait(vlib_main_t *vm, f64 wait)
Definition: main.h:345
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
vlib_main_t::queue_signal_callback
void(* queue_signal_callback)(struct vlib_main_t *)
Definition: main.h:220
VLIB_NODE_RUNTIME_PERF_BEFORE
@ VLIB_NODE_RUNTIME_PERF_BEFORE
Definition: main.h:68
vlib_node_runtime_perf_callback_args_t::packets
uword packets
Definition: main.h:78
vlib_node_runtime_perf_callback_args_t::cpu_time_now
u64 cpu_time_now
Definition: main.h:79
vlib_main_t::heap_size
uword heap_size
Definition: main.h:162
unformat_input_t
struct _unformat_input_t unformat_input_t
vlib_node_function_t
uword() vlib_node_function_t(struct vlib_main_t *vm, struct vlib_node_runtime_t *node, struct vlib_frame_t *frame)
Definition: node.h:54
VLIB_NODE_RUNTIME_PERF_RESET
@ VLIB_NODE_RUNTIME_PERF_RESET
Definition: main.h:70
vlib_frame_t
Definition: node.h:372
hash_create
#define hash_create(elts, value_bytes)
Definition: hash.h:695
vlib_main_t::node_return_elog_event_types
elog_event_type_t * node_return_elog_event_types
Definition: main.h:202
random_buffer.h
vlib_main_t::queue_signal_pending
volatile u32 queue_signal_pending
Definition: main.h:218
vlib_main_t::check_frame_queues
volatile uword check_frame_queues
Definition: main.h:257
vlib_main_t::elog_trace_cli_commands
int elog_trace_cli_commands
Definition: main.h:195
error
Definition: cJSON.c:88
vlib_main_t::loop_interval_start
f64 loop_interval_start
Definition: main.h:236
vlib_global_main_t::name
char * name
Definition: main.h:282
vlib_main_t::buffer_alloc_success_rate
f64 buffer_alloc_success_rate
Definition: main.h:266
vlib_panic_with_error
static void vlib_panic_with_error(vlib_main_t *vm, clib_error_t *error)
Definition: main.h:377
clib_callback_data_check_and_get
#define clib_callback_data_check_and_get(set_)
Check for and get current callback set.
Definition: callback_data.h:254
vlib_trace_filter_t
Definition: main.h:60
longjmp.h
vlib_global_main_t::config_function_registrations
vlib_config_function_runtime_t * config_function_registrations
Definition: main.h:312
vlib_global_main_t::trace_filter
vlib_trace_filter_t trace_filter
Definition: main.h:304
vlib_global_main_t::cli_main
vlib_cli_main_t cli_main
Definition: main.h:294
vlib_node_runtime_perf_callback_fp_t
void(* vlib_node_runtime_perf_callback_fp_t)(struct vlib_node_runtime_perf_callback_data_t *data, vlib_node_runtime_perf_callback_args_t *args)
Definition: main.h:86
vlib_main_t::main_loop_error
clib_error_t * main_loop_error
Definition: main.h:153
clib_longjmp
void clib_longjmp(clib_longjmp_t *save, uword return_value)
vlib_main_t::loops_this_reporting_interval
u64 loops_this_reporting_interval
Definition: main.h:234
vlib_main_t::processing_rpc_requests
uword * processing_rpc_requests
Definition: main.h:261
vlib_global_main_t::need_vlib_worker_thread_node_runtime_update
int need_vlib_worker_thread_node_runtime_update
Definition: main.h:291
vlib_get_main_not_inline
vlib_main_t * vlib_get_main_not_inline(void)
Definition: main.c:2086
vlib_node_runtime_perf_callback_args_t::node
vlib_node_runtime_t * node
Definition: main.h:76
vlib_main_t::error_elog_event_types
elog_event_type_t * error_elog_event_types
Definition: main.h:204
vlib_main_t::argv
u8 ** argv
Definition: main.h:221
vlib_main_t::buffer_alloc_success_seed
u32 buffer_alloc_success_seed
Definition: main.h:265
vec_len
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
Definition: vec_bootstrap.h:142
vlib_main_t::elog_trace_graph_dispatch
int elog_trace_graph_dispatch
Definition: main.h:196
vlib_main_t::main_loop_exit_now
volatile u32 main_loop_exit_now
Definition: main.h:145
vlib_main_t::physmem_main
vlib_physmem_main_t physmem_main
Definition: main.h:168
vec_add1
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
Definition: vec.h:606
vlib_last_vectors_per_main_loop
static u32 vlib_last_vectors_per_main_loop(vlib_main_t *vm)
Definition: main.h:427
vlib_node_runtime_perf_call_type_t
vlib_node_runtime_perf_call_type_t
Definition: main.h:66
VLIB_MAIN_LOOP_EXIT_PANIC
#define VLIB_MAIN_LOOP_EXIT_PANIC
Definition: main.h:148
vlib_worker_loop
void vlib_worker_loop(vlib_main_t *vm)
Definition: main.c:1781
PREDICT_FALSE
#define PREDICT_FALSE(x)
Definition: clib.h:124
vlib_trace_filter_t::trace_filter_enable
u8 trace_filter_enable
Definition: main.h:62
callback_data.h
Callback multiplex scheme.
vlib_main_t::main_loop_vectors_processed
u32 main_loop_vectors_processed
Definition: main.h:121
vlib_config_function_runtime_t
Definition: init.h:68
VLIB_MAIN_LOOP_EXIT_CLI
#define VLIB_MAIN_LOOP_EXIT_CLI
Definition: main.h:150
vlib_node_runtime_perf_callback_data_t::v
void * v
Definition: main.h:94
vlib_main_t::loop_interval_end
f64 loop_interval_end
Definition: main.h:235
vlib_node_runtime_perf_callback_data_t
Definition: main.h:89
clib_spinlock_s
Definition: lock.h:51
vlib_main_t::internal_node_last_vectors_per_main_loop
u32 internal_node_last_vectors_per_main_loop
Definition: main.h:131
vlib_main_t::elog_trace_api_messages
int elog_trace_api_messages
Definition: main.h:194
vlib_global_main_t::api_init_function_registrations
_vlib_init_function_list_elt_t * api_init_function_registrations
Definition: main.h:311
uword
u64 uword
Definition: types.h:112
vlib_global_main_t::post_mortem_callbacks
void(** post_mortem_callbacks)(void)
Definition: main.h:285
vlib_add_del_post_mortem_callback
void vlib_add_del_post_mortem_callback(void *cb, int is_add)
Definition: main.c:1789
vlib_main_t::thread_index
u32 thread_index
Definition: main.h:213
pool.h
Fixed length block allocator. Pools are built from clib vectors and bitmaps. Use pools when repeatedl...
vlib_main_t::worker_init_functions_called
uword * worker_init_functions_called
Definition: main.h:189
vlib_main_t::os_punt_frame
void(* os_punt_frame)(struct vlib_main_t *vm, struct vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: main.h:181
time.h
f64
double f64
Definition: types.h:142
vlib_global_main_t::node_registrations
vlib_node_registration_t * node_registrations
Definition: main.h:297
vlib_main_t::cpu_time_last_node_dispatch
u64 cpu_time_last_node_dispatch
Definition: main.h:112
vlib_cli_main_t
Definition: cli.h:136
format.h
vlib_main_t::pending_rpc_requests
uword * pending_rpc_requests
Definition: main.h:260
clib_time_now
static f64 clib_time_now(clib_time_t *c)
Definition: time.h:230
vlib_node_runtime_perf_callback_data_t::fp
vlib_node_runtime_perf_callback_fp_t fp
Definition: main.h:91
vlib_main_t::barrier_perf_callbacks_tmp
void(**volatile barrier_perf_callbacks_tmp)(struct vlib_main_t *, u64 t, int leave)
Definition: main.h:254
vlib_main_init
static void vlib_main_init()
Definition: main.h:460
vlib_main_t::barrier_epoch
f64 barrier_epoch
Definition: main.h:245
vlib_main_t::api_queue_nonempty
volatile u32 api_queue_nonempty
Definition: main.h:219
CLIB_CACHE_LINE_BYTES
#define CLIB_CACHE_LINE_BYTES
Definition: cache.h:59
vlib_node_registration_t
struct _vlib_node_registration vlib_node_registration_t
vlib_global_main_t::elog_main
elog_main_t elog_main
Definition: main.h:300
vlib_node_runtime_perf_callback_args_t::vm
struct vlib_main_t * vm
Definition: main.h:75
vlib_main_t::vlib_node_runtime_perf_callbacks
vlib_node_runtime_perf_callback_set_t vlib_node_runtime_perf_callbacks
Definition: main.h:134
data
u8 data[128]
Definition: ipsec_types.api:92
clib_callback_data_call_vec
#define clib_callback_data_call_vec(vec_,...)
Iterate and call a callback vector.
Definition: callback_data.h:276
vlib_get_elog_main_not_inline
elog_main_t * vlib_get_elog_main_not_inline()
Definition: main.c:2092
vlib_main_t::numa_node
u32 numa_node
Definition: main.h:215
vlib_main_t::elog_trace_graph_circuit
int elog_trace_graph_circuit
Definition: main.h:197
always_inline
#define always_inline
Definition: rdma_mlx5dv.h:23
vlib_node_runtime_perf_callback_args_t::frame
vlib_frame_t * frame
Definition: main.h:77
vlib_main_t::worker_thread_main_loop_callback_tmp
void(**volatile worker_thread_main_loop_callback_tmp)(struct vlib_main_t *, u64 t)
Definition: main.h:227
clib_time_t
Definition: time.h:44
vlib_global_main_t::init_function_registrations
_vlib_init_function_list_elt_t * init_function_registrations
Definition: main.h:307
u64
unsigned long u64
Definition: types.h:89
ASSERT
#define ASSERT(truth)
Definition: error_bootstrap.h:69
vlib_panic
static void vlib_panic(vlib_main_t *vm)
Definition: main.h:387
vlib_node_runtime_perf_callback_args_t::call_type
vlib_node_runtime_perf_call_type_t call_type
Definition: main.h:80
vlib_main_t::loops_per_second
f64 loops_per_second
Definition: main.h:237
u32
unsigned int u32
Definition: types.h:88
vlib_main_t::seconds_per_loop
f64 seconds_per_loop
Definition: main.h:238
vlib_time_now_ticks
static f64 vlib_time_now_ticks(vlib_main_t *vm, u64 n)
Definition: main.h:338
clib_random_buffer_t
Definition: random_buffer.h:49
vlib_main_t::internal_node_calls_last_clear
u64 internal_node_calls_last_clear
Definition: main.h:128
vlib_main_t::heap_base
void * heap_base
Definition: main.h:156
vlib_main_t::worker_thread_main_loop_callback_lock
clib_spinlock_t worker_thread_main_loop_callback_lock
Definition: main.h:228
vlib_main_t::internal_node_vectors
u64 internal_node_vectors
Definition: main.h:125
vlib_thread_stacks
u8 ** vlib_thread_stacks
Definition: main.c:659
vlib_node_runtime_perf_callback_data_t::u
u64 u
Definition: main.h:95
vlib_internal_node_vector_rate
static f64 vlib_internal_node_vector_rate(vlib_main_t *vm)
Definition: main.h:394
vlib_set_queue_signal_callback
static void vlib_set_queue_signal_callback(vlib_main_t *vm, void(*fp)(vlib_main_t *))
Definition: main.h:454
vlib_main_t
Definition: main.h:102
clib_callback_data_typedef
clib_callback_data_typedef(vlib_node_runtime_perf_callback_set_t, vlib_node_runtime_perf_callback_data_t)
u8
unsigned char u8
Definition: types.h:56
clib_error_t
Definition: clib_error.h:21
vlib_main_t::main_loop_nodes_processed
u32 main_loop_nodes_processed
Definition: main.h:122
elog_main_t
Definition: elog.h:132
vlib_node_runtime_perf_callback_data_t
struct vlib_node_runtime_perf_callback_data_t vlib_node_runtime_perf_callback_data_t
vlib_increment_main_loop_counter
static void vlib_increment_main_loop_counter(vlib_main_t *vm)
Definition: main.h:417
vlib_global_main_t::worker_init_function_registrations
_vlib_init_function_list_elt_t * worker_init_function_registrations
Definition: main.h:310
vlib_one_time_waiting_process_t
Definition: node.h:602
vlib_physmem_main_t
Definition: physmem.h:56
clib_mem_alloc_aligned
static void * clib_mem_alloc_aligned(uword size, uword align)
Definition: mem.h:261
vlib_main_t::worker_thread_main_loop_callbacks
void(**volatile worker_thread_main_loop_callbacks)(struct vlib_main_t *, u64 t)
Definition: main.h:225
vlib_global_main_t::init_functions_called
uword * init_functions_called
Definition: main.h:315
vlib_main_t::random_seed
uword random_seed
Definition: main.h:207
vlib_time_now
static f64 vlib_time_now(vlib_main_t *vm)
Definition: main.h:325
vlib_node_main_t
Definition: node.h:665
vlib_main_t::trace_main
vlib_trace_main_t trace_main
Definition: main.h:174
vlib_node_runtime_t
Definition: node.h:454
vlib_main_t
struct vlib_main_t vlib_main_t
vlib_global_main_t::CLIB_CACHE_LINE_ALIGN_MARK
CLIB_CACHE_LINE_ALIGN_MARK(cacheline0)
elog_event_type_t
Definition: elog.h:82
vlib_main_t::main_loop_exit_set
u32 main_loop_exit_set
Definition: main.h:143
vlib_node_runtime_perf_callback_args_t
Definition: main.h:73
vlib_main_t::internal_node_vectors_last_clear
u64 internal_node_vectors_last_clear
Definition: main.h:127
vlib_main_t::CLIB_CACHE_LINE_ALIGN_MARK
CLIB_CACHE_LINE_ALIGN_MARK(cacheline0)
vlib_global_main_t::vlib_mains
vlib_main_t ** vlib_mains
Definition: main.h:279
VLIB_NODE_RUNTIME_PERF_AFTER
@ VLIB_NODE_RUNTIME_PERF_AFTER
Definition: main.h:69
vlib_trace_main_t
Definition: trace.h:83
vlib_main_t::cpu_time_main_loop_start
u64 cpu_time_main_loop_start
Definition: main.h:115
vlib_main_t::main_loop_exit
clib_longjmp_t main_loop_exit
Definition: main.h:146
vlib_main_t::damping_constant
f64 damping_constant
Definition: main.h:239
vlib_node_runtime_perf_counter
static void vlib_node_runtime_perf_counter(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, uword n, u64 t, vlib_node_runtime_perf_call_type_t call_type)
Definition: main.h:433
vlib_global_main_t::configured_elog_ring_size
u32 configured_elog_ring_size
Definition: main.h:301
vlib_main_t::time_last_barrier_release
f64 time_last_barrier_release
Definition: main.h:109
clib_longjmp_t
Definition: longjmp.h:102