vlib_get_frame_no_check (vlib_main_t * vm, uword frame_index)
{
vlib_frame_t *f;
- f = vm->heap_base + (frame_index * VLIB_FRAME_ALIGN);
+ f = vm->heap_aligned_base + (frame_index * VLIB_FRAME_ALIGN);
return f;
}
ASSERT (((uword) f & (VLIB_FRAME_ALIGN - 1)) == 0);
- i = ((u8 *) f - (u8 *) vm->heap_base);
+ i = ((u8 *) f - (u8 *) vm->heap_aligned_base);
ASSERT ((i / VLIB_FRAME_ALIGN) <= 0xFFFFFFFFULL);
return i / VLIB_FRAME_ALIGN;
uword p_flags, add_to_pending, delete_from_wheel;
void *data_to_be_written_by_caller;
+ ASSERT (n->type == VLIB_NODE_TYPE_PROCESS);
+
ASSERT (!pool_is_free_index (p->event_type_pool, t));
vec_validate (p->pending_event_data_by_type_index, t);
d[0] = data;
}
+/**
+ * Signal event to process from any thread.
+ *
+ * When in doubt, use this.
+ */
+always_inline void
+vlib_process_signal_event_mt (vlib_main_t * vm,
+ uword node_index, uword type_opaque, uword data)
+{
+ if (vlib_get_thread_index () != 0)
+ {
+ vlib_process_signal_event_mt_args_t args = {
+ .node_index = node_index,
+ .type_opaque = type_opaque,
+ .data = data,
+ };
+ vlib_rpc_call_main_thread (vlib_process_signal_event_mt_helper,
+ (u8 *) & args, sizeof (args));
+ }
+ else
+ vlib_process_signal_event (vm, node_index, type_opaque, data);
+}
+
always_inline void
vlib_process_signal_one_time_event (vlib_main_t * vm,
uword node_index,
return vlib_node_add_named_next_with_slot (vm, node, name, ~0);
}
+/**
+ * Get list of nodes
+ */
+void
+vlib_node_get_nodes (vlib_main_t * vm, u32 max_threads, int include_stats,
+ int barrier_sync, vlib_node_t **** node_dupsp,
+ vlib_main_t *** stat_vmsp);
+
/* Query node given name. */
vlib_node_t *vlib_get_node_by_name (vlib_main_t * vm, u8 * name);