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

Go to the source code of this file.

Data Structures

struct  vlib_node_stats_t
 
struct  vlib_node_t
 
struct  vlib_frame_t
 
struct  vlib_next_frame_t
 
struct  vlib_pending_frame_t
 
struct  vlib_node_runtime_t
 
struct  vlib_frame_size_t
 
struct  vlib_process_event_type_t
 
struct  vlib_process_t
 
struct  vlib_one_time_waiting_process_t
 
struct  vlib_signal_timed_event_data_t
 
struct  vlib_node_fn_variant_t
 
struct  vlib_node_main_t
 
struct  frame_queue_trace_t
 
struct  frame_queue_nelt_counter_t
 

Macros

#define VLIB_REGISTER_NODE(x, ...)
 
#define CLIB_MARCH_VARIANT_STR   "default"
 
#define VLIB_NODE_FN(node)
 
#define foreach_vlib_node_state
 
#define VLIB_NODE_FLAG_FRAME_NO_FREE_AFTER_DISPATCH   (1 << 0)
 
#define VLIB_NODE_FLAG_IS_OUTPUT   (1 << 1)
 
#define VLIB_NODE_FLAG_IS_DROP   (1 << 2)
 
#define VLIB_NODE_FLAG_IS_PUNT   (1 << 3)
 
#define VLIB_NODE_FLAG_IS_HANDOFF   (1 << 4)
 
#define VLIB_NODE_FLAG_TRACE   (1 << 5)
 
#define VLIB_NODE_FLAG_SWITCH_FROM_INTERRUPT_TO_POLLING_MODE   (1 << 6)
 
#define VLIB_NODE_FLAG_SWITCH_FROM_POLLING_TO_INTERRUPT_MODE   (1 << 7)
 
#define VLIB_NODE_FLAG_TRACE_SUPPORTED   (1 << 8)
 
#define VLIB_NODE_FLAG_ADAPTIVE_MODE   (1 << 9)
 
#define VLIB_INVALID_NODE_INDEX   ((u32) ~0)
 
#define VLIB_FRAME_SIZE   256
 
#define VLIB_FRAME_ALIGN   CLIB_CACHE_LINE_BYTES
 
#define VLIB_FRAME_NO_FREE_AFTER_DISPATCH   VLIB_NODE_FLAG_FRAME_NO_FREE_AFTER_DISPATCH
 
#define VLIB_FRAME_NO_APPEND   (1 << 14)
 
#define VLIB_FRAME_OWNER   (1 << 15)
 
#define VLIB_FRAME_IS_ALLOCATED   VLIB_NODE_FLAG_IS_OUTPUT
 
#define VLIB_FRAME_PENDING   VLIB_NODE_FLAG_IS_DROP
 
#define VLIB_FRAME_FREE_AFTER_DISPATCH   VLIB_NODE_FLAG_IS_PUNT
 
#define VLIB_FRAME_TRACE   VLIB_NODE_FLAG_TRACE
 
#define VLIB_PENDING_FRAME_NO_NEXT_FRAME   ((u32) ~0)
 
#define VLIB_NODE_RUNTIME_DATA_SIZE   (sizeof (vlib_node_runtime_t) - STRUCT_OFFSET_OF (vlib_node_runtime_t, runtime_data))
 
#define VLIB_PROCESS_RETURN_LONGJMP_RETURN   ((uword) ~0 - 0)
 
#define VLIB_PROCESS_RETURN_LONGJMP_SUSPEND   ((uword) ~0 - 1)
 
#define VLIB_PROCESS_RESUME_LONGJMP_SUSPEND   0
 
#define VLIB_PROCESS_RESUME_LONGJMP_RESUME   1
 
#define VLIB_PROCESS_IS_SUSPENDED_WAITING_FOR_CLOCK   (1 << 0)
 
#define VLIB_PROCESS_IS_SUSPENDED_WAITING_FOR_EVENT   (1 << 1)
 
