FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
node_funcs.h File Reference
+ Include dependency graph for node_funcs.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define VLIB_FRAME_VECTOR_ALIGN   (1 << 4)
 
#define vlib_get_next_frame_macro(vm, node, next_index, vectors, n_vectors_left, alloc_new_frame)
 
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
 Get pointer to next frame vector data by (vlib_node_runtime_t, next_index). More...
 
#define vlib_get_new_next_frame(vm, node, next_index, vectors, n_vectors_left)
 
#define vlib_set_next_frame(vm, node, next_index, v)
 

Functions

static_always_inline void vlib_process_start_switch_stack (vlib_main_t *vm, vlib_process_t *p)
 
static_always_inline void vlib_process_finish_switch_stack (vlib_main_t *vm)
 
static vlib_node_tvlib_get_node (vlib_main_t *vm, u32 i)
 Get vlib node by index. More...
 
static vlib_node_tvlib_get_next_node (vlib_main_t *vm, u32 node_index, u32 next_index)
 Get vlib node by graph arc (next) index. More...
 
static vlib_node_runtime_tvlib_node_get_runtime (vlib_main_t *vm, u32 node_index)
 Get node runtime by node index. More...
 
static void * vlib_node_get_runtime_data (vlib_main_t *vm, u32 node_index)
 Get node runtime private data by node index. More...
 
static void vlib_node_set_runtime_data (vlib_main_t *vm, u32 node_index, void *runtime_data, u32 n_runtime_data_bytes)
 Set node runtime private data. More...
 
static void vlib_node_set_state (vlib_main_t *vm, u32 node_index, vlib_node_state_t new_state)
 Set node dispatch state. More...
 
static vlib_node_state_t vlib_node_get_state (vlib_main_t *vm, u32 node_index)
 Get node dispatch state. More...
 
static void vlib_node_set_flag (vlib_main_t *vm, u32 node_index, u16 flag, u8 enable)
 
static void vlib_node_set_interrupt_pending (vlib_main_t *vm, u32 node_index)
 
static vlib_process_tvlib_get_process_from_node (vlib_main_t *vm, vlib_node_t *node)
 
static vlib_frame_tvlib_get_frame (vlib_main_t *vm, vlib_frame_t *f)
 
static void vlib_frame_no_append (vlib_frame_t *f)
 
static u32 vlib_frame_vector_byte_offset (u32 scalar_size)
 
static void * vlib_frame_vector_args (vlib_frame_t *f)
 Get pointer to frame vector data. More...
 
static void * vlib_frame_scalar_args (vlib_frame_t *f)
 Get pointer to frame scalar data. More...
 
static vlib_next_frame_tvlib_node_runtime_get_next_frame (vlib_main_t *vm, vlib_node_runtime_t *n, u32 next_index)
 
static vlib_next_frame_tvlib_node_get_next_frame (vlib_main_t *vm, u32 node_index, u32 next_index)
 Get pointer to frame by (node_index, next_index). More...
 
vlib_frame_tvlib_get_next_frame_internal (vlib_main_t *vm, vlib_node_runtime_t *node, u32 next_index, u32 alloc_new_frame)
 
void vlib_put_next_frame (vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_packets_left)
 Release pointer to next frame vector data. More...
 
static void vlib_set_next_frame_buffer (vlib_main_t *vm, vlib_node_runtime_t *node, u32 next_index, u32 buffer_index)
 
vlib_frame_tvlib_get_frame_to_node (vlib_main_t *vm, u32 to_node_index)
 
void vlib_put_frame_to_node (vlib_main_t *vm, u32 to_node_index, vlib_frame_t *f)
 
static uword vlib_in_process_context (vlib_main_t *vm)
 
static vlib_process_tvlib_get_current_process (vlib_main_t *vm)
 
static uword vlib_current_process (vlib_main_t *vm)
 
static u32 vlib_get_current_process_node_index (vlib_main_t *vm)
 
static uword vlib_process_suspend_time_is_zero (f64 dt)
 Returns TRUE if a process suspend time is less than 10us. More...
 
static uword vlib_process_suspend (vlib_main_t *vm, f64 dt)
 Suspend a vlib cooperative multi-tasking thread for a period of time. More...
 
static void vlib_process_free_event_type (vlib_process_t *p, uword t, uword is_one_time_event)
 
static void vlib_process_maybe_free_event_type (vlib_process_t *p, uword t)
 
static void * vlib_process_get_event_data (vlib_main_t *vm, uword *return_event_type_opaque)
 
