FD.io VPP  v18.04-17-g3a0d853
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 993 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 1007 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 399 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 1103 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 379 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 390 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 1022 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 1066 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 1240 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 1230 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 719 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 979 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 1151 of file mfib_entry.c.

static void mfib_entry_dpo_unlock ( dpo_id_t dpo)
static

Definition at line 1155 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 1191 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 239 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 316 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 1220 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 1210 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 336 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 810 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 818 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 1075 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 1131 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 1184 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 741 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 432 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 921 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 831 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 1267 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 698 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 1112 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 246 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 485 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 271 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 300 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 347 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 255 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 747 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 646 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 676 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 362 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 545 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 1141 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 754 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 448 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 466 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 1273 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:1155
static void mfib_entry_dpo_lock(dpo_id_t *dpo)
Definition: mfib_entry.c:1151
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:1112

Definition at line 1159 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 1166 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 1171 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:1166
static const char *const mfib_entry_ip6_nodes[]
Definition: mfib_entry.c:1171

Definition at line 1177 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:1075
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:1103
static void mfib_entry_show_memory(void)
Definition: mfib_entry.c:1112

Definition at line 1123 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:1273

(constructor) VLIB_CLI_COMMAND (show_mfib_entry)

Definition at line 1318 of file mfib_entry.c.