FD.io VPP
v18.01-8-g0eacf49
Vector Packet Processing
|
Go to the source code of this file.
Data Structures | |
struct | fib_node_ptr_t_ |
A representation of one pointer to another node. More... | |
struct | fib_node_back_walk_ctx_t_ |
Context passed between object during a back walk. More... | |
struct | fib_node_vft_t_ |
A FIB graph nodes virtual function table. More... | |
struct | fib_node_t_ |
An node in the FIB graph. More... | |
Macros | |
#define | FIB_NODE_TYPE_MAX (FIB_NODE_TYPE_LAST + 1) |
#define | FIB_NODE_TYPES |
#define | FIB_NODE_BW_REASONS |
#define | FOR_EACH_FIB_NODE_BW_REASON(_item) |
#define | FIB_NODE_GRAPH_MAX_DEPTH ((u32)32) |
We consider a depth of 32 to be sufficient to cover all sane network topologies. More... | |
Typedefs | |
typedef enum fib_node_type_t_ | fib_node_type_t |
The types of nodes in a FIB graph. More... | |
typedef enum fib_node_back_walk_reason_t_ | fib_node_back_walk_reason_t |
Reasons for backwalking the FIB object graph. More... | |
typedef enum fib_node_bw_reason_flag_t_ | fib_node_bw_reason_flag_t |
Flags enum constructed from the reaons. More... | |
typedef enum fib_node_bw_flags_t_ | fib_node_bw_flags_t |
Flags on the walk. More... | |
typedef struct fib_node_ptr_t_ | fib_node_ptr_t |
A representation of one pointer to another node. More... | |
typedef u32 | fib_node_list_t |
A list of FIB nodes. More... | |
typedef struct fib_node_back_walk_ctx_t_ | fib_node_back_walk_ctx_t |
Context passed between object during a back walk. More... | |
typedef int(* | fib_node_ptr_walk_t) (fib_node_ptr_t *depend, void *ctx) |
A callback function for walking a node dependency list. More... | |
typedef fib_node_ptr_t | fib_node_ptr_list_t |
A list of dependent nodes. More... | |
typedef enum fib_node_back_walk_rc_t_ | fib_node_back_walk_rc_t |
Return code from a back walk function. More... | |
typedef fib_node_back_walk_rc_t(* | fib_node_back_walk_t) (struct fib_node_t_ *node, fib_node_back_walk_ctx_t *ctx) |
Function definition to backwalk a FIB node. More... | |
typedef struct fib_node_t_ *(* | fib_node_get_t) (fib_node_index_t index) |
Function definition to get a FIB node from its index. More... | |
typedef void(* | fib_node_last_lock_gone_t) (struct fib_node_t_ *node) |
Function definition to inform the FIB node that its last lock has gone. More... | |
typedef void(* | fib_node_memory_show_t) (void) |
Function definition to display the amount of memory used by a type. More... | |
typedef struct fib_node_vft_t_ | fib_node_vft_t |
A FIB graph nodes virtual function table. More... | |
typedef struct fib_node_t_ | fib_node_t |
An node in the FIB graph. More... | |
#define FIB_NODE_BW_REASONS |
Definition at line 125 of file fib_node.h.
#define FIB_NODE_GRAPH_MAX_DEPTH ((u32)32) |
We consider a depth of 32 to be sufficient to cover all sane network topologies.
Anything more is then an indication that there is a loop/cycle in the FIB graph. Note that all object types contribute to 1 to the depth.
Definition at line 225 of file fib_node.h.
#define FIB_NODE_TYPE_MAX (FIB_NODE_TYPE_LAST + 1) |
Definition at line 57 of file fib_node.h.
#define FIB_NODE_TYPES |
Definition at line 59 of file fib_node.h.
#define FOR_EACH_FIB_NODE_BW_REASON | ( | _item | ) |
Definition at line 135 of file fib_node.h.
typedef struct fib_node_back_walk_ctx_t_ fib_node_back_walk_ctx_t |
Context passed between object during a back walk.
typedef enum fib_node_back_walk_rc_t_ fib_node_back_walk_rc_t |
Return code from a back walk function.
typedef enum fib_node_back_walk_reason_t_ fib_node_back_walk_reason_t |
Reasons for backwalking the FIB object graph.
typedef fib_node_back_walk_rc_t(* fib_node_back_walk_t) (struct fib_node_t_ *node, fib_node_back_walk_ctx_t *ctx) |
Function definition to backwalk a FIB node.
Definition at line 250 of file fib_node.h.
typedef enum fib_node_bw_flags_t_ fib_node_bw_flags_t |
Flags on the walk.
typedef enum fib_node_bw_reason_flag_t_ fib_node_bw_reason_flag_t |
Flags enum constructed from the reaons.
typedef struct fib_node_t_*(* fib_node_get_t) (fib_node_index_t index) |
Function definition to get a FIB node from its index.
Definition at line 257 of file fib_node.h.
typedef void(* fib_node_last_lock_gone_t) (struct fib_node_t_ *node) |
Function definition to inform the FIB node that its last lock has gone.
Definition at line 262 of file fib_node.h.
typedef u32 fib_node_list_t |
A list of FIB nodes.
Definition at line 194 of file fib_node.h.
typedef void(* fib_node_memory_show_t) (void) |
Function definition to display the amount of memory used by a type.
Implementations should call fib_show_memory_usage()
Definition at line 268 of file fib_node.h.
typedef fib_node_ptr_t fib_node_ptr_list_t |
A list of dependent nodes.
This is currently implemented as a hash_table of fib_node_ptr_t
Definition at line 237 of file fib_node.h.
typedef struct fib_node_ptr_t_ fib_node_ptr_t |
A representation of one pointer to another node.
To fully qualify a node, one must know its type and its index so it can be retrieved from the appropriate pool. Direct pointers to nodes are forbidden, since all nodes are allocated from pools, which are vectors, and thus subject to realloc at any time.
typedef int(* fib_node_ptr_walk_t) (fib_node_ptr_t *depend, void *ctx) |
A callback function for walking a node dependency list.
Definition at line 230 of file fib_node.h.
typedef struct fib_node_t_ fib_node_t |
An node in the FIB graph.
Objects in the FIB form a graph.
typedef enum fib_node_type_t_ fib_node_type_t |
The types of nodes in a FIB graph.
typedef struct fib_node_vft_t_ fib_node_vft_t |
A FIB graph nodes virtual function table.
Return code from a back walk function.
Enumerator | |
---|---|
FIB_NODE_BACK_WALK_MERGE | |
FIB_NODE_BACK_WALK_CONTINUE |
Definition at line 242 of file fib_node.h.
Reasons for backwalking the FIB object graph.
Definition at line 82 of file fib_node.h.
enum fib_node_bw_flags_t_ |
Flags on the walk.
Enumerator | |
---|---|
FIB_NODE_BW_FLAG_FORCE_SYNC |
Force the walk to be synchronous. |
Definition at line 160 of file fib_node.h.
Flags enum constructed from the reaons.
Definition at line 143 of file fib_node.h.
enum fib_node_type_t_ |
The types of nodes in a FIB graph.
Definition at line 24 of file fib_node.h.
fib_node_back_walk_rc_t fib_node_back_walk_one | ( | fib_node_ptr_t * | ptr, |
fib_node_back_walk_ctx_t * | ctx | ||
) |
u32 fib_node_child_add | ( | fib_node_type_t | parent_type, |
fib_node_index_t | parent_index, | ||
fib_node_type_t | child_type, | ||
fib_node_index_t | child_index | ||
) |
Definition at line 98 of file fib_node.c.
void fib_node_child_remove | ( | fib_node_type_t | parent_type, |
fib_node_index_t | parent_index, | ||
fib_node_index_t | sibling_index | ||
) |
Definition at line 123 of file fib_node.c.
u8* fib_node_children_format | ( | fib_node_list_t | list, |
u8 * | s | ||
) |
Definition at line 176 of file fib_node.c.
void fib_node_deinit | ( | fib_node_t * | node | ) |
Definition at line 197 of file fib_node.c.
u32 fib_node_get_n_children | ( | fib_node_type_t | parent_type, |
fib_node_index_t | parent_index | ||
) |
Definition at line 142 of file fib_node.c.
|
inlinestatic |
Definition at line 383 of file fib_node.h.
void fib_node_init | ( | fib_node_t * | node, |
fib_node_type_t | ft | ||
) |
The node's type. used to retrieve the VFT.
Definition at line 185 of file fib_node.c.
void fib_node_lock | ( | fib_node_t * | node | ) |
fib_node_type_t fib_node_register_new_type | ( | const fib_node_vft_t * | vft | ) |
Create a new FIB node type and Register the function table for it.
vft | virtual function table |
Definition at line 80 of file fib_node.c.
void fib_node_register_type | ( | fib_node_type_t | type, |
const fib_node_vft_t * | vft | ||
) |
Register the function table for a given type.
ft | FIB node type |
vft | virtual function table |
Register the function table for a given type.
Register the function table for a given type
Definition at line 60 of file fib_node.c.
const char* fib_node_type_get_name | ( | fib_node_type_t | type | ) |
void fib_node_unlock | ( | fib_node_t * | node | ) |
Show the memory usage for a type.
This should be invoked by the type in response to the infra calling its registered memory show function
name | the name of the type |
in_use_elts | The number of elements in use |
allocd_elts | The number of allocated pool elemenets |
size_elt | The size of one element |
Definition at line 220 of file fib_node.c.
STATIC_ASSERT | ( | ) |
STATIC_ASSERT | ( | sizeof(fib_node_t) | = =12 , |
"FIB node type is growing" | |||
) |