static void vlib_process_put_event_data (vlib_main_t *vm, void *event_data)
 
static uword vlib_process_get_events (vlib_main_t *vm, uword **data_vector)
 Return the first event type which has occurred and a vector of per-event data of that type, or a timeout indication. More...
 
static uword vlib_process_get_events_helper (vlib_process_t *p, uword t, uword **data_vector)
 
static uword vlib_process_get_events_with_type (vlib_main_t *vm, uword **data_vector, uword with_type_opaque)
 
static uwordvlib_process_wait_for_event (vlib_main_t *vm)
 
static uword vlib_process_wait_for_one_time_event (vlib_main_t *vm, uword **data_vector, uword with_type_index)
 
static uword vlib_process_wait_for_event_with_type (vlib_main_t *vm, uword **data_vector, uword with_type_opaque)
 
static f64 vlib_process_wait_for_event_or_clock (vlib_main_t *vm, f64 dt)
 Suspend a cooperative multi-tasking thread Waits for an event, or for the indicated number of seconds to elapse. More...
 
static vlib_process_event_type_tvlib_process_new_event_type (vlib_process_t *p, uword with_type_opaque)
 
static uword vlib_process_create_one_time_event (vlib_main_t *vm, uword node_index, uword with_type_opaque)
 
static void vlib_process_delete_one_time_event (vlib_main_t *vm, uword node_index, uword t)
 
static void * vlib_process_signal_event_helper (vlib_node_main_t *nm, vlib_node_t *n, vlib_process_t *p, uword t, uword n_data_elts, uword n_data_elt_bytes)
 
static void * vlib_process_signal_event_data (vlib_main_t *vm, uword node_index, uword type_opaque, uword n_data_elts, uword n_data_elt_bytes)
 
static void * vlib_process_signal_event_at_time (vlib_main_t *vm, f64 dt, uword node_index, uword type_opaque, uword n_data_elts, uword n_data_elt_bytes)
 
static void * vlib_process_signal_one_time_event_data (vlib_main_t *vm, uword node_index, uword type_index, uword n_data_elts, uword n_data_elt_bytes)
 
static void vlib_process_signal_event (vlib_main_t *vm, uword node_index, uword type_opaque, uword data)
 
static void vlib_process_signal_event_pointer (vlib_main_t *vm, uword node_index, uword type_opaque, void *data)
 
static void vlib_process_signal_event_mt (vlib_main_t *vm, uword node_index, uword type_opaque, uword data)
 Signal event to process from any thread. More...
 
static void vlib_process_signal_one_time_event (vlib_main_t *vm, uword node_index, uword type_index, uword data)
 
static void vlib_signal_one_time_waiting_process (vlib_main_t *vm, vlib_one_time_waiting_process_t *p)
 
static void vlib_signal_one_time_waiting_process_vector (vlib_main_t *vm, vlib_one_time_waiting_process_t **wps)
 
static void vlib_current_process_wait_for_one_time_event (vlib_main_t *vm, vlib_one_time_waiting_process_t *p)
 
static void vlib_current_process_wait_for_one_time_event_vector (vlib_main_t *vm, vlib_one_time_waiting_process_t **wps)
 
static u32 vlib_node_runtime_update_main_loop_vector_stats (vlib_main_t *vm, vlib_node_runtime_t *node, uword n_vectors)
 
static f64 vlib_node_vectors_per_main_loop_as_float (vlib_main_t *vm, u32 node_index)
 
static u32 vlib_node_vectors_per_main_loop_as_integer (vlib_main_t *vm, u32 node_index)
 
void vlib_frame_free (vlib_main_t *vm, vlib_node_runtime_t *r, vlib_frame_t *f)
 
uword vlib_node_get_next (vlib_main_t *vm, uword node, uword next_node)
 
uword vlib_node_add_next_with_slot (vlib_main_t *vm, uword node, uword next_node, uword slot)
 
static uword vlib_node_add_next (vlib_main_t *vm, uword node, uword next_node)
 
uword vlib_node_add_named_next_with_slot (vlib_main_t *vm, uword node, char *next_name, uword slot)
 
static uword vlib_node_add_named_next (vlib_main_t *vm, uword node, char *name)
 
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)
 Get list of nodes. More...
 
vlib_node_tvlib_get_node_by_name (vlib_main_t *vm, u8 *name)
 
void vlib_node_rename (vlib_main_t *vm, u32 node_index, char *fmt,...)
 
u32 vlib_register_node (vlib_main_t *vm, vlib_node_registration_t *r)
 
