FD.io VPP  v21.01.1
Vector Packet Processing
fib_entry_track.c File Reference
+ Include dependency graph for fib_entry_track.c:

Go to the source code of this file.

Functions

static fib_entry_delegate_tfib_entry_track_delegate_add (u32 fib_index, const fib_prefix_t *prefix)
 
fib_node_index_t fib_entry_track (u32 fib_index, const fib_prefix_t *prefix, fib_node_type_t child_type, index_t child_index, u32 *sibling)
 Trackers are used on FIB entries by objects that which to track the changing state of the entry. More...
 
void fib_entry_untrack (fib_node_index_t fei, u32 sibling)
 Stop tracking a FIB entry. More...
 
static fib_node_tfib_entry_track_get_node (fib_node_index_t index)
 
static fib_entry_delegate_tfib_entry_delegate_from_fib_node (fib_node_t *node)
 
static void fib_entry_track_last_lock_gone (fib_node_t *node)
 
static fib_node_back_walk_rc_t fib_entry_track_back_walk_notify (fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
 
static void fib_entry_track_show_memory (void)
 
void fib_entry_track_module_init (void)
 

Variables

static const fib_node_vft_t fib_entry_track_vft
 

Function Documentation

◆ fib_entry_delegate_from_fib_node()

static fib_entry_delegate_t* fib_entry_delegate_from_fib_node ( fib_node_t node)
static

Definition at line 107 of file fib_entry_track.c.

+ Here is the caller graph for this function:

◆ fib_entry_track()

fib_node_index_t fib_entry_track ( u32  fib_index,
const fib_prefix_t prefix,
fib_node_type_t  child_type,
index_t  child_index,
u32 sibling 
)

Trackers are used on FIB entries by objects that which to track the changing state of the entry.

For example a tunnel would track its destination address to be informed of reachability changes.

The benefit of this aproach is that each time a new client tracks the entry it doesn't RR source it. When an entry is sourced all its children are updated. Thus, new clients tracking an entry is O(n^2). With the tracker as indirection, the entry is sourced only once. Track a FIB entry

Parameters
fib_indexThe FIB the entry is in
prefixThe Prefix of the entry to track
child_typeThe type of object that is tracking this entry
child_indexThe pool index of the object tracking
sigbling[RETURNED] The sibling index of the child on the tracker
Returns
The index of the FIB entry

Definition at line 49 of file fib_entry_track.c.

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

◆ fib_entry_track_back_walk_notify()

static fib_node_back_walk_rc_t fib_entry_track_back_walk_notify ( fib_node_t node,
fib_node_back_walk_ctx_t ctx 
)
static

Definition at line 141 of file fib_entry_track.c.

+ Here is the call graph for this function:

◆ fib_entry_track_delegate_add()

static fib_entry_delegate_t* fib_entry_track_delegate_add ( u32  fib_index,
const fib_prefix_t prefix 
)
static

Definition at line 22 of file fib_entry_track.c.

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

◆ fib_entry_track_get_node()

static fib_node_t* fib_entry_track_get_node ( fib_node_index_t  index)
static

Definition at line 98 of file fib_entry_track.c.

+ Here is the call graph for this function:

◆ fib_entry_track_last_lock_gone()

static void fib_entry_track_last_lock_gone ( fib_node_t node)
static

Definition at line 116 of file fib_entry_track.c.

+ Here is the call graph for this function:

◆ fib_entry_track_module_init()

void fib_entry_track_module_init ( void  )

Definition at line 175 of file fib_entry_track.c.

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

◆ fib_entry_track_show_memory()

static void fib_entry_track_show_memory ( void  )
static

Definition at line 160 of file fib_entry_track.c.

◆ fib_entry_untrack()

void fib_entry_untrack ( fib_node_index_t  fei,
u32  sibling 
)

Stop tracking a FIB entry.

Parameters
feiFIB entry index (as returned from the track API above)
siblingSibling index (as returned from the track API above)

Definition at line 79 of file fib_entry_track.c.

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

Variable Documentation

◆ fib_entry_track_vft

const fib_node_vft_t fib_entry_track_vft
static
Initial value:
= {
.fnv_mem_show = fib_entry_track_show_memory,
}
static void fib_entry_track_last_lock_gone(fib_node_t *node)
static void fib_entry_track_show_memory(void)
static fib_node_back_walk_rc_t fib_entry_track_back_walk_notify(fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
static fib_node_t * fib_entry_track_get_node(fib_node_index_t index)

Definition at line 167 of file fib_entry_track.c.