FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
threads.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 #ifndef included_vlib_threads_h
16 #define included_vlib_threads_h
17 
18 #include <vlib/main.h>
19 #include <vppinfra/callback.h>
20 #include <linux/sched.h>
21 
22 void vlib_set_thread_name (char *name);
23 
24 /* arg is actually a vlib__thread_t * */
25 typedef void (vlib_thread_function_t) (void *arg);
26 
28 {
29  /* constructor generated list of thread registrations */
31 
32  /* config parameters */
33  char *name;
34  char *short_name;
41 
42  /* All threads of this type run on pthreads */
47 
48 /*
49  * Frames have their cpu / vlib_main_t index in the low-order N bits
50  * Make VLIB_MAX_CPUS a power-of-two, please...
51  */
52 
53 #ifndef VLIB_MAX_CPUS
54 #define VLIB_MAX_CPUS 256
55 #endif
56 
57 #if VLIB_MAX_CPUS > CLIB_MAX_MHEAPS
58 #error Please increase number of per-cpu mheaps
59 #endif
60 
61 #define VLIB_CPU_MASK (VLIB_MAX_CPUS - 1) /* 0x3f, max */
62 #define VLIB_OFFSET_MASK (~VLIB_CPU_MASK)
63 
64 #define VLIB_LOG2_THREAD_STACK_SIZE (21)
65 #define VLIB_THREAD_STACK_SIZE (1<<VLIB_LOG2_THREAD_STACK_SIZE)
66 
67 typedef struct
68 {
69  CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
70  volatile u32 valid;
74  STRUCT_MARK (end_of_reset);
75 
76  CLIB_CACHE_LINE_ALIGN_MARK (cacheline1);
77  u32 buffer_index[VLIB_FRAME_SIZE];
78 }
80 
81 typedef struct
82 {
83  /* First cache line */
84  CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
85  volatile u32 *wait_at_barrier;
87 
88  /* Second Cache Line */
89  CLIB_CACHE_LINE_ALIGN_MARK (cacheline1);
90  void *thread_mheap;
92  void (*thread_function) (void *);
98  u8 *name;
101  const char *barrier_caller;
102  const char *barrier_context;
104 
105  long lwp;
106  int cpu_id;
107  int core_id;
108  int numa_id;
109  pthread_t thread_id;
111 
113 
114 typedef struct
115 {
116  /* static data */
117  CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
122 
123  /* modified by enqueue side */
124  CLIB_CACHE_LINE_ALIGN_MARK (cacheline1);
125  volatile u64 tail;
126 
127  /* modified by dequeue side */
128  CLIB_CACHE_LINE_ALIGN_MARK (cacheline2);
129  volatile u64 head;
130 }
132 
133 typedef struct
134 {
137 
139 
140  /* for frame queue tracing */
144 
145 typedef struct
146 {
151 
152 /* Called early, in thread 0's context */
154 
156 
158  void (*thread_function) (void *));
159 
162 
163 /* Check for a barrier sync request every 30ms */
164 #define BARRIER_SYNC_DELAY (0.030000)
165 
166 #if CLIB_DEBUG > 0
167 /* long barrier timeout, for gdb... */
168 #define BARRIER_SYNC_TIMEOUT (600.1)
169 #else
170 #define BARRIER_SYNC_TIMEOUT (1.0)
171 #endif
172 
173 #define vlib_worker_thread_barrier_sync(X) {vlib_worker_thread_barrier_sync_int(X, __FUNCTION__);}
174 
176  const char *func_name);
181 /**
182  * Wait until each of the workers has been once around the track
183  */
184 void vlib_worker_wait_one_loop (void);
185 
188 {
189  return __os_thread_index;
190 }
191 
192 always_inline void
194 {
195  if (CLIB_DEBUG > 0)
196  {
197  if (vlib_get_thread_index ())
198  fformat (stderr, "%s: SMP unsafe warning...\n", __FUNCTION__);
199  }
200 }
201 
202 always_inline int
203 __foreach_vlib_main_helper (vlib_main_t *ii, vlib_main_t **p)
204 {
205  vlib_main_t *vm;
206  u32 index = ii - (vlib_main_t *) 0;
207 
209  return 0;
210 
212  ASSERT (index == 0 || vm->parked_at_barrier == 1);
213  return 1;
214 }
215 
216 #define foreach_vlib_main() \
217  for (vlib_main_t *ii = 0, *this_vlib_main; \
218  __foreach_vlib_main_helper (ii, &this_vlib_main); ii++) \
219  if (this_vlib_main)
220 
221 #define foreach_sched_policy \
222  _(SCHED_OTHER, OTHER, "other") \
223  _(SCHED_BATCH, BATCH, "batch") \
224  _(SCHED_IDLE, IDLE, "idle") \
225  _(SCHED_FIFO, FIFO, "fifo") \
226  _(SCHED_RR, RR, "rr")
227 
228 typedef enum
229 {
230 #define _(v,f,s) SCHED_POLICY_##f = v,
232 #undef _
235 
236 typedef struct
237 {
238  clib_error_t *(*vlib_launch_thread_cb) (void *fp, vlib_worker_thread_t * w,
239  unsigned cpu_id);
240  clib_error_t *(*vlib_thread_set_lcore_cb) (u32 thread, u16 cpu);
242 
243 typedef struct
244 {
245  /* Link list of registrations, built by constructors */
247 
248  /* Vector of registrations, w/ non-data-structure clones at the top */
250 
252 
254 
255  /*
256  * Launch all threads as pthreads,
257  * not eal_rte_launch (strict affinity) threads
258  */
260 
261  /* Number of vlib_main / vnet_main clones */
263 
264  /* Number of thread stacks to create */
266 
267  /* Number of pthreads */
269 
270  /* Number of threads */
272 
273  /* Number of cores to skip, must match the core mask */
275 
276  /* Thread prefix name */
278 
279  /* main thread lcore */
281 
282  /* Bitmap of available CPU cores */
284 
285  /* Bitmap of available CPU sockets (NUMA nodes) */
287 
288  /* Worker handoff queues */
290 
291  /* worker thread initialization barrier */
293 
294  /* scheduling policy */
296 
297  /* scheduling policy priority */
299 
300  /* callbacks */
303 
304  /* NUMA-bound heap size */
306 
308 
310 
311 #include <vlib/global_funcs.h>
312 
313 #define VLIB_REGISTER_THREAD(x,...) \
314  __VA_ARGS__ vlib_thread_registration_t x; \
315 static void __vlib_add_thread_registration_##x (void) \
316  __attribute__((__constructor__)) ; \
317 static void __vlib_add_thread_registration_##x (void) \
318 { \
319  vlib_thread_main_t * tm = &vlib_thread_main; \
320  x.next = tm->next; \
321  tm->next = &x; \
322 } \
323 static void __vlib_rm_thread_registration_##x (void) \
324  __attribute__((__destructor__)) ; \
325 static void __vlib_rm_thread_registration_##x (void) \
326 { \
327  vlib_thread_main_t * tm = &vlib_thread_main; \
328  VLIB_REMOVE_FROM_LINKED_LIST (tm->next, &x, next); \
329 } \
330 __VA_ARGS__ vlib_thread_registration_t x
331 
334 {
335  return vlib_thread_main.n_vlib_mains - 1;
336 }
337 
340 {
341  return worker_index + 1;
342 }
343 
346 {
347  return thread_index - 1;
348 }
349 
352 {
353  return vlib_get_thread_index () - 1;
354 }
355 
356 static inline void
358 {
360  {
364  f64 t = vlib_time_now (vm);
365 
368  vm->clib_time.last_cpu_time, 0 /* enter */ );
369 
371  {
373  /* *INDENT-OFF* */
374  ELOG_TYPE_DECLARE (e) = {
375  .format = "barrier-wait-thread-%d",
376  .format_args = "i4",
377  };
378  /* *INDENT-ON* */
379 
380  struct
381  {
383  } __clib_packed *ed;
384 
386  ed->thread_index = thread_index;
387  }
388 
389  if (CLIB_DEBUG > 0)
390  {
391  vm = vlib_get_main ();
392  vm->parked_at_barrier = 1;
393  }
396  ;
397 
398  /*
399  * Recompute the offset from thread-0 time.
400  * Note that vlib_time_now adds vm->time_offset, so
401  * clear it first. Save the resulting idea of "now", to
402  * see how well we're doing. See show_clock_command_fn(...)
403  */
404  {
405  f64 now;
406  vm->time_offset = 0.0;
407  now = vlib_time_now (vm);
410  }
411 
412  if (CLIB_DEBUG > 0)
413  vm->parked_at_barrier = 0;
415 
417  {
419  {
420  t = vlib_time_now (vm) - t;
422  /* *INDENT-OFF* */
423  ELOG_TYPE_DECLARE (e) = {
424  .format = "barrier-refork-thread-%d",
425  .format_args = "i4",
426  };
427  /* *INDENT-ON* */
428 
429  struct
430  {
432  } __clib_packed *ed;
433 
435  w->elog_track);
436  ed->thread_index = thread_index;
437  }
438 
441  -1);
443  ;
444  }
446  {
447  t = vlib_time_now (vm) - t;
449  /* *INDENT-OFF* */
450  ELOG_TYPE_DECLARE (e) = {
451  .format = "barrier-released-thread-%d: %dus",
452  .format_args = "i4i4",
453  };
454  /* *INDENT-ON* */
455 
456  struct
457  {
459  u32 duration;
460  } __clib_packed *ed;
461 
463  ed->thread_index = thread_index;
464  ed->duration = (int) (1000000.0 * t);
465  }
466 
469  vm->clib_time.last_cpu_time, 1 /* leave */ );
470  }
471 }
472 
475 {
476  vlib_main_t *vm;
478  ASSERT (worker_index < tm->n_vlib_mains - 1);
479  vm = vlib_get_main_by_index (worker_index + 1);
480  ASSERT (vm);
481  return vm;
482 }
483 
484 static inline u8
486 {
487  return (!vlib_num_workers ()
488  || ((vlib_get_thread_index () == 0
490 }
491 
495 extern void *rpc_call_main_thread_cb_fn;
496 
497 void
499  args);
500 void vlib_rpc_call_main_thread (void *function, u8 * args, u32 size);
503 
504 #endif /* included_vlib_threads_h */
505 
506 /*
507  * fd.io coding-style-patch-verification: ON
508  *
509  * Local Variables:
510  * eval: (c-set-style "gnu")
511  * End:
512  */
vlib_thread_function_t
void() vlib_thread_function_t(void *arg)
Definition: threads.h:25
vlib_worker_thread_t::barrier_caller
const char * barrier_caller
Definition: threads.h:101
vlib_thread_main_t::next
vlib_thread_registration_t * next
Definition: threads.h:246
vlib_get_thread_core_numa
void vlib_get_thread_core_numa(vlib_worker_thread_t *w, unsigned cpu_id)
Definition: threads.c:428
vlib_num_workers
static u32 vlib_num_workers()
Definition: threads.h:333
vlib_worker_threads
vlib_worker_thread_t * vlib_worker_threads
Definition: threads.c:35
thread_index
u32 thread_index
Definition: nat44_ei_hairpinning.c:495
vlib_global_main_t
Definition: main.h:276
vlib_thread_main_t::cpu_core_bitmap
uword * cpu_core_bitmap
Definition: threads.h:283
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_frame_queue_t::tail
volatile u64 tail
Definition: threads.h:125
vlib_get_worker_thread_index
static u32 vlib_get_worker_thread_index(u32 worker_index)
Definition: threads.h:339
vlib_frame_queue_t::vector_threshold
u64 vector_threshold
Definition: threads.h:119
vlib_set_thread_name
void vlib_set_thread_name(char *name)
Definition: threads.c:145
CLIB_CACHE_LINE_ALIGN_MARK
#define CLIB_CACHE_LINE_ALIGN_MARK(mark)
Definition: cache.h:60
name
string name[64]
Definition: fib.api:25
vlib_worker_thread_barrier_check
static void vlib_worker_thread_barrier_check(void)
Definition: threads.h:357
vlib_get_worker_index
static u32 vlib_get_worker_index(u32 thread_index)
Definition: threads.h:345
vlib_get_worker_vlib_main
static vlib_main_t * vlib_get_worker_vlib_main(u32 worker_index)
Definition: threads.h:474
vlib_worker_thread_t::node_reforks_required
volatile u32 * node_reforks_required
Definition: threads.h:103
vlib_thread_callbacks_t
Definition: threads.h:236
VLIB_FRAME_SIZE
#define VLIB_FRAME_SIZE
Definition: node.h:368
vlib_thread_main_t::n_pthreads
u32 n_pthreads
Definition: threads.h:268
vlib_worker_thread_initial_barrier_sync_and_release
void vlib_worker_thread_initial_barrier_sync_and_release(vlib_main_t *vm)
Definition: threads.c:1242
vlib_thread_main_t::cb
vlib_thread_callbacks_t cb
Definition: threads.h:301
thread
pthread_t thread[MAX_CONNS]
Definition: main.c:142
vlib_get_thread_main_not_inline
vlib_thread_main_t * vlib_get_thread_main_not_inline(void)
Definition: threads.c:1685
u16
unsigned short u16
Definition: types.h:57
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_t::parked_at_barrier
volatile int parked_at_barrier
Definition: main.h:233
vlib_smp_unsafe_warning
static void vlib_smp_unsafe_warning(void)
Definition: threads.h:193
vlib_worker_thread_init
void vlib_worker_thread_init(vlib_worker_thread_t *w)
Definition: threads.c:369
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
node_index
node node_index
Definition: interface_output.c:440
vlib_frame_queue_main_t::frame_queue_nelts
u32 frame_queue_nelts
Definition: threads.h:136
vlib_frame_queue_t::trace
u64 trace
Definition: threads.h:120
vlib_thread_registration_::next
struct vlib_thread_registration_ * next
Definition: threads.h:30
vlib_thread_main_t::main_lcore
u32 main_lcore
Definition: threads.h:280
vlib_thread_main_t::cpu_socket_bitmap
uword * cpu_socket_bitmap
Definition: threads.h:286
vlib_process_signal_event_mt_helper
void vlib_process_signal_event_mt_helper(vlib_process_signal_event_mt_args_t *args)
Definition: threads.c:1605
vlib_rpc_call_main_thread
void vlib_rpc_call_main_thread(void *function, u8 *args, u32 size)
Definition: threads.c:1616
vlib_thread_registration_::frame_queue_nelts
u32 frame_queue_nelts
Definition: threads.h:40
global_funcs.h
vlib_thread_registration_::count
u32 count
Definition: threads.h:38
vlib_thread_stack_init
u8 * vlib_thread_stack_init(uword thread_index)
Definition: main.c:678
vlib_thread_cb_register
int vlib_thread_cb_register(struct vlib_main_t *vm, vlib_thread_callbacks_t *cb)
Definition: threads.c:1592
vlib_frame_queue_main_t::frame_queue_traces
frame_queue_trace_t * frame_queue_traces
Definition: threads.h:141
vlib_get_global_main
static vlib_global_main_t * vlib_get_global_main(void)
Definition: global_funcs.h:50
callback.h
Callback multiplex scheme For a fully worked-out example, see .../src/vlib/main.[ch] and ....
i64
signed long i64
Definition: types.h:78
vlib_thread_main_t::worker_thread_release
volatile u32 worker_thread_release
Definition: threads.h:292
vlib_worker_thread_t::core_id
int core_id
Definition: threads.h:107
vlib_thread_registration_::short_name
char * short_name
Definition: threads.h:34
vlib_frame_queue_elt_t
Definition: threads.h:67
vlib_worker_thread_t::wait_at_barrier
volatile u32 * wait_at_barrier
Definition: threads.h:85
vlib_thread_main_t::n_vlib_mains
u32 n_vlib_mains
Definition: threads.h:262
vlib_worker_thread_t::thread_id
pthread_t thread_id
Definition: threads.h:109
vlib_thread_main_t::worker_threads
vlib_worker_thread_t * worker_threads
Definition: threads.h:253
vec_len
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
Definition: vec_bootstrap.h:142
ELOG_TYPE_DECLARE
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:442
vlib_thread_main_t::sched_policy
u32 sched_policy
Definition: threads.h:295
vlib_thread_registration_::fixed_count
int fixed_count
Definition: threads.h:37
vlib_thread_main_t::numa_heap_size
uword numa_heap_size
Definition: threads.h:305
vlib_frame_queue_elt_t::maybe_trace
u32 maybe_trace
Definition: threads.h:71
ELOG_TRACK_DATA
#define ELOG_TRACK_DATA(em, f, track)
Definition: elog.h:478
vlib_get_current_worker_index
static u32 vlib_get_current_worker_index()
Definition: threads.h:351
PREDICT_FALSE
#define PREDICT_FALSE(x)
Definition: clib.h:124
vlib_get_thread_index
static_always_inline uword vlib_get_thread_index(void)
Definition: threads.h:187
vlib_frame_queue_elt_t::n_vectors
u32 n_vectors
Definition: threads.h:72
vlib_global_main
vlib_global_main_t vlib_global_main
Definition: main.c:1786
static_always_inline
#define static_always_inline
Definition: clib.h:112
uword
u64 uword
Definition: types.h:112
vlib_worker_thread_t::cpu_id
int cpu_id
Definition: threads.h:106
vlib_worker_thread_t::thread_mheap
void * thread_mheap
Definition: threads.h:90
vlib_thread_is_main_w_barrier
static u8 vlib_thread_is_main_w_barrier(void)
Definition: threads.h:485
vlib_thread_main_t::thread_registrations_by_name
uword * thread_registrations_by_name
Definition: threads.h:251
vlib_main_t::thread_index
u32 thread_index
Definition: main.h:215
vlib_thread_registration_::first_index
u32 first_index
Definition: threads.h:44
vlib_thread_registration_::coremask
uword * coremask
Definition: threads.h:45
vlib_frame_queue_main_t::vlib_frame_queues
vlib_frame_queue_t ** vlib_frame_queues
Definition: threads.h:138
vlib_worker_thread_t::barrier_context
const char * barrier_context
Definition: threads.h:102
f64
double f64
Definition: types.h:142
vlib_frame_queue_elt_t::offset
u32 offset
Definition: threads.h:73
vlib_worker_thread_t::thread_function_arg
void * thread_function_arg
Definition: threads.h:93
vlib_thread_main_t::n_thread_stacks
u32 n_thread_stacks
Definition: threads.h:265
vlib_worker_thread_t::lwp
long lwp
Definition: threads.h:105
vlib_worker_thread_t::numa_id
int numa_id
Definition: threads.h:108
vlib_process_signal_event_mt_args_t::data
uword data
Definition: threads.h:149
vlib_process_signal_event_mt_args_t::node_index
uword node_index
Definition: threads.h:147
vlib_thread_main_t::sched_priority
u32 sched_priority
Definition: threads.h:298
SCHED_POLICY_N
@ SCHED_POLICY_N
Definition: threads.h:233
sched_policy_t
sched_policy_t
Definition: threads.h:228
vlib_global_main_t::elog_main
elog_main_t elog_main
Definition: main.h:302
vlib_worker_thread_node_runtime_update
void vlib_worker_thread_node_runtime_update(void)
Definition: threads.c:1077
cpu_id
u32 cpu_id
Definition: vpe.api:222
clib_atomic_fetch_add
#define clib_atomic_fetch_add(a, b)
Definition: atomics.h:23
vlib_worker_thread_barrier_release
void vlib_worker_thread_barrier_release(vlib_main_t *vm)
Definition: threads.c:1375
vlib_worker_thread_t::registration
vlib_thread_registration_t * registration
Definition: threads.h:97
size
u32 size
Definition: vhost_user.h:125
index
u32 index
Definition: flow_types.api:221
always_inline
#define always_inline
Definition: rdma_mlx5dv.h:23
vlib_thread_main_t::registrations
vlib_thread_registration_t ** registrations
Definition: threads.h:249
vlib_thread_registration_::mheap_size
uword mheap_size
Definition: threads.h:36
clib_call_callbacks
#define clib_call_callbacks(h,...)
call the specified callback set
Definition: callback.h:67
elog_track_t
Definition: elog.h:113
u64
unsigned long u64
Definition: types.h:89
ASSERT
#define ASSERT(truth)
Definition: error_bootstrap.h:69
vlib_thread_main_t::n_threads
u32 n_threads
Definition: threads.h:271
rpc_call_main_thread_cb_fn
void * rpc_call_main_thread_cb_fn
Definition: threads.c:1613
vlib_thread_registration_t
struct vlib_thread_registration_ vlib_thread_registration_t
u32
unsigned int u32
Definition: types.h:88
vlib_worker_thread_t::recursion_level
i64 recursion_level
Definition: threads.h:94
vlib_thread_main_t
Definition: threads.h:243
vlib_thread_init
clib_error_t * vlib_thread_init(vlib_main_t *vm)
Definition: threads.c:173
main.h
clib_time_t::last_cpu_time
u64 last_cpu_time
Definition: time.h:51
vlib_worker_thread_t
Definition: threads.h:81
vlib_worker_thread_t::thread_stack
u8 * thread_stack
Definition: threads.h:91
vlib_get_main_by_index
static vlib_main_t * vlib_get_main_by_index(u32 thread_index)
Definition: global_funcs.h:29
vlib_worker_thread_t::barrier_elog_enabled
u8 barrier_elog_enabled
Definition: threads.h:100
vlib_worker_thread_node_refork
void vlib_worker_thread_node_refork(void)
Definition: threads.c:884
vlib_worker_thread_t::elog_track
elog_track_t elog_track
Definition: threads.h:95
vlib_thread_registration_::no_data_structure_clone
int no_data_structure_clone
Definition: threads.h:39
vlib_worker_thread_barrier_held
u8 vlib_worker_thread_barrier_held(void)
Return true if the wroker thread barrier is held.
Definition: threads.c:1270
fformat
__clib_export word fformat(FILE *f, char *fmt,...)
Definition: format.c:466
vlib_thread_registration_::name
char * name
Definition: threads.h:33
foreach_sched_policy
#define foreach_sched_policy
Definition: threads.h:221
now
f64 now
Definition: nat44_ei_out2in.c:710
vlib_thread_main_t::extern_thread_mgmt
int extern_thread_mgmt
Definition: threads.h:302
vlib_create_worker_threads
void vlib_create_worker_threads(vlib_main_t *vm, int n, void(*thread_function)(void *))
STRUCT_MARK
#define STRUCT_MARK(mark)
Definition: clib.h:78
vlib_main_t
Definition: main.h:102
vlib_frame_queue_t::nelts
u32 nelts
Definition: threads.h:121
vlib_worker_wait_one_loop
void vlib_worker_wait_one_loop(void)
Wait until each of the workers has been once around the track.
Definition: threads.c:1488
vlib_get_main
static vlib_main_t * vlib_get_main(void)
Definition: global_funcs.h:38
vlib_frame_queue_t::elts
vlib_frame_queue_elt_t * elts
Definition: threads.h:118
u8
unsigned char u8
Definition: types.h:56
clib_error_t
Definition: clib_error.h:21
vlib_worker_thread_t::workers_at_barrier
volatile u32 * workers_at_barrier
Definition: threads.h:86
frame_queue_trace_t
Definition: node.h:763
vlib_worker_thread_t::barrier_sync_count
u64 barrier_sync_count
Definition: threads.h:99
vlib_worker_thread_t::name
u8 * name
Definition: threads.h:98
vlib_thread_main
vlib_thread_main_t vlib_thread_main
Definition: threads.c:36
vlib_time_now
static f64 vlib_time_now(vlib_main_t *vm)
Definition: main.h:327
vlib_worker_thread_t::instance_id
u32 instance_id
Definition: threads.h:96
vlib_frame_queue_main_t::frame_queue_histogram
frame_queue_nelt_counter_t * frame_queue_histogram
Definition: threads.h:142
vlib_frame_queue_t
Definition: threads.h:114
vlib_thread_registration_
Definition: threads.h:27
vlib_thread_main_t::skip_cores
u32 skip_cores
Definition: threads.h:274
vlib_thread_main_t::use_pthreads
int use_pthreads
Definition: threads.h:259
vlib_frame_queue_main_init
u32 vlib_frame_queue_main_init(u32 node_index, u32 frame_queue_nelts)
Definition: threads.c:1561
vlib_global_main_t::vlib_mains
vlib_main_t ** vlib_mains
Definition: main.h:281
vlib_process_signal_event_mt_args_t
Definition: threads.h:145
vlib_thread_main_t::frame_queue_mains
vlib_frame_queue_main_t * frame_queue_mains
Definition: threads.h:289
vlib_frame_queue_elt_t::valid
volatile u32 valid
Definition: threads.h:70
vlib_frame_queue_main_t
Definition: threads.h:133
vlib_process_signal_event_mt_args_t::type_opaque
uword type_opaque
Definition: threads.h:148
vlib_thread_registration_::use_pthreads
int use_pthreads
Definition: threads.h:43
vlib_thread_main_t::thread_prefix
u8 * thread_prefix
Definition: threads.h:277
vlib_main_t::time_last_barrier_release
f64 time_last_barrier_release
Definition: main.h:109
vlib_frame_queue_main_t::node_index
u32 node_index
Definition: threads.h:135
vlib_worker_thread_barrier_sync_int
void vlib_worker_thread_barrier_sync_int(vlib_main_t *vm, const char *func_name)
Definition: threads.c:1279
vlib_frame_queue_t::head
volatile u64 head
Definition: threads.h:129
frame_queue_nelt_counter_t
Definition: node.h:775