FD.io VPP  v18.11-rc0-18-g2a3fb1a
Vector Packet Processing
mfib_entry.c File Reference
+ Include dependency graph for mfib_entry.c:

Go to the source code of this file.

Data Structures

struct  mfib_path_ext_t_
 MFIB extensions to each path. More...
 
struct  mfib_entry_src_t_
 The source of an MFIB entry. More...
 
struct  mfib_entry_collect_forwarding_ctx_t_
 

Macros

#define MFIB_ENTRY_DBG(_e, _fmt, _args...)
 Debug macro. More...
 

Typedefs

typedef struct mfib_path_ext_t_ mfib_path_ext_t
 MFIB extensions to each path. More...
 
typedef struct mfib_entry_src_t_ mfib_entry_src_t
 The source of an MFIB entry. More...
 
typedef struct mfib_entry_collect_forwarding_ctx_t_ mfib_entry_collect_forwarding_ctx_t
 

Functions

static fib_node_tmfib_entry_get_node (fib_node_index_t index)
 
static fib_protocol_t mfib_entry_get_proto (const mfib_entry_t *mfib_entry)
 
fib_forward_chain_type_t mfib_entry_get_default_chain_type (const mfib_entry_t *mfib_entry)
 
static u8format_mfib_entry_dpo (u8 *s, va_list *args)
 
static mfib_path_ext_tmfib_entry_path_ext_get (index_t mi)
 
static u8format_mfib_entry_path_ext (u8 *s, va_list *args)
 
u8format_mfib_entry (u8 *s, va_list *args)
 
static mfib_entry_tmfib_entry_from_fib_node (fib_node_t *node)
 
static int mfib_entry_src_cmp_for_sort (void *v1, void *v2)
 
static void mfib_entry_src_init (mfib_entry_t *mfib_entry, mfib_source_t source)
 
static mfib_entry_src_tmfib_entry_src_find (const mfib_entry_t *mfib_entry, mfib_source_t source, u32 *index)
 
static mfib_entry_src_tmfib_entry_src_find_or_create (mfib_entry_t *mfib_entry, mfib_source_t source)
 
static mfib_entry_src_tmfib_entry_get_best_src (const mfib_entry_t *mfib_entry)
 
int mfib_entry_is_sourced (fib_node_index_t mfib_entry_index, mfib_source_t source)
 
static void mfib_entry_src_flush (mfib_entry_src_t *msrc)
 
static void mfib_entry_src_remove (mfib_entry_t *mfib_entry, mfib_source_t source)
 
u32 mfib_entry_child_add (fib_node_index_t mfib_entry_index, fib_node_type_t child_type, fib_node_index_t child_index)
 
void mfib_entry_child_remove (fib_node_index_t mfib_entry_index, u32 sibling_index)
 
static mfib_entry_tmfib_entry_alloc (u32 fib_index, const mfib_prefix_t *prefix, fib_node_index_t *mfib_entry_index)
 
static mfib_path_ext_tmfib_entry_path_ext_find (mfib_path_ext_t *exts, fib_node_index_t path_index)
 
static mfib_path_ext_tmfib_path_ext_add (mfib_entry_src_t *msrc, fib_node_index_t path_index, mfib_itf_flags_t mfi_flags)
 
static void mfib_path_ext_remove (mfib_entry_src_t *msrc, fib_node_index_t path_index)
 
static fib_path_list_walk_rc_t mfib_entry_src_collect_forwarding (fib_node_index_t pl_index, fib_node_index_t path_index, void *arg)
 
static void mfib_entry_stack (mfib_entry_t *mfib_entry, mfib_entry_src_t *msrc)
 
static fib_node_index_t mfib_entry_src_path_add (mfib_entry_src_t *msrc, const fib_route_path_t *rpath)
 
static fib_node_index_t mfib_entry_src_path_remove (mfib_entry_src_t *msrc, const fib_route_path_t *rpath)
 
static void mfib_entry_recalculate_forwarding (mfib_entry_t *mfib_entry)
 
fib_node_index_t mfib_entry_create (u32 fib_index, mfib_source_t source, const mfib_prefix_t *prefix, fib_rpf_id_t rpf_id, mfib_entry_flags_t entry_flags)
 