void vlib_register_all_node_march_variants (vlib_main_t *vm)
 
void vlib_register_all_static_nodes (vlib_main_t *vm)
 
void vlib_start_process (vlib_main_t *vm, uword process_index)
 
void vlib_node_sync_stats (vlib_main_t *vm, vlib_node_t *n)
 
void vlib_node_runtime_sync_stats (vlib_main_t *vm, vlib_node_runtime_t *r, uword n_calls, uword n_vectors, uword n_clocks)
 
void vlib_node_runtime_sync_stats_node (vlib_node_t *n, vlib_node_runtime_t *r, uword n_calls, uword n_vectors, uword n_clocks)
 
clib_error_tvlib_node_main_init (vlib_main_t *vm)
 
static void vlib_node_increment_counter (vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
 
u32 vlib_process_create (vlib_main_t *vm, char *name, vlib_node_function_t *f, u32 log2_n_stack_bytes)
 Create a vlib process. More...
 
static int vlib_node_set_dispatch_wrapper (vlib_main_t *vm, vlib_node_function_t *fn)
 
int vlib_node_set_march_variant (vlib_main_t *vm, u32 node_index, clib_march_variant_type_t march_variant)
 
vlib_node_function_tvlib_node_get_preferred_node_fn_variant (vlib_main_t *vm, vlib_node_fn_registration_t *regs)
 

Variables

format_function_t format_vlib_node_graph
 
format_function_t format_vlib_node_name
 
format_function_t format_vlib_next_node_name
 
format_function_t format_vlib_node_and_next
 
format_function_t format_vlib_cpu_time
 
format_function_t format_vlib_time
 
unformat_function_t unformat_vlib_node
 

Detailed Description

vlib node functions

Definition in file node_funcs.h.

Macro Definition Documentation

◆ VLIB_FRAME_VECTOR_ALIGN

#define VLIB_FRAME_VECTOR_ALIGN   (1 << 4)

Definition at line 287 of file node_funcs.h.

◆ vlib_get_new_next_frame

#define vlib_get_new_next_frame (   vm,
  node,
  next_index,
  vectors,
  n_vectors_left 
)
Value:
vectors, n_vectors_left, \
/* alloc new frame */ 1)

Definition at line 400 of file node_funcs.h.

◆ vlib_get_next_frame

#define vlib_get_next_frame (   vm,
  node,
  next_index,
  vectors,
  n_vectors_left 
)
Value:
vectors, n_vectors_left, \
/* alloc new frame */ 0)

Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).

Standard single/dual loop boilerplate element.

Attention
This is a MACRO, with SIDE EFFECTS.
Parameters
vmvlib_main_t pointer, varies by thread
nodecurrent node vlib_node_runtime_t pointer
next_indexrequested graph arc index
Returns
vectors – pointer to next available vector slot
n_vectors_left – number of vector slots available

Definition at line 395 of file node_funcs.h.

◆ vlib_get_next_frame_macro

#define vlib_get_next_frame_macro (   vm,
  node,
  next_index,
  vectors,
  n_vectors_left,
  alloc_new_frame 
)
Value:
do { \
vlib_frame_t * _f \
(alloc_new_frame)); \
u32 _n = _f->n_vectors; \
(vectors) = vlib_frame_vector_args (_f) + _n * sizeof ((vectors)[0]); \
(n_vectors_left) = VLIB_FRAME_SIZE - _n; \
} while (0)

Definition at line 372 of file node_funcs.h.

◆ vlib_set_next_frame

#define vlib_set_next_frame (   vm,
  node,
  next_index,
 
)
Value:
({ \
uword _n_left; \
vlib_get_next_frame ((vm), (node), (next_index), (v), _n_left); \
ASSERT (_n_left > 0); \
vlib_put_next_frame ((vm), (node), (next_index), _n_left - 1); \
(v); \
})

Definition at line 418 of file node_funcs.h.

Function Documentation

◆ vlib_current_process()

static uword vlib_current_process ( vlib_main_t vm)
inlinestatic

Definition at line 457 of file node_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_current_process_wait_for_one_time_event()

static void vlib_current_process_wait_for_one_time_event ( vlib_main_t vm,
vlib_one_time_waiting_process_t p 
)
inlinestatic

Definition at line 1091 of file node_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_current_process_wait_for_one_time_event_vector()

static void vlib_current_process_wait_for_one_time_event_vector ( vlib_main_t vm,
vlib_one_time_waiting_process_t **  wps 
)
inlinestatic

Definition at line 1104 of file node_funcs.h.

