}
}
}
+ /* Input nodes may have added work to the pending vector.
+ Process pending vector until there is nothing left.
+ All pending vectors will be processed from input -> output. */
+ for (i = 0; i < _vec_len (nm->pending_frames); i++)
+ cpu_time_now = dispatch_pending_node (vm, i, cpu_time_now);
+ /* Reset pending vector for next iteration. */
+ _vec_len (nm->pending_frames) = 0;
if (is_main)
{
{
uword i;
- processes_timing_wheel_data:
for (i = 0; i < _vec_len (nm->data_from_advancing_timing_wheel);
i++)
{
_vec_len (nm->data_from_advancing_timing_wheel) = 0;
}
}
-
- /* Input nodes may have added work to the pending vector.
- Process pending vector until there is nothing left.
- All pending vectors will be processed from input -> output. */
- for (i = 0; i < _vec_len (nm->pending_frames); i++)
- cpu_time_now = dispatch_pending_node (vm, i, cpu_time_now);
- /* Reset pending vector for next iteration. */
- _vec_len (nm->pending_frames) = 0;
-
- /* Pending internal nodes may resume processes. */
- if (is_main && _vec_len (nm->data_from_advancing_timing_wheel) > 0)
- goto processes_timing_wheel_data;
-
vlib_increment_main_loop_counter (vm);
/* Record time stamp in case there are no enabled nodes and above
{
}
+#define foreach_weak_reference_stub \
+_(vlib_map_stat_segment_init) \
+_(vpe_api_init) \
+_(vlibmemory_init) \
+_(map_api_segment_init)
+
+#define _(name) \
+clib_error_t *name (vlib_main_t *vm) __attribute__((weak)); \
+clib_error_t *name (vlib_main_t *vm) { return 0; }
+foreach_weak_reference_stub;
+#undef _
+
/* Main function. */
int
vlib_main (vlib_main_t * volatile vm, unformat_input_t * input)
goto done;
}
- if ((error = vlib_call_init_function (vm, map_stat_segment_init)))
+ if ((error = vlib_map_stat_segment_init (vm)))
{
clib_error_report (error);
goto done;
goto done;
}
- if ((error = vlib_call_init_function (vm, vpe_api_init)))
+ /* Direct call / weak reference, for vlib standalone use-cases */
+ if ((error = vpe_api_init (vm)))
{
clib_error_report (error);
goto done;
}
- if ((error = vlib_call_init_function (vm, vlibmemory_init)))
+ if ((error = vlibmemory_init (vm)))
{
clib_error_report (error);
goto done;
}
- if ((error = vlib_call_init_function (vm, map_api_segment_init)))
+ if ((error = map_api_segment_init (vm)))
{
clib_error_report (error);
goto done;