static int mfib_entry_ok_for_delete (mfib_entry_t *mfib_entry)
 
static int mfib_entry_src_ok_for_delete (const mfib_entry_src_t *msrc)
 
int mfib_entry_update (fib_node_index_t mfib_entry_index, mfib_source_t source, mfib_entry_flags_t entry_flags, fib_rpf_id_t rpf_id, index_t repi)
 
static void mfib_entry_itf_add (mfib_entry_src_t *msrc, u32 sw_if_index, index_t mi)
 
static void mfib_entry_itf_remove (mfib_entry_src_t *msrc, u32 sw_if_index)
 
void mfib_entry_path_update (fib_node_index_t mfib_entry_index, mfib_source_t source, const fib_route_path_t *rpath, mfib_itf_flags_t itf_flags)
 
int mfib_entry_path_remove (fib_node_index_t mfib_entry_index, mfib_source_t source, const fib_route_path_t *rpath)
 
int mfib_entry_delete (fib_node_index_t mfib_entry_index, mfib_source_t source)
 mfib_entry_delete More...
 
static int fib_ip4_address_compare (ip4_address_t *a1, ip4_address_t *a2)
 
static int fib_ip6_address_compare (ip6_address_t *a1, ip6_address_t *a2)
 
static int mfib_entry_cmp (fib_node_index_t mfib_entry_index1, fib_node_index_t mfib_entry_index2)
 
int mfib_entry_cmp_for_sort (void *i1, void *i2)
 
static void mfib_entry_last_lock_gone (fib_node_t *node)
 