+ Here is the call graph for this function:

◆ vlib_frame_free()

void vlib_frame_free ( vlib_main_t vm,
vlib_node_runtime_t r,
vlib_frame_t f 
)

Definition at line 242 of file main.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_frame_no_append()

static void vlib_frame_no_append ( vlib_frame_t f)
inlinestatic

Definition at line 281 of file node_funcs.h.

+ Here is the caller graph for this function:

◆ vlib_frame_scalar_args()

static void* vlib_frame_scalar_args ( vlib_frame_t f)
inlinestatic

Get pointer to frame scalar data.

Parameters
fvlib_frame_t pointer
Returns
arbitrary node scalar data
See also
vlib_frame_vector_args

Definition at line 315 of file node_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_frame_vector_args()

static void* vlib_frame_vector_args ( vlib_frame_t f)
inlinestatic

Get pointer to frame vector data.

Parameters
fvlib_frame_t pointer
Returns
pointer to first vector element in frame

Definition at line 301 of file node_funcs.h.

+ Here is the call graph for this function:

◆ vlib_frame_vector_byte_offset()

static u32 vlib_frame_vector_byte_offset ( u32  scalar_size)
inlinestatic

Definition at line 290 of file node_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_get_current_process()

static vlib_process_t* vlib_get_current_process ( vlib_main_t vm)
inlinestatic

Definition at line 448 of file node_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_get_current_process_node_index()

static u32 vlib_get_current_process_node_index ( vlib_main_t vm)
inlinestatic

Definition at line 463 of file node_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_get_frame()

static vlib_frame_t* vlib_get_frame ( vlib_main_t vm,
vlib_frame_t f 
)
inlinestatic

Definition at line 273 of file node_funcs.h.

+ Here is the caller graph for this function:

◆ vlib_get_frame_to_node()

vlib_frame_t* vlib_get_frame_to_node ( vlib_main_t vm,
u32  to_node_index 
)

Definition at line 184 of file main.c.

+ Here is the call graph for this function:

◆ vlib_get_next_frame_internal()

vlib_frame_t* vlib_get_next_frame_internal ( vlib_main_t vm,
vlib_node_runtime_t node,
u32  next_index,
u32  alloc_new_frame 
)

Definition at line 384 of file main.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_get_next_node()

static vlib_node_t* vlib_get_next_node ( vlib_main_t vm,
u32  node_index,
u32  next_index 
)
inlinestatic

Get vlib node by graph arc (next) index.

Parameters
vmvlib_main_t pointer, varies by thread
node_indexindex of original node
next_indexgraph arc index
Returns
pointer to the vlib_node_t at the end of the indicated arc

Definition at line 99 of file node_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_get_node()

static vlib_node_t* vlib_get_node ( vlib_main_t vm,
u32  i 
)
inlinestatic

Get vlib node by index.

Warning
This function will ASSERT if i is out of range.
Parameters
vmvlib_main_t pointer, varies by thread
inode index.
Returns
pointer to the requested vlib_node_t.

Definition at line 86 of file node_funcs.h.

◆ vlib_get_node_by_name()

vlib_node_t* vlib_get_node_by_name ( vlib_main_t vm,
u8 name 
)

Definition at line 45 of file node.c.

◆ vlib_get_process_from_node()

static vlib_process_t* vlib_get_process_from_node ( vlib_main_t vm,
vlib_node_t node 
)
inlinestatic

Definition at line 265 of file node_funcs.h.

+ Here is the caller graph for this function:

◆ vlib_in_process_context()

static uword vlib_in_process_context ( vlib_main_t vm)
inlinestatic

Definition at line 442 of file node_funcs.h.

+ Here is the caller graph for this function:

◆ vlib_node_add_named_next()

static uword vlib_node_add_named_next ( vlib_main_t vm,
uword  node,
char *  name 
)
inlinestatic

Definition at line 1189 of file node_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_node_add_named_next_with_slot()

uword vlib_node_add_named_next_with_slot ( vlib_main_t vm,
uword  node,
char *  next_name,
uword  slot 
)

Definition at line 244 of file node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_node_add_next()

static uword vlib_node_add_next ( vlib_main_t vm,
uword  node,
uword  next_node 
)
inlinestatic

Definition at line 1177 of file node_funcs.h.

+ Here is the call graph for this function:

◆ vlib_node_add_next_with_slot()

uword vlib_node_add_next_with_slot ( vlib_main_t vm,
uword  node,
uword  next_node,
uword  slot 
)

Definition at line 173 of file node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_node_get_next()

uword vlib_node_get_next ( vlib_main_t vm,
uword  node,
uword  next_node 
)

Definition at line 152 of file node.c.

+ Here is the caller graph for this function:

◆ vlib_node_get_next_frame()

static vlib_next_frame_t* vlib_node_get_next_frame ( vlib_main_t vm,
u32  node_index,
u32  next_index 
)
inlinestatic

Get pointer to frame by (node_index, next_index).

Warning
This is not a function that you should call directly. See vlib_get_next_frame instead.
Parameters
vmvlib_main_t pointer, varies by thread
node_indexindex of the node
next_indexgraph arc index
Returns
pointer to the requested vlib_next_frame_t
See also
vlib_get_next_frame

Definition at line 356 of file node_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_node_get_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 
)

Get list of nodes.

Definition at line 603 of file node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_node_get_preferred_node_fn_variant()

vlib_node_function_t* vlib_node_get_preferred_node_fn_variant ( vlib_main_t vm,
vlib_node_fn_registration_t regs 
)

Definition at line 295 of file node.c.

+ Here is the caller graph for this function:

◆ vlib_node_get_runtime()

static vlib_node_runtime_t* vlib_node_get_runtime ( vlib_main_t vm,
u32  node_index 
)
inlinestatic

Get node runtime by node index.

Parameters
vmvlib_main_t pointer, varies by thread
node_indexindex of node
Returns
pointer to the indicated vlib_node_runtime_t

Definition at line 116 of file node_funcs.h.

◆ vlib_node_get_runtime_data()

static void* vlib_node_get_runtime_data ( vlib_main_t vm,
u32  node_index 
)
inlinestatic

Get node runtime private data by node index.

Parameters
vmvlib_main_t pointer, varies by thread
node_indexindex of the node
Returns
pointer to the indicated vlib_node_runtime_t private data

Definition at line 137 of file node_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_node_get_state()

static vlib_node_state_t vlib_node_get_state ( vlib_main_t vm,
u32  node_index 
)
inlinestatic

Get node dispatch state.

Parameters
vmvlib_main_t pointer, varies by thread
node_indexindex of the node
Returns
state for node, see vlib_node_state_t

Definition at line 219 of file node_funcs.h.

+ Here is the caller graph for this function:

◆ vlib_node_increment_counter()

static void vlib_node_increment_counter ( vlib_main_t vm,
u32  node_index,
u32  counter_index,
u64  increment 
)
inlinestatic

Definition at line 1244 of file node_funcs.h.

+ Here is the call graph for this function:

◆ vlib_node_main_init()

clib_error_t* vlib_node_main_init ( vlib_main_t vm)

Definition at line 665 of file node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_node_rename()

void vlib_node_rename ( vlib_main_t vm,
u32  node_index,
char *  fmt,
  ... 
)

Definition at line 76 of file node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_node_runtime_get_next_frame()

static vlib_next_frame_t* vlib_node_runtime_get_next_frame ( vlib_main_t vm,
vlib_node_runtime_t n,
u32  next_index 
)
inlinestatic

Definition at line 321 of file node_funcs.h.

+ Here is the caller graph for this function:

◆ vlib_node_runtime_sync_stats()

void vlib_node_runtime_sync_stats ( vlib_main_t vm,
vlib_node_runtime_t r,
uword  n_calls,
uword  n_vectors,
uword  n_clocks 
)

Definition at line 590 of file main.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_node_runtime_sync_stats_node()

void vlib_node_runtime_sync_stats_node ( vlib_node_t n,
vlib_node_runtime_t r,
uword  n_calls,
uword  n_vectors,
uword  n_clocks 
)

Definition at line 574 of file main.c.

+ Here is the caller graph for this function:

◆ vlib_node_runtime_update_main_loop_vector_stats()

static u32 vlib_node_runtime_update_main_loop_vector_stats ( vlib_main_t vm,
vlib_node_runtime_t node,
uword  n_vectors 
)
inlinestatic

Definition at line 1114 of file node_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_node_set_dispatch_wrapper()

static int vlib_node_set_dispatch_wrapper ( vlib_main_t vm,
vlib_node_function_t fn 
)
inlinestatic

Definition at line 1264 of file node_funcs.h.

+ Here is the caller graph for this function:

◆ vlib_node_set_flag()

static void vlib_node_set_flag ( vlib_main_t vm,
u32  node_index,
u16  flag,
u8  enable 
)
inlinestatic

Definition at line 228 of file node_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_node_set_interrupt_pending()