#define VLIB_PROCESS_RESUME_PENDING   (1 << 2)
 
#define VLIB_PROCESS_IS_RUNNING   (1 << 3)
 
#define VLIB_PROCESS_STACK_MAGIC   (0xdead7ead)
 
#define VLIB_NODE_MAIN_RUNTIME_STARTED   (1 << 0)
 
#define FRAME_QUEUE_MAX_NELTS   64
 

Typedefs

typedef uword() vlib_node_function_t(struct vlib_main_t *vm, struct vlib_node_runtime_t *node, struct vlib_frame_t *frame)
 
typedef struct _vlib_node_fn_registration vlib_node_fn_registration_t
 
typedef struct _vlib_node_registration vlib_node_registration_t
 
typedef struct vlib_node_t vlib_node_t
 
typedef struct vlib_frame_t vlib_frame_t
 
typedef struct vlib_node_runtime_t vlib_node_runtime_t
 
typedef u16 vlib_error_t
 

Enumerations

enum  vlib_node_proto_hint_t {
  VLIB_NODE_PROTO_HINT_NONE = 0, VLIB_NODE_PROTO_HINT_ETHERNET, VLIB_NODE_PROTO_HINT_IP4, VLIB_NODE_PROTO_HINT_IP6,
  VLIB_NODE_PROTO_HINT_TCP, VLIB_NODE_PROTO_HINT_UDP, VLIB_NODE_N_PROTO_HINTS
}
 
enum  vlib_node_type_t {
  VLIB_NODE_TYPE_INTERNAL, VLIB_NODE_TYPE_INPUT, VLIB_NODE_TYPE_PRE_INPUT, VLIB_NODE_TYPE_PROCESS,
  VLIB_N_NODE_TYPE
}
 
enum  vlib_node_state_t { VLIB_N_NODE_STATE }
 

Functions

static void vlib_next_frame_init (vlib_next_frame_t *nf)
 
static uword vlib_timing_wheel_data_is_timed_event (u32 d)
 
static u32 vlib_timing_wheel_data_set_suspended_process (u32 i)
 
static u32 vlib_timing_wheel_data_set_timed_event (u32 i)
 
static uword vlib_timing_wheel_data_get_index (u32 d)
 
static u32 vlib_error_get_node (vlib_node_main_t *nm, vlib_error_t e)
 
static u32 vlib_error_get_code (vlib_node_main_t *nm, vlib_error_t e)
 

Variables

unformat_function_t unformat_vlib_node_variant
 

Macro Definition Documentation

◆ CLIB_MARCH_VARIANT_STR

#define CLIB_MARCH_VARIANT_STR   "default"

Definition at line 195 of file node.h.

◆ foreach_vlib_node_state

#define foreach_vlib_node_state
Value:
/* Input node is called each iteration of main loop. \
This is the default (zero). */ \
_ (POLLING) \
/* Input node is called when device signals an interrupt. */ \
_ (INTERRUPT) \
/* Input node is never called. */ \
_ (DISABLED)

Definition at line 231 of file node.h.

◆ FRAME_QUEUE_MAX_NELTS

#define FRAME_QUEUE_MAX_NELTS   64

Definition at line 762 of file node.h.

◆ VLIB_FRAME_ALIGN

#define VLIB_FRAME_ALIGN   CLIB_CACHE_LINE_BYTES

Definition at line 369 of file node.h.

◆ VLIB_FRAME_FREE_AFTER_DISPATCH

#define VLIB_FRAME_FREE_AFTER_DISPATCH   VLIB_NODE_FLAG_IS_PUNT

Definition at line 422 of file node.h.

◆ VLIB_FRAME_IS_ALLOCATED

#define VLIB_FRAME_IS_ALLOCATED   VLIB_NODE_FLAG_IS_OUTPUT

Definition at line 416 of file node.h.

◆ VLIB_FRAME_NO_APPEND

#define VLIB_FRAME_NO_APPEND   (1 << 14)