static fib_node_back_walk_rc_t mfib_entry_back_walk_notify (fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
 
static void mfib_entry_show_memory (void)
 
void mfib_entry_lock (fib_node_index_t mfib_entry_index)
 
void mfib_entry_unlock (fib_node_index_t mfib_entry_index)
 
static void mfib_entry_dpo_lock (dpo_id_t *dpo)
 
static void mfib_entry_dpo_unlock (dpo_id_t *dpo)
 
void mfib_entry_module_init (void)
 
void mfib_entry_encode (fib_node_index_t mfib_entry_index, fib_route_path_encode_t **api_rpaths)
 
void mfib_entry_get_prefix (fib_node_index_t mfib_entry_index, mfib_prefix_t *pfx)
 
u32 mfib_entry_get_fib_index (fib_node_index_t mfib_entry_index)
 
const dpo_id_tmfib_entry_contribute_ip_forwarding (fib_node_index_t mfib_entry_index)
 
void mfib_entry_contribute_forwarding (fib_node_index_t mfib_entry_index, fib_forward_chain_type_t type, dpo_id_t *dpo)
 
u32 mfib_entry_pool_size (void)
 
static clib_error_tshow_mfib_entry_command (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 

Variables

static mfib_path_ext_tmfib_path_ext_pool
 Pool of path extensions. More...
 
static const char * mfib_source_names [] = MFIB_SOURCE_NAMES
 String names for each source. More...
 
mfib_entry_tmfib_entry_pool
 
static const fib_node_vft_t mfib_entry_vft
 
static const dpo_vft_t mfib_entry_dpo_vft
 
static const char *const mfib_entry_ip4_nodes []
 
static const char *const mfib_entry_ip6_nodes []
 
static const char *const *const mfib_entry_nodes [DPO_PROTO_NUM]
 
static vlib_cli_command_t show_mfib_entry
 (constructor) VLIB_CLI_COMMAND (show_mfib_entry) More...
 

Macro Definition Documentation

#define MFIB_ENTRY_DBG (   _e,
  _fmt,
  _args... 
)

Debug macro.

Definition at line 48 of file mfib_entry.c.

Typedef Documentation

The source of an MFIB entry.

MFIB extensions to each path.

Function Documentation

static int fib_ip4_address_compare ( ip4_address_t a1,
ip4_address_t a2 
)
static

Definition at line 1005 of file mfib_entry.c.

+ Here is the caller graph for this function:

static int fib_ip6_address_compare ( ip6_address_t a1,
ip6_address_t a2 
)
static

Definition at line 1019 of file mfib_entry.c.

+ Here is the caller graph for this function:

u8* format_mfib_entry ( u8 s,
va_list *  args 
)

Definition at line 171 of file mfib_entry.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8* format_mfib_entry_dpo ( u8 s,
va_list *  args 
)
static

Definition at line 142 of file mfib_entry.c.

+ Here is the call graph for this function:

static u8* format_mfib_entry_path_ext ( u8 s,
va_list *  args 
)
static

Definition at line 159 of file mfib_entry.c.

+ Here is the call graph for this function:

static mfib_entry_t* mfib_entry_alloc ( u32  fib_index,
const mfib_prefix_t prefix,
fib_node_index_t mfib_entry_index 
)
static

Definition at line 402 of file mfib_entry.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static fib_node_back_walk_rc_t mfib_entry_back_walk_notify ( fib_node_t node,
fib_node_back_walk_ctx_t ctx 
)
static

Definition at line 1115 of file mfib_entry.c.

+ Here is the call graph for this function:

u32 mfib_entry_child_add ( fib_node_index_t  mfib_entry_index,
fib_node_type_t  child_type,
fib_node_index_t  child_index 
)

Definition at line 382 of file mfib_entry.c.

+ Here is the call graph for this function:

void mfib_entry_child_remove ( fib_node_index_t  mfib_entry_index,
u32  sibling_index 
)

Definition at line 393 of file mfib_entry.c.

+ Here is the call graph for this function:

static int mfib_entry_cmp ( fib_node_index_t  mfib_entry_index1,
fib_node_index_t  mfib_entry_index2 
)
static

Definition at line 1034 of file mfib_entry.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int mfib_entry_cmp_for_sort ( void *  i1,
void *  i2 
)

Definition at line 1078 of file mfib_entry.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mfib_entry_contribute_forwarding ( fib_node_index_t  mfib_entry_index,
fib_forward_chain_type_t  type,
dpo_id_t dpo 
)

Definition at line 1252 of file mfib_entry.c.

+ Here is the call graph for this function:

const dpo_id_t* mfib_entry_contribute_ip_forwarding ( fib_node_index_t  mfib_entry_index)

Definition at line 1242 of file mfib_entry.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

fib_node_index_t mfib_entry_create ( u32  fib_index,
mfib_source_t  source,
const mfib_prefix_t prefix,
fib_rpf_id_t  rpf_id,
mfib_entry_flags_t  entry_flags 
)

Definition at line 722 of file mfib_entry.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int mfib_entry_delete ( fib_node_index_t  mfib_entry_index,
mfib_source_t  source 
)

mfib_entry_delete

The source is withdrawing all the paths it provided

Definition at line 991 of file mfib_entry.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void mfib_entry_dpo_lock ( dpo_id_t dpo)
static

Definition at line 1163 of file mfib_entry.c.

static void mfib_entry_dpo_unlock ( dpo_id_t dpo)
static

Definition at line 1167 of file mfib_entry.c.

void mfib_entry_encode ( fib_node_index_t  mfib_entry_index,
fib_route_path_encode_t **  api_rpaths 
)

Definition at line 1203 of file mfib_entry.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static mfib_entry_t* mfib_entry_from_fib_node ( fib_node_t node)
static

Definition at line 242 of file mfib_entry.c.

+ Here is the caller graph for this function:

static mfib_entry_src_t* mfib_entry_get_best_src ( const mfib_entry_t mfib_entry)
static

Definition at line 319 of file mfib_entry.c.

+ Here is the caller graph for this function:

fib_forward_chain_type_t mfib_entry_get_default_chain_type ( const mfib_entry_t mfib_entry)

Definition at line 126 of file mfib_entry.c.

+ Here is the caller graph for this function:

u32 mfib_entry_get_fib_index ( fib_node_index_t  mfib_entry_index)

Definition at line 1232 of file mfib_entry.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static fib_node_t* mfib_entry_get_node ( fib_node_index_t  index)
static

Definition at line 114 of file mfib_entry.c.

+ Here is the call graph for this function:

void mfib_entry_get_prefix ( fib_node_index_t  mfib_entry_index,
mfib_prefix_t pfx 
)

Definition at line 1222 of file mfib_entry.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static fib_protocol_t mfib_entry_get_proto ( const mfib_entry_t mfib_entry)
static

Definition at line 120 of file mfib_entry.c.

+ Here is the caller graph for this function:

int mfib_entry_is_sourced ( fib_node_index_t  mfib_entry_index,
mfib_source_t  source 
)

Definition at line 339 of file mfib_entry.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void mfib_entry_itf_add ( mfib_entry_src_t msrc,
u32  sw_if_index,
index_t  mi 
)
static

Definition at line 813 of file mfib_entry.c.

+ Here is the caller graph for this function:

static void mfib_entry_itf_remove ( mfib_entry_src_t msrc,
u32  sw_if_index 
)
static

Definition at line 821 of file mfib_entry.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void mfib_entry_last_lock_gone ( fib_node_t node)
static

Definition at line 1087 of file mfib_entry.c.

+ Here is the call graph for this function:

void mfib_entry_lock ( fib_node_index_t  mfib_entry_index)

Definition at line 1143 of file mfib_entry.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mfib_entry_module_init ( void  )

Definition at line 1196 of file mfib_entry.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int mfib_entry_ok_for_delete ( mfib_entry_t mfib_entry)
static

Definition at line 744 of file mfib_entry.c.

+ Here is the caller graph for this function:

static mfib_path_ext_t* mfib_entry_path_ext_find ( mfib_path_ext_t exts,
fib_node_index_t  path_index 
)
inlinestatic

Definition at line 435 of file mfib_entry.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static mfib_path_ext_t* mfib_entry_path_ext_get ( index_t  mi)
inlinestatic

Definition at line 153 of file mfib_entry.c.

+ Here is the caller graph for this function:

int mfib_entry_path_remove ( fib_node_index_t  mfib_entry_index,
mfib_source_t  source,
const fib_route_path_t rpath 
)

Definition at line 919 of file mfib_entry.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mfib_entry_path_update ( fib_node_index_t  mfib_entry_index,
mfib_source_t  source,
const fib_route_path_t rpath,
mfib_itf_flags_t  itf_flags 
)

Definition at line 834 of file mfib_entry.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 mfib_entry_pool_size ( void  )

Definition at line 1279 of file mfib_entry.c.

+ Here is the call graph for this function:

static void mfib_entry_recalculate_forwarding ( mfib_entry_t mfib_entry)
static

Definition at line 701 of file mfib_entry.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void mfib_entry_show_memory ( void  )
static

Definition at line 1124 of file mfib_entry.c.

+ Here is the call graph for this function:

static int mfib_entry_src_cmp_for_sort ( void *  v1,
void *  v2 
)
static

Definition at line 249 of file mfib_entry.c.

+ Here is the caller graph for this function:

static fib_path_list_walk_rc_t mfib_entry_src_collect_forwarding ( fib_node_index_t  pl_index,
fib_node_index_t  path_index,
void *  arg 
)
static

Definition at line 488 of file mfib_entry.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static mfib_entry_src_t* mfib_entry_src_find ( const mfib_entry_t mfib_entry,
mfib_source_t  source,
u32 index 
)
static

Definition at line 274 of file mfib_entry.c.

+ Here is the caller graph for this function:

static mfib_entry_src_t* mfib_entry_src_find_or_create ( mfib_entry_t mfib_entry,
mfib_source_t  source 
)
static

Definition at line 303 of file mfib_entry.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void mfib_entry_src_flush ( mfib_entry_src_t msrc)
static

Definition at line 350 of file mfib_entry.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void mfib_entry_src_init ( mfib_entry_t mfib_entry,
mfib_source_t  source 
)
static

Definition at line 258 of file mfib_entry.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int mfib_entry_src_ok_for_delete ( const mfib_entry_src_t msrc)
static

Definition at line 750 of file mfib_entry.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static fib_node_index_t mfib_entry_src_path_add ( mfib_entry_src_t msrc,
const fib_route_path_t rpath 
)
static

Definition at line 649 of file mfib_entry.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static fib_node_index_t mfib_entry_src_path_remove ( mfib_entry_src_t msrc,
const fib_route_path_t rpath 
)
static

Definition at line 679 of file mfib_entry.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void mfib_entry_src_remove ( mfib_entry_t mfib_entry,
mfib_source_t  source 
)
static

Definition at line 365 of file mfib_entry.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void mfib_entry_stack ( mfib_entry_t mfib_entry,
mfib_entry_src_t msrc 
)
static

Definition at line 548 of file mfib_entry.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mfib_entry_unlock ( fib_node_index_t  mfib_entry_index)

Definition at line 1153 of file mfib_entry.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int mfib_entry_update ( fib_node_index_t  mfib_entry_index,
mfib_source_t  source,
mfib_entry_flags_t  entry_flags,
fib_rpf_id_t  rpf_id,
index_t  repi 
)

Definition at line 757 of file mfib_entry.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static mfib_path_ext_t* mfib_path_ext_add ( mfib_entry_src_t msrc,
fib_node_index_t  path_index,
mfib_itf_flags_t  mfi_flags 
)
static

Definition at line 451 of file mfib_entry.c.

+ Here is the caller graph for this function:

static void mfib_path_ext_remove ( mfib_entry_src_t msrc,
fib_node_index_t  path_index 
)
static

Definition at line 469 of file mfib_entry.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* show_mfib_entry_command ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 1285 of file mfib_entry.c.

+ Here is the call graph for this function:

Variable Documentation

const dpo_vft_t mfib_entry_dpo_vft
static
Initial value:
= {
.dv_lock = mfib_entry_dpo_lock,
.dv_unlock = mfib_entry_dpo_unlock,
.dv_format = format_mfib_entry_dpo,
.dv_mem_show = mfib_entry_show_memory,
}
static void mfib_entry_dpo_unlock(dpo_id_t *dpo)
Definition: mfib_entry.c:1167
static void mfib_entry_dpo_lock(dpo_id_t *dpo)
Definition: mfib_entry.c:1163
static u8 * format_mfib_entry_dpo(u8 *s, va_list *args)
Definition: mfib_entry.c:142
static void mfib_entry_show_memory(void)
Definition: mfib_entry.c:1124

Definition at line 1171 of file mfib_entry.c.

const char* const mfib_entry_ip4_nodes[]
static
Initial value:
=
{
"ip4-mfib-forward-rpf",
}
#define NULL
Definition: clib.h:55

Definition at line 1178 of file mfib_entry.c.

const char* const mfib_entry_ip6_nodes[]
static
Initial value:
=
{
"ip6-mfib-forward-rpf",
}
#define NULL
Definition: clib.h:55

Definition at line 1183 of file mfib_entry.c.

const char* const* const mfib_entry_nodes[DPO_PROTO_NUM]
static
Initial value:
=
{
}
static const char *const mfib_entry_ip4_nodes[]
Definition: mfib_entry.c:1178
static const char *const mfib_entry_ip6_nodes[]
Definition: mfib_entry.c:1183

Definition at line 1189 of file mfib_entry.c.

mfib_entry_t* mfib_entry_pool

Definition at line 111 of file mfib_entry.c.

const fib_node_vft_t mfib_entry_vft
static
Initial value:
= {
.fnv_get = mfib_entry_get_node,
.fnv_last_lock = mfib_entry_last_lock_gone,
.fnv_back_walk = mfib_entry_back_walk_notify,
.fnv_mem_show = mfib_entry_show_memory,
}
static fib_node_t * mfib_entry_get_node(fib_node_index_t index)
Definition: mfib_entry.c:114
static void mfib_entry_last_lock_gone(fib_node_t *node)
Definition: mfib_entry.c:1087
static fib_node_back_walk_rc_t mfib_entry_back_walk_notify(fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
Definition: mfib_entry.c:1115
static void mfib_entry_show_memory(void)
Definition: mfib_entry.c:1124

Definition at line 1135 of file mfib_entry.c.

mfib_path_ext_t* mfib_path_ext_pool
static

Pool of path extensions.

Definition at line 101 of file mfib_entry.c.

const char* mfib_source_names[] = MFIB_SOURCE_NAMES
static

String names for each source.

Definition at line 106 of file mfib_entry.c.

vlib_cli_command_t show_mfib_entry
static
Initial value:
= {
.path = "show mfib entry",
.short_help = "show mfib entry",
}
static clib_error_t * show_mfib_entry_command(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: mfib_entry.c:1285

(constructor) VLIB_CLI_COMMAND (show_mfib_entry)

Definition at line 1330 of file mfib_entry.c.