static void vlib_node_set_interrupt_pending ( vlib_main_t vm,
u32  node_index 
)
inlinestatic

Definition at line 249 of file node_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_node_set_march_variant()

int vlib_node_set_march_variant ( vlib_main_t vm,
u32  node_index,
clib_march_variant_type_t  march_variant 
)

Definition at line 823 of file node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_node_set_runtime_data()

static void vlib_node_set_runtime_data ( vlib_main_t vm,
u32  node_index,
void *  runtime_data,
u32  n_runtime_data_bytes 
)
inlinestatic

Set node runtime private data.

Parameters
vmvlib_main_t pointer, varies by thread
node_indexindex of the node
runtime_dataarbitrary runtime private data
n_runtime_data_bytessize of runtime private data

Definition at line 151 of file node_funcs.h.

+ Here is the call graph for this function:

◆ vlib_node_set_state()

static void vlib_node_set_state ( vlib_main_t vm,
u32  node_index,
vlib_node_state_t  new_state 
)
inlinestatic

Set node dispatch state.

Parameters
vmvlib_main_t pointer, varies by thread
node_indexindex of the node
new_statenew state for node, see vlib_node_state_t

Definition at line 175 of file node_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_node_sync_stats()

void vlib_node_sync_stats ( vlib_main_t vm,
vlib_node_t n 
)

Definition at line 610 of file main.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_node_vectors_per_main_loop_as_float()

static f64 vlib_node_vectors_per_main_loop_as_float ( vlib_main_t vm,
u32  node_index 
)
inlinestatic

Definition at line 1143 of file node_funcs.h.

+ Here is the call graph for this function:

◆ vlib_node_vectors_per_main_loop_as_integer()

static u32 vlib_node_vectors_per_main_loop_as_integer ( vlib_main_t vm,
u32  node_index 
)
inlinestatic

Definition at line 1154 of file node_funcs.h.

+ Here is the call graph for this function:

◆ vlib_process_create()

u32 vlib_process_create ( vlib_main_t vm,
char *  name,
vlib_node_function_t f,
u32  log2_n_stack_bytes 
)

Create a vlib process.

Parameters
vm&vlib_global_main
fthe process node function
log2_n_stack_bytessize of the process stack, defaults to 16K
Returns
newly-create node index
Warning
call only on the main thread. Barrier sync required

Definition at line 795 of file node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_process_create_one_time_event()

static uword vlib_process_create_one_time_event ( vlib_main_t vm,
uword  node_index,
uword  with_type_opaque 
)
inlinestatic

Definition at line 799 of file node_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_process_delete_one_time_event()

static void vlib_process_delete_one_time_event ( vlib_main_t vm,
uword  node_index,
uword  t 
)
inlinestatic

Definition at line 816 of file node_funcs.h.

+ Here is the call graph for this function:

◆ vlib_process_finish_switch_stack()

static_always_inline void vlib_process_finish_switch_stack ( vlib_main_t vm)

Definition at line 67 of file node_funcs.h.

+ Here is the caller graph for this function:

◆ vlib_process_free_event_type()

static void vlib_process_free_event_type ( vlib_process_t p,
uword  t,
uword  is_one_time_event 
)
inlinestatic

Definition at line 511 of file node_funcs.h.

+ Here is the caller graph for this function:

◆ vlib_process_get_event_data()

static void* vlib_process_get_event_data ( vlib_main_t vm,
uword return_event_type_opaque 
)
inlinestatic

Definition at line 530 of file node_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_process_get_events()

static uword vlib_process_get_events ( vlib_main_t vm,
uword **  data_vector 
)
inlinestatic

Return the first event type which has occurred and a vector of per-event data of that type, or a timeout indication.

Parameters
vm- vlib_main_t pointer
data_vector- pointer to a (uword *) vector to receive event data
Returns
either an event type and a vector of per-event instance data, or ~0 to indicate a timeout.

Definition at line 583 of file node_funcs.h.

+ Here is the call graph for this function:

◆ vlib_process_get_events_helper()

static uword vlib_process_get_events_helper ( vlib_process_t p,
uword  t,
uword **  data_vector 
)
inlinestatic

Definition at line 617 of file node_funcs.h.

+ Here is the caller graph for this function:

◆ vlib_process_get_events_with_type()

static uword vlib_process_get_events_with_type ( vlib_main_t vm,
uword **  data_vector,
uword  with_type_opaque 
)
inlinestatic

Definition at line 638 of file node_funcs.h.

+ Here is the call graph for this function:

◆ vlib_process_maybe_free_event_type()

static void vlib_process_maybe_free_event_type ( vlib_process_t p,
uword  t 
)
inlinestatic

Definition at line 522 of file node_funcs.h.

+ Here is the call graph for this function:

◆ vlib_process_new_event_type()

static vlib_process_event_type_t* vlib_process_new_event_type ( vlib_process_t p,
uword  with_type_opaque 
)
inlinestatic

Definition at line 790 of file node_funcs.h.

+ Here is the caller graph for this function:

◆ vlib_process_put_event_data()

static void vlib_process_put_event_data ( vlib_main_t vm,
void *  event_data 
)
inlinestatic

Definition at line 567 of file node_funcs.h.

+ Here is the caller graph for this function:

◆ vlib_process_signal_event()

static void vlib_process_signal_event ( vlib_main_t vm,
uword  node_index,
uword  type_opaque,
uword  data 
)
inlinestatic

Definition at line 1019 of file node_funcs.h.

+ Here is the call graph for this function:

◆ vlib_process_signal_event_at_time()

static void* vlib_process_signal_event_at_time ( vlib_main_t vm,
f64  dt,
uword  node_index,
uword  type_opaque,
uword  n_data_elts,
uword  n_data_elt_bytes 
)
inlinestatic

Definition at line 942 of file node_funcs.h.

+ Here is the call graph for this function:

◆ vlib_process_signal_event_data()

static void* vlib_process_signal_event_data ( vlib_main_t vm,
uword  node_index,
uword  type_opaque,
uword  n_data_elts,
uword  n_data_elt_bytes 
)
inlinestatic

Definition at line 913 of file node_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_process_signal_event_helper()

static void* vlib_process_signal_event_helper ( vlib_node_main_t nm,
vlib_node_t n,
vlib_process_t p,
uword  t,
uword  n_data_elts,
uword  n_data_elt_bytes 
)
inlinestatic

Definition at line 828 of file node_funcs.h.

+ Here is the caller graph for this function:

◆ vlib_process_signal_event_mt()

static void vlib_process_signal_event_mt ( vlib_main_t vm,
uword  node_index,
uword  type_opaque,
uword  data 
)
inlinestatic

Signal event to process from any thread.

When in doubt, use this.

Definition at line 1043 of file node_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_process_signal_event_pointer()

static void vlib_process_signal_event_pointer ( vlib_main_t vm,
uword  node_index,
uword  type_opaque,
void *  data 
)
inlinestatic

Definition at line 1028 of file node_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_process_signal_one_time_event()

static void vlib_process_signal_one_time_event ( vlib_main_t vm,
uword  node_index,
uword  type_index,
uword  data 
)
inlinestatic

Definition at line 1061 of file node_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_process_signal_one_time_event_data()

static void* vlib_process_signal_one_time_event_data ( vlib_main_t vm,
uword  node_index,
uword  type_index,
uword  n_data_elts,
uword  n_data_elt_bytes 
)
inlinestatic

Definition at line 1005 of file node_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_process_start_switch_stack()

static_always_inline void vlib_process_start_switch_stack ( vlib_main_t vm,
vlib_process_t p 
)

Definition at line 57 of file node_funcs.h.

+ Here is the caller graph for this function:

◆ vlib_process_suspend()

static uword vlib_process_suspend ( vlib_main_t vm,
f64  dt 
)
inlinestatic

Suspend a vlib cooperative multi-tasking thread for a period of time.

Parameters
vm- vlib_main_t *
dt- suspend interval in seconds
Returns
VLIB_PROCESS_RESUME_LONGJMP_RESUME, routinely ignored

Definition at line 486 of file node_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_process_suspend_time_is_zero()

static uword vlib_process_suspend_time_is_zero ( f64  dt)
inlinestatic

Returns TRUE if a process suspend time is less than 10us.

Parameters
dt- remaining poll time in seconds
Returns
1 if dt < 10e-6, 0 otherwise

Definition at line 474 of file node_funcs.h.

+ Here is the caller graph for this function:

◆ vlib_process_wait_for_event()

static uword* vlib_process_wait_for_event ( vlib_main_t vm)
inlinestatic

Definition at line 660 of file node_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_process_wait_for_event_or_clock()

static f64 vlib_process_wait_for_event_or_clock ( vlib_main_t vm,
f64  dt 
)
inlinestatic

Suspend a cooperative multi-tasking thread Waits for an event, or for the indicated number of seconds to elapse.

Parameters
vm- vlib_main_t pointer
dt- timeout, in seconds.
Returns
the remaining time interval

Definition at line 755 of file node_funcs.h.

+ Here is the call graph for this function:

◆ vlib_process_wait_for_event_with_type()

static uword vlib_process_wait_for_event_with_type ( vlib_main_t vm,
uword **  data_vector,
uword  with_type_opaque 
)
inlinestatic

Definition at line 715 of file node_funcs.h.

+ Here is the call graph for this function:

◆ vlib_process_wait_for_one_time_event()

static uword vlib_process_wait_for_one_time_event ( vlib_main_t vm,
uword **  data_vector,
uword  with_type_index 
)
inlinestatic

Definition at line 686 of file node_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_put_frame_to_node()

void vlib_put_frame_to_node ( vlib_main_t vm,
u32  to_node_index,
vlib_frame_t f 
)

Definition at line 218 of file main.c.

+ Here is the call graph for this function:

◆ vlib_put_next_frame()

void vlib_put_next_frame ( vlib_main_t vm,
vlib_node_runtime_t r,
u32  next_index,
u32  n_packets_left 
)

Release pointer to next frame vector data.

Standard single/dual loop boilerplate element.

Parameters
vmvlib_main_t pointer, varies by thread
rcurrent node vlib_node_runtime_t pointer
next_indexgraph arc index
n_packets_leftnumber of slots still available in vector

Definition at line 488 of file main.c.

+ Here is the call graph for this function:

◆ vlib_register_all_node_march_variants()

void vlib_register_all_node_march_variants ( vlib_main_t vm)

Definition at line 539 of file node.c.

+ Here is the caller graph for this function:

◆ vlib_register_all_static_nodes()

void vlib_register_all_static_nodes ( vlib_main_t vm)

Definition at line 573 of file node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_register_node()

u32 vlib_register_node ( vlib_main_t vm,
vlib_node_registration_t r 
)

Definition at line 519 of file node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_set_next_frame_buffer()

static void vlib_set_next_frame_buffer ( vlib_main_t vm,
vlib_node_runtime_t node,
u32  next_index,
u32  buffer_index 
)
inlinestatic

Definition at line 428 of file node_funcs.h.

+ Here is the caller graph for this function:

◆ vlib_signal_one_time_waiting_process()

static void vlib_signal_one_time_waiting_process ( vlib_main_t vm,
vlib_one_time_waiting_process_t p 
)
inlinestatic

Definition at line 1072 of file node_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_signal_one_time_waiting_process_vector()

static void vlib_signal_one_time_waiting_process_vector ( vlib_main_t vm,
vlib_one_time_waiting_process_t **  wps 
)
inlinestatic

Definition at line 1081 of file node_funcs.h.

+ Here is the call graph for this function:

◆ vlib_start_process()

void vlib_start_process ( vlib_main_t vm,
uword  process_index 
)

Definition at line 1416 of file main.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ format_vlib_cpu_time

format_function_t format_vlib_cpu_time

Definition at line 1238 of file node_funcs.h.

◆ format_vlib_next_node_name

format_function_t format_vlib_next_node_name

Definition at line 1236 of file node_funcs.h.

◆ format_vlib_node_and_next

format_function_t format_vlib_node_and_next

Definition at line 1237 of file node_funcs.h.

◆ format_vlib_node_graph

format_function_t format_vlib_node_graph

Definition at line 1234 of file node_funcs.h.

◆ format_vlib_node_name

format_function_t format_vlib_node_name

Definition at line 1235 of file node_funcs.h.

◆ format_vlib_time

format_function_t format_vlib_time

Definition at line 1239 of file node_funcs.h.

◆ unformat_vlib_node

unformat_function_t unformat_vlib_node

Definition at line 1241 of file node_funcs.h.

vlib_get_next_frame_macro
#define vlib_get_next_frame_macro(vm, node, next_index, vectors, n_vectors_left, alloc_new_frame)
Definition: node_funcs.h:372
next_index
nat44_ei_hairpin_src_next_t next_index
Definition: nat44_ei_hairpinning.c:412
vlib_get_next_frame_internal
vlib_frame_t * vlib_get_next_frame_internal(vlib_main_t *vm, vlib_node_runtime_t *node, u32 next_index, u32 alloc_new_frame)
Definition: main.c:384
VLIB_FRAME_SIZE
#define VLIB_FRAME_SIZE
Definition: node.h:368
node
vlib_main_t vlib_node_runtime_t * node
Definition: nat44_ei.c:3047
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
vlib_frame_vector_args
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
Definition: node_funcs.h:301