#include <math.h>
#include <vppinfra/format.h>
#include <vppinfra/time_range.h>
+#include <vppinfra/interrupt.h>
#include <vppinfra/linux/sysfs.h>
#include <vlib/vlib.h>
{
uword c;
/* *INDENT-OFF* */
- clib_bitmap_foreach (c, tr->coremask, ({
+ clib_bitmap_foreach (c, tr->coremask) {
if (clib_bitmap_get(avail_cpu, c) == 0)
return clib_error_return (0, "cpu %u is not available to be used"
" for the '%s' thread",c, tr->name);
avail_cpu = clib_bitmap_set(avail_cpu, c, 0);
- }));
+ }
/* *INDENT-ON* */
}
else
/* *INDENT-OFF* */
clib_sysfs_read ("/sys/devices/system/node/online", "%U",
unformat_bitmap_list, &nbmp);
- clib_bitmap_foreach (node, nbmp, ({
+ clib_bitmap_foreach (node, nbmp) {
p = format (p, "%s%u/cpulist%c", sys_node_path, node, 0);
clib_sysfs_read ((char *) p, "%U", unformat_bitmap_list, &cbmp);
if (clib_bitmap_get (cbmp, cpu_id))
numa_id = node;
vec_reset_length (cbmp);
vec_reset_length (p);
- }));
+ }
/* *INDENT-ON* */
vec_free (nbmp);
vec_free (cbmp);
vlib_node_runtime_t *rt;
u32 n_vlib_mains = tm->n_vlib_mains;
u32 worker_thread_index;
- u8 *main_heap = clib_mem_get_per_cpu_heap ();
+ clib_mem_heap_t *main_heap = clib_mem_get_per_cpu_heap ();
vec_reset_length (vlib_worker_threads);
clib_callback_data_init (&vm->vlib_node_runtime_perf_callbacks,
&vm->worker_thread_main_loop_callback_lock);
- if (n_vlib_mains > 1)
- {
- /* Replace hand-crafted length-1 vector with a real vector */
- vlib_mains = 0;
+ /* Replace hand-crafted length-1 vector with a real vector */
+ vlib_mains = 0;
- vec_validate_aligned (vlib_mains, tm->n_vlib_mains - 1,
- CLIB_CACHE_LINE_BYTES);
- _vec_len (vlib_mains) = 0;
- vec_add1_aligned (vlib_mains, vm, CLIB_CACHE_LINE_BYTES);
+ vec_validate_aligned (vlib_mains, n_vlib_mains - 1, CLIB_CACHE_LINE_BYTES);
+ _vec_len (vlib_mains) = 0;
+ vec_add1_aligned (vlib_mains, vm, CLIB_CACHE_LINE_BYTES);
+ if (n_vlib_mains > 1)
+ {
vlib_worker_threads->wait_at_barrier =
clib_mem_alloc_aligned (sizeof (u32), CLIB_CACHE_LINE_BYTES);
vlib_worker_threads->workers_at_barrier =
nm_clone->nodes_by_type[VLIB_NODE_TYPE_INPUT] =
vec_dup_aligned (nm->nodes_by_type[VLIB_NODE_TYPE_INPUT],
CLIB_CACHE_LINE_BYTES);
+ clib_interrupt_init (
+ &nm_clone->interrupts,
+ vec_len (nm_clone->nodes_by_type[VLIB_NODE_TYPE_INPUT]));
vec_foreach (rt, nm_clone->nodes_by_type[VLIB_NODE_TYPE_INPUT])
{
vlib_node_t *n = vlib_get_node (vm, rt->node_index);
{
uword c;
/* *INDENT-OFF* */
- clib_bitmap_foreach (c, tr->coremask, ({
+ clib_bitmap_foreach (c, tr->coremask) {
w = vlib_worker_threads + worker_thread_index++;
err = vlib_launch_thread_int (vlib_worker_thread_bootstrap_fn,
w, c);
if (err)
clib_error_report (err);
- }));
+ }
/* *INDENT-ON* */
}
}
nm_clone->nodes_by_type[VLIB_NODE_TYPE_INPUT] =
vec_dup_aligned (nm->nodes_by_type[VLIB_NODE_TYPE_INPUT],
CLIB_CACHE_LINE_BYTES);
+ clib_interrupt_resize (
+ &nm_clone->interrupts,
+ vec_len (nm_clone->nodes_by_type[VLIB_NODE_TYPE_INPUT]));
vec_foreach (rt, nm_clone->nodes_by_type[VLIB_NODE_TYPE_INPUT])
{
};
/* *INDENT-ON* */
+vlib_thread_main_t *
+vlib_get_thread_main_not_inline (void)
+{
+ return vlib_get_thread_main ();
+}
+
/*
* fd.io coding-style-patch-verification: ON
*