Definition at line 409 of file node.h.

◆ VLIB_FRAME_NO_FREE_AFTER_DISPATCH

#define VLIB_FRAME_NO_FREE_AFTER_DISPATCH   VLIB_NODE_FLAG_FRAME_NO_FREE_AFTER_DISPATCH

Definition at line 405 of file node.h.

◆ VLIB_FRAME_OWNER

#define VLIB_FRAME_OWNER   (1 << 15)

Definition at line 413 of file node.h.

◆ VLIB_FRAME_PENDING

#define VLIB_FRAME_PENDING   VLIB_NODE_FLAG_IS_DROP

Definition at line 419 of file node.h.

◆ VLIB_FRAME_SIZE

#define VLIB_FRAME_SIZE   256

Definition at line 368 of file node.h.

◆ VLIB_FRAME_TRACE

#define VLIB_FRAME_TRACE   VLIB_NODE_FLAG_TRACE

Definition at line 425 of file node.h.

◆ VLIB_INVALID_NODE_INDEX

#define VLIB_INVALID_NODE_INDEX   ((u32) ~0)

Definition at line 365 of file node.h.

◆ VLIB_NODE_FLAG_ADAPTIVE_MODE

#define VLIB_NODE_FLAG_ADAPTIVE_MODE   (1 << 9)

Definition at line 296 of file node.h.

◆ VLIB_NODE_FLAG_FRAME_NO_FREE_AFTER_DISPATCH

#define VLIB_NODE_FLAG_FRAME_NO_FREE_AFTER_DISPATCH   (1 << 0)

Definition at line 282 of file node.h.

◆ VLIB_NODE_FLAG_IS_DROP

#define VLIB_NODE_FLAG_IS_DROP   (1 << 2)

Definition at line 286 of file node.h.

◆ VLIB_NODE_FLAG_IS_HANDOFF

#define VLIB_NODE_FLAG_IS_HANDOFF   (1 << 4)

Definition at line 288 of file node.h.

◆ VLIB_NODE_FLAG_IS_OUTPUT

#define VLIB_NODE_FLAG_IS_OUTPUT   (1 << 1)

Definition at line 285 of file node.h.

◆ VLIB_NODE_FLAG_IS_PUNT

#define VLIB_NODE_FLAG_IS_PUNT   (1 << 3)

Definition at line 287 of file node.h.

◆ VLIB_NODE_FLAG_SWITCH_FROM_INTERRUPT_TO_POLLING_MODE

#define VLIB_NODE_FLAG_SWITCH_FROM_INTERRUPT_TO_POLLING_MODE   (1 << 6)

Definition at line 293 of file node.h.

◆ VLIB_NODE_FLAG_SWITCH_FROM_POLLING_TO_INTERRUPT_MODE

#define VLIB_NODE_FLAG_SWITCH_FROM_POLLING_TO_INTERRUPT_MODE   (1 << 7)

Definition at line 294 of file node.h.

◆ VLIB_NODE_FLAG_TRACE

#define VLIB_NODE_FLAG_TRACE   (1 << 5)

Definition at line 291 of file node.h.

◆ VLIB_NODE_FLAG_TRACE_SUPPORTED

#define VLIB_NODE_FLAG_TRACE_SUPPORTED   (1 << 8)

Definition at line 295 of file node.h.

◆ VLIB_NODE_FN

#define VLIB_NODE_FN (   node)
Value:
uword CLIB_MARCH_SFX (node##_fn) (); \
node##_fn_registration) = { \
.function = &CLIB_MARCH_SFX (node##_fn), \
}; \
\
static void __clib_constructor CLIB_MARCH_SFX (node##_multiarch_register) ( \
void) \
{ \
vlib_node_fn_registration_t *r; \
r = &CLIB_MARCH_SFX (node##_fn_registration); \
r->march_variant = CLIB_MARCH_SFX (CLIB_MARCH_VARIANT_TYPE); \
r->next_registration = node.node_fn_registrations; \
node.node_fn_registrations = r; \
} \
uword CLIB_MARCH_SFX (node##_fn)

Definition at line 202 of file node.h.

◆ VLIB_NODE_MAIN_RUNTIME_STARTED

#define VLIB_NODE_MAIN_RUNTIME_STARTED   (1 << 0)

Definition at line 674 of file node.h.

◆ VLIB_NODE_RUNTIME_DATA_SIZE

#define VLIB_NODE_RUNTIME_DATA_SIZE   (sizeof (vlib_node_runtime_t) - STRUCT_OFFSET_OF (vlib_node_runtime_t, runtime_data))

Definition at line 516 of file node.h.

◆ VLIB_PENDING_FRAME_NO_NEXT_FRAME

#define VLIB_PENDING_FRAME_NO_NEXT_FRAME   ((u32) ~0)

Definition at line 451 of file node.h.

◆ VLIB_PROCESS_IS_RUNNING

#define VLIB_PROCESS_IS_RUNNING   (1 << 3)

Definition at line 557 of file node.h.

◆ VLIB_PROCESS_IS_SUSPENDED_WAITING_FOR_CLOCK

#define VLIB_PROCESS_IS_SUSPENDED_WAITING_FOR_CLOCK   (1 << 0)

Definition at line 551 of file node.h.

◆ VLIB_PROCESS_IS_SUSPENDED_WAITING_FOR_EVENT

#define VLIB_PROCESS_IS_SUSPENDED_WAITING_FOR_EVENT   (1 << 1)

Definition at line 552 of file node.h.

◆ VLIB_PROCESS_RESUME_LONGJMP_RESUME

#define VLIB_PROCESS_RESUME_LONGJMP_RESUME   1

Definition at line 548 of file node.h.

◆ VLIB_PROCESS_RESUME_LONGJMP_SUSPEND

#define VLIB_PROCESS_RESUME_LONGJMP_SUSPEND   0

Definition at line 547 of file node.h.

◆ VLIB_PROCESS_RESUME_PENDING

#define VLIB_PROCESS_RESUME_PENDING   (1 << 2)

Definition at line 554 of file node.h.

◆ VLIB_PROCESS_RETURN_LONGJMP_RETURN

#define VLIB_PROCESS_RETURN_LONGJMP_RETURN   ((uword) ~0 - 0)

Definition at line 542 of file node.h.

◆ VLIB_PROCESS_RETURN_LONGJMP_SUSPEND

#define VLIB_PROCESS_RETURN_LONGJMP_SUSPEND   ((uword) ~0 - 1)

Definition at line 543 of file node.h.

◆ VLIB_PROCESS_STACK_MAGIC

#define VLIB_PROCESS_STACK_MAGIC   (0xdead7ead)

Definition at line 598 of file node.h.

◆ VLIB_REGISTER_NODE

#define VLIB_REGISTER_NODE (   x,
  ... 
)
Value:
__VA_ARGS__ vlib_node_registration_t x; \
static void __vlib_add_node_registration_##x (void) \
__attribute__ ((__constructor__)); \
static void __vlib_add_node_registration_##x (void) \
{ \
vlib_global_main_t *vgm = vlib_get_global_main (); \
x.next_registration = vgm->node_registrations; \
vgm->node_registrations = &x; \
} \
static void __vlib_rm_node_registration_##x (void) \
__attribute__ ((__destructor__)); \
static void __vlib_rm_node_registration_##x (void) \
{ \
vlib_global_main_t *vgm = vlib_get_global_main (); \
VLIB_REMOVE_FROM_LINKED_LIST (vgm->node_registrations, &x, \
next_registration); \
} \

Definition at line 169 of file node.h.

Typedef Documentation

◆ vlib_error_t

typedef u16 vlib_error_t

Definition at line 745 of file node.h.

◆ vlib_frame_t

typedef struct vlib_frame_t vlib_frame_t

◆ vlib_node_fn_registration_t

typedef struct _vlib_node_fn_registration vlib_node_fn_registration_t

◆ vlib_node_function_t

typedef uword() vlib_node_function_t(struct vlib_main_t *vm, struct vlib_node_runtime_t *node, struct vlib_frame_t *frame)

Definition at line 54 of file node.h.

◆ vlib_node_registration_t

typedef struct _vlib_node_registration vlib_node_registration_t

◆ vlib_node_runtime_t

◆ vlib_node_t

typedef struct vlib_node_t vlib_node_t

Enumeration Type Documentation

◆ vlib_node_proto_hint_t

Enumerator
VLIB_NODE_PROTO_HINT_NONE 
VLIB_NODE_PROTO_HINT_ETHERNET 
VLIB_NODE_PROTO_HINT_IP4 
VLIB_NODE_PROTO_HINT_IP6 
VLIB_NODE_PROTO_HINT_TCP 
VLIB_NODE_PROTO_HINT_UDP 
VLIB_NODE_N_PROTO_HINTS 

Definition at line 58 of file node.h.

◆ vlib_node_state_t

Enumerator
VLIB_N_NODE_STATE 

Definition at line 239 of file node.h.

◆ vlib_node_type_t

Enumerator
VLIB_NODE_TYPE_INTERNAL 
VLIB_NODE_TYPE_INPUT 
VLIB_NODE_TYPE_PRE_INPUT 
VLIB_NODE_TYPE_PROCESS 
VLIB_N_NODE_TYPE 

Definition at line 69 of file node.h.

Function Documentation

◆ vlib_error_get_code()

static u32 vlib_error_get_code ( vlib_node_main_t nm,
vlib_error_t  e 
)
inlinestatic

Definition at line 754 of file node.h.

+ Here is the caller graph for this function:

◆ vlib_error_get_node()

static u32 vlib_error_get_node ( vlib_node_main_t nm,
vlib_error_t  e 
)
inlinestatic

Definition at line 748 of file node.h.

+ Here is the caller graph for this function:

◆ vlib_next_frame_init()

static void vlib_next_frame_init ( vlib_next_frame_t nf)
inlinestatic

Definition at line 432 of file node.h.

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

◆ vlib_timing_wheel_data_get_index()

static uword vlib_timing_wheel_data_get_index ( u32  d)
inlinestatic

Definition at line 652 of file node.h.

◆ vlib_timing_wheel_data_is_timed_event()

static uword vlib_timing_wheel_data_is_timed_event ( u32  d)
inlinestatic

Definition at line 634 of file node.h.

◆ vlib_timing_wheel_data_set_suspended_process()

static u32 vlib_timing_wheel_data_set_suspended_process ( u32  i)
inlinestatic

Definition at line 640 of file node.h.

+ Here is the caller graph for this function:

◆ vlib_timing_wheel_data_set_timed_event()

static u32 vlib_timing_wheel_data_set_timed_event ( u32  i)
inlinestatic

Definition at line 646 of file node.h.

+ Here is the caller graph for this function:

Variable Documentation

◆ unformat_vlib_node_variant

unformat_function_t unformat_vlib_node_variant

Definition at line 221 of file node.h.

vlib_node_fn_registration_t
struct _vlib_node_fn_registration vlib_node_fn_registration_t
CLIB_MARCH_SFX
#define CLIB_MARCH_SFX
Definition: cpu.h:56
node
vlib_main_t vlib_node_runtime_t * node
Definition: nat44_ei.c:3047
CLIB_MARCH_VARIANT_TYPE
@ CLIB_MARCH_VARIANT_TYPE
Definition: cpu.h:41
r
vnet_hw_if_output_node_runtime_t * r
Definition: interface_output.c:1071
vlib_get_global_main
static vlib_global_main_t * vlib_get_global_main(void)
Definition: global_funcs.h:50
uword
u64 uword
Definition: types.h:112
vlib_node_registration_t
struct _vlib_node_registration vlib_node_registration_t