FD.io VPP  v21.10.1-2-g0a485f517
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... */
146  /* Exit status that will be returned by the process upon exit. */
147  volatile int main_loop_exit_status;
149 #define VLIB_MAIN_LOOP_EXIT_NONE 0
150 #define VLIB_MAIN_LOOP_EXIT_PANIC 1
151  /* Exit via CLI. */
152 #define VLIB_MAIN_LOOP_EXIT_CLI 2
153 
154  /* Error marker to use when exiting main loop. */
156 
157  /* Start of the heap. */
158  void *heap_base;
159 
160  /* Truncated version, to create frame indices */
162 
163  /* Size of the heap */
165 
166  /* buffer main structure. */
168 
169  /* physical memory main structure. */
171 
172  /* Node graph main structure. */
174 
175  /* Packet trace buffer. */
177 
178  /* Error handling. */
180 
181  /* Punt packets to underlying operating system for when fast switching
182  code does not know what to do. */
183  void (*os_punt_frame) (struct vlib_main_t * vm,
184  struct vlib_node_runtime_t * node,
185  vlib_frame_t * frame);
186 
187  /* Stream index to use for distribution when MC is enabled. */
189 
190  /* Hash table to record which init functions have been called. */
192 
194 
195  /* Event logger trace flags */
201 
202  /* Node call and return event types. */
205 
207 
208  /* Seed for random number generator. */
210 
211  /* Buffer of random data for various uses. */
213 
214  /* thread, cpu and numa_node indices */
218 
219  /* control-plane API queue signal pending, length indication */
222  void (*queue_signal_callback) (struct vlib_main_t *);
223  u8 **argv;
224 
225  /* Top of (worker) dispatch loop callback */
226  void (**volatile worker_thread_main_loop_callbacks)
227  (struct vlib_main_t *, u64 t);
228  void (**volatile worker_thread_main_loop_callback_tmp)
229  (struct vlib_main_t *, u64 t);
231 
232  /* debugging */
233  volatile int parked_at_barrier;
234 
235  /* Dispatch loop time accounting */
242 
243  /*
244  * Barrier epoch - Set to current time, each time barrier_sync or
245  * barrier_release is called with zero recursion.
246  */
248 
249  /* Earliest barrier can be closed again */
251 
252  /* Barrier counter callback */
253  void (**volatile barrier_perf_callbacks)
254  (struct vlib_main_t *, u64 t, int leave);
255  void (**volatile barrier_perf_callbacks_tmp)
256  (struct vlib_main_t *, u64 t, int leave);
257 
258  /* Need to check the frame queues */
260 
261  /* RPC requests, main thread only */
265 
266  /* buffer fault injector */
269 
270 #ifdef CLIB_SANITIZE_ADDR
271  /* address sanitizer stack save */
272  void *asan_stack_save;
273 #endif
274 } vlib_main_t;
275 
276 typedef struct vlib_global_main_t
277 {
278  CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
279 
280  /* Per-thread Mains */
282 
283  /* Name for e.g. syslog. */
284  char *name;
285 
286  /* post-mortem callbacks */
287  void (**post_mortem_callbacks) (void);
288 
289  /*
290  * Need to call vlib_worker_thread_node_runtime_update before
291  * releasing worker thread barrier.
292  */
294 
295  /* Command line interface. */
297 
298  /* Node registrations added by constructors */
300 
301  /* Event logger. */
304 
305  /* Packet trace capture filter */
307 
308  /* List of init functions to call, setup by constructors */
309  _vlib_init_function_list_elt_t *init_function_registrations;
310  _vlib_init_function_list_elt_t *main_loop_enter_function_registrations;
311  _vlib_init_function_list_elt_t *main_loop_exit_function_registrations;
312  _vlib_init_function_list_elt_t *worker_init_function_registrations;
313  _vlib_init_function_list_elt_t *api_init_function_registrations;
315 
316  /* Hash table to record which init functions have been called. */
318 
320 
321 /* Global main structure. */
323 
325 
328 {
329 #if CLIB_DEBUG > 0
330  extern __thread uword __os_thread_index;
331 #endif
332  /*
333  * Make sure folks don't pass &vlib_global_main from a worker thread.
334  */
335  ASSERT (vm->thread_index == __os_thread_index);
336  return clib_time_now (&vm->clib_time) + vm->time_offset;
337 }
338 
341 {
342  return clib_time_now_internal (&vm->clib_time, n);
343 }
344 
345 /* Busy wait for specified time. */
346 always_inline void
348 {
349  f64 t = vlib_time_now (vm);
350  f64 limit = t + wait;
351  while (t < limit)
352  t = vlib_time_now (vm);
353 }
354 
355 /* Time a piece of code. */
356 #define vlib_time_code(vm,body) \
357 do { \
358  f64 _t[2]; \
359  _t[0] = vlib_time_now (vm); \
360  do { body; } while (0); \
361  _t[1] = vlib_time_now (vm); \
362  clib_warning ("%.7e", _t[1] - _t[0]); \
363 } while (0)
364 
365 #define vlib_wait_with_timeout(vm,suspend_time,timeout_time,test) \
366 ({ \
367  uword __vlib_wait_with_timeout = 0; \
368  f64 __vlib_wait_time = 0; \
369  while (! (__vlib_wait_with_timeout = (test)) \
370  && __vlib_wait_time < (timeout_time)) \
371  { \
372  vlib_process_suspend (vm, suspend_time); \
373  __vlib_wait_time += suspend_time; \
374  } \
375  __vlib_wait_with_timeout; \
376 })
377 
378 always_inline void
380 {
383 }
384 
385 #define vlib_panic_with_msg(vm,args...) \
386  vlib_panic_with_error (vm, clib_error_return (0, args))
387 
388 always_inline void
390 {
392 }
393 
394 /* Asynchronously requests exit with the given status. */
395 void vlib_exit_with_status (vlib_main_t *vm, int status);
396 
399 {
400  u64 vectors;
401  u64 calls;
402 
404 
405  if (PREDICT_FALSE (calls == 0))
406  return 0.0;
407 
409 
410  return (f64) vectors / (f64) calls;
411 }
412 
413 always_inline void
415 {
418 }
419 
420 always_inline void
422 {
423  vm->main_loop_count++;
425 
428 }
429 
432 {
434 }
435 
436 always_inline void
438  vlib_frame_t * frame, uword n, u64 t,
440 {
443  if (vec_len (v))
444  {
446  .vm = vm,
447  .node = node,
448  .frame = frame,
449  .packets = n,
450  .cpu_time_now = t,
451  .call_type = call_type,
452  };
453  clib_callback_data_call_vec (v, &args);
454  }
455 }
456 
458  (vlib_main_t * vm, void (*fp) (vlib_main_t *))
459 {
461 }
462 
463 always_inline void
465 {
467  vlib_main_t *vm;
468 
469  vgm->init_functions_called = hash_create (0, /* value bytes */ 0);
470 
472  vec_add1 (vgm->vlib_mains, vm);
473 }
474 
475 /* Main routine. */
476 int vlib_main (vlib_main_t * vm, unformat_input_t * input);
477 
478 /* Thread stacks, for os_get_thread_index */
479 extern u8 **vlib_thread_stacks;
480 
481 /* Number of thread stacks that the application needs */
482 u32 vlib_app_num_thread_stacks_needed (void) __attribute__ ((weak));
483 
484 void vlib_add_del_post_mortem_callback (void *cb, int is_add);
485 
488 
489 #endif /* included_vlib_main_h */
490 
491 /*
492  * fd.io coding-style-patch-verification: ON
493  *
494  * Local Variables:
495  * eval: (c-set-style "gnu")
496  * End:
497  */
vlib_buffer_main_t
Definition: buffer.h:479
vlib_error_main_t
Definition: error.h:61
vlib_main_t::cpu_id
u32 cpu_id
Definition: main.h:216
vlib_main_t::random_buffer
clib_random_buffer_t random_buffer
Definition: main.h:212
vlib_main_t::barrier_no_close_before
f64 barrier_no_close_before
Definition: main.h:250
vlib_main_t::mc_stream_index
u32 mc_stream_index
Definition: main.h:188
vlib_main_t::procs_waiting_for_mc_stream_join
vlib_one_time_waiting_process_t * procs_waiting_for_mc_stream_join
Definition: main.h:193
vlib_global_main_t
Definition: main.h:276
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:311
vlib_global_main_t::main_loop_enter_function_registrations
_vlib_init_function_list_elt_t * main_loop_enter_function_registrations
Definition: main.h:310
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:264
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:161
vlib_clear_internal_node_vector_rate
static void vlib_clear_internal_node_vector_rate(vlib_main_t *vm)
Definition: main.h:414
vlib_app_num_thread_stacks_needed
u32 vlib_app_num_thread_stacks_needed(void)
Definition: main.c:466
vlib_main_t::node_call_elog_event_types
elog_event_type_t * node_call_elog_event_types
Definition: main.h:203
vlib_main_t::error_main
vlib_error_main_t error_main
Definition: main.h:179
vlib_main_t::node_main
vlib_node_main_t node_main
Definition: main.h:173
vlib_main_t::barrier_perf_callbacks
void(**volatile barrier_perf_callbacks)(struct vlib_main_t *, u64 t, int leave)
Definition: main.h:254
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:233
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:200
vlib_main_t::buffer_main
vlib_buffer_main_t * buffer_main
Definition: main.h:167
vlib_time_wait
static void vlib_time_wait(vlib_main_t *vm, f64 wait)
Definition: main.h:347
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:222
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:164
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
vlib_main_t::node_return_elog_event_types
elog_event_type_t * node_return_elog_event_types
Definition: main.h:204
random_buffer.h
vlib_main_t::queue_signal_pending
volatile u32 queue_signal_pending
Definition: main.h:220
vlib_main_t::check_frame_queues
volatile uword check_frame_queues
Definition: main.h:259
vlib_main_t::elog_trace_cli_commands
int elog_trace_cli_commands
Definition: main.h:197
error
Definition: cJSON.c:88
vlib_main_t::loop_interval_start
f64 loop_interval_start
Definition: main.h:238
vlib_global_main_t::name
char * name
Definition: main.h:284
vlib_main_t::buffer_alloc_success_rate
f64 buffer_alloc_success_rate
Definition: main.h:268
vlib_panic_with_error
static void vlib_panic_with_error(vlib_main_t *vm, clib_error_t *error)
Definition: main.h:379
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:314
vlib_global_main_t::trace_filter
vlib_trace_filter_t trace_filter
Definition: main.h:306
vlib_global_main_t::cli_main
vlib_cli_main_t cli_main
Definition: main.h:296
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:155
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:236
vlib_main_t::processing_rpc_requests
uword * processing_rpc_requests
Definition: main.h:263
vlib_global_main_t::need_vlib_worker_thread_node_runtime_update
int need_vlib_worker_thread_node_runtime_update
Definition: main.h:293
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:206
vlib_main_t::argv
u8 ** argv
Definition: main.h:223
vlib_main_t::buffer_alloc_success_seed
u32 buffer_alloc_success_seed
Definition: main.h:267
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:198
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:170
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:431
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:150
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:152
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:237
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:196
vlib_global_main_t::api_init_function_registrations
_vlib_init_function_list_elt_t * api_init_function_registrations
Definition: main.h:313
uword
u64 uword
Definition: types.h:112
vlib_global_main_t::post_mortem_callbacks
void(** post_mortem_callbacks)(void)
Definition: main.h:287
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:215
pool.h
Fixed length block allocator. Pools are built from clib vectors and bitmaps. Use pools when repeatedl...
vlib_exit_with_status
void vlib_exit_with_status(vlib_main_t *vm, int status)
Definition: main.c:2098
vlib_main_t::worker_init_functions_called
uword * worker_init_functions_called
Definition: main.h:191
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:183
time.h
f64
double f64
Definition: types.h:142
vlib_global_main_t::node_registrations
vlib_node_registration_t * node_registrations
Definition: main.h:299
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:262
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:256
vlib_main_init
static void vlib_main_init()
Definition: main.h:464
vlib_main_t::barrier_epoch
f64 barrier_epoch
Definition: main.h:247
vlib_main_t::api_queue_nonempty
volatile u32 api_queue_nonempty
Definition: main.h:221
CLIB_CACHE_LINE_BYTES
#define CLIB_CACHE_LINE_BYTES
Definition: cache.h:58
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:302
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:95
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:217
vlib_main_t::elog_trace_graph_circuit
int elog_trace_graph_circuit
Definition: main.h:199
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:229
vlib_main_t::main_loop_exit_status
volatile int main_loop_exit_status
Definition: main.h:147
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:309
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:389
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:239
u32
unsigned int u32
Definition: types.h:88
vlib_main_t::seconds_per_loop
f64 seconds_per_loop
Definition: main.h:240
vlib_time_now_ticks
static f64 vlib_time_now_ticks(vlib_main_t *vm, u64 n)
Definition: main.h:340
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:158
vlib_main_t::worker_thread_main_loop_callback_lock
clib_spinlock_t worker_thread_main_loop_callback_lock
Definition: main.h:230
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:398
vlib_set_queue_signal_callback
static void vlib_set_queue_signal_callback(vlib_main_t *vm, void(*fp)(vlib_main_t *))
Definition: main.h:458
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:421
vlib_global_main_t::worker_init_function_registrations
_vlib_init_function_list_elt_t * worker_init_function_registrations
Definition: main.h:312
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:264
vlib_main_t::worker_thread_main_loop_callbacks
void(**volatile worker_thread_main_loop_callbacks)(struct vlib_main_t *, u64 t)
Definition: main.h:227
vlib_global_main_t::init_functions_called
uword * init_functions_called
Definition: main.h:317
vlib_main_t::random_seed
uword random_seed
Definition: main.h:209
vlib_time_now
static f64 vlib_time_now(vlib_main_t *vm)
Definition: main.h:327
vlib_node_main_t
Definition: node.h:665
vlib_main_t::trace_main
vlib_trace_main_t trace_main
Definition: main.h:176
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:281
hash_create
#define hash_create(elts, value_bytes)
Definition: hash.h:695
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:148
vlib_main_t::damping_constant
f64 damping_constant
Definition: main.h:241
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:437
vlib_global_main_t::configured_elog_ring_size
u32 configured_elog_ring_size
Definition: main.h:303
vlib_main_t::time_last_barrier_release
f64 time_last_barrier_release
Definition: main.h:109
clib_longjmp_t
Definition: longjmp.h:102