FD.io VPP  v18.04-17-g3a0d853
Vector Packet Processing
mpls_fib.c File Reference
+ Include dependency graph for mpls_fib.c:

Go to the source code of this file.

Functions

static u32 mpls_fib_entry_mk_key (mpls_label_t label, mpls_eos_bit_t eos)
 
u32 mpls_fib_index_from_table_id (u32 table_id)
 
static u32 mpls_fib_create_with_table_id (u32 table_id, fib_source_t src)
 
u32 mpls_fib_table_find_or_create_and_lock (u32 table_id, fib_source_t src)
 
u32 mpls_fib_table_create_and_lock (fib_source_t src)
 
void mpls_fib_table_destroy (u32 fib_index)
 
fib_node_index_t mpls_fib_table_lookup (const mpls_fib_t *mf, mpls_label_t label, mpls_eos_bit_t eos)
 
void mpls_fib_table_entry_insert (mpls_fib_t *mf, mpls_label_t label, mpls_eos_bit_t eos, fib_node_index_t lfei)
 
void mpls_fib_table_entry_remove (mpls_fib_t *mf, mpls_label_t label, mpls_eos_bit_t eos)
 
void mpls_fib_forwarding_table_update (mpls_fib_t *mf, mpls_label_t label, mpls_eos_bit_t eos, const dpo_id_t *dpo)
 
void mpls_fib_forwarding_table_reset (mpls_fib_t *mf, mpls_label_t label, mpls_eos_bit_t eos)
 
void mpls_fib_table_walk (mpls_fib_t *mpls_fib, fib_table_walk_fn_t fn, void *ctx)
 Walk all entries in a FIB table N.B: This is NOT safe to deletes. More...
 
u8format_mpls_fib_table_memory (u8 *s, va_list *args)
 
static void mpls_fib_table_show_all (const mpls_fib_t *mpls_fib, vlib_main_t *vm)
 
static void mpls_fib_table_show_one (const mpls_fib_t *mpls_fib, mpls_label_t label, vlib_main_t *vm)
 
static clib_error_tmpls_fib_show (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 

Variables

static index_t mpls_fib_drop_dpo_index = INDEX_INVALID
 An MPLS_FIB table;. More...
 
static vlib_cli_command_t mpls_fib_show_command
 (constructor) VLIB_CLI_COMMAND (mpls_fib_show_command) More...
 

Function Documentation

u8* format_mpls_fib_table_memory ( u8 s,
va_list *  args 
)

Definition at line 363 of file mpls_fib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 mpls_fib_create_with_table_id ( u32  table_id,
fib_source_t  src 
)
static

Definition at line 86 of file mpls_fib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 mpls_fib_entry_mk_key ( mpls_label_t  label,
mpls_eos_bit_t  eos 
)
inlinestatic

Definition at line 65 of file mpls_fib.c.

+ Here is the caller graph for this function:

void mpls_fib_forwarding_table_reset ( mpls_fib_t mf,
mpls_label_t  label,
mpls_eos_bit_t  eos 
)

Definition at line 337 of file mpls_fib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mpls_fib_forwarding_table_update ( mpls_fib_t mf,
mpls_label_t  label,
mpls_eos_bit_t  eos,
const dpo_id_t dpo 
)

Definition at line 315 of file mpls_fib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 mpls_fib_index_from_table_id ( u32  table_id)

Definition at line 73 of file mpls_fib.c.

+ Here is the caller graph for this function:

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

Definition at line 418 of file mpls_fib.c.

+ Here is the call graph for this function:

u32 mpls_fib_table_create_and_lock ( fib_source_t  src)

Definition at line 238 of file mpls_fib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mpls_fib_table_destroy ( u32  fib_index)

Definition at line 244 of file mpls_fib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mpls_fib_table_entry_insert ( mpls_fib_t mf,
mpls_label_t  label,
mpls_eos_bit_t  eos,
fib_node_index_t  lfei 
)

Definition at line 298 of file mpls_fib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mpls_fib_table_entry_remove ( mpls_fib_t mf,
mpls_label_t  label,
mpls_eos_bit_t  eos 
)

Definition at line 307 of file mpls_fib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 mpls_fib_table_find_or_create_and_lock ( u32  table_id,
fib_source_t  src 
)

Definition at line 224 of file mpls_fib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

fib_node_index_t mpls_fib_table_lookup ( const mpls_fib_t mf,
mpls_label_t  label,
mpls_eos_bit_t  eos 
)

Definition at line 283 of file mpls_fib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void mpls_fib_table_show_all ( const mpls_fib_t mpls_fib,
vlib_main_t vm 
)
static

Definition at line 375 of file mpls_fib.c.

+ Here is the call graph for this function:

static void mpls_fib_table_show_one ( const mpls_fib_t mpls_fib,
mpls_label_t  label,
vlib_main_t vm 
)
static

Definition at line 398 of file mpls_fib.c.

+ Here is the call graph for this function:

void mpls_fib_table_walk ( mpls_fib_t fib,
fib_table_walk_fn_t  fn,
void *  ctx 
)

Walk all entries in a FIB table N.B: This is NOT safe to deletes.

If you need to delete walk the whole table and store elements in a vector, then delete the elements

Definition at line 349 of file mpls_fib.c.

+ Here is the caller graph for this function:

Variable Documentation

index_t mpls_fib_drop_dpo_index = INDEX_INVALID
static

An MPLS_FIB table;.

The entries in the table are programmed wtih one or more MOIs. These MOIs may result in different forwarding actions for end-of-stack (EOS) and non-EOS packets. Whether the two actions are the same more often than they are different, or vice versa, is a function of the deployment in which the router is used and thus not predictable. The desgin choice to make with an MPLS_FIB table is: 1 - 20 bit key: label only. When the EOS and non-EOS actions differ the result is a 'EOS-choice' object. 2 - 21 bit key: label and EOS-bit. The result is then the specific action based on EOS-bit.

20 bit key: Advantages:

  • lower memory overhead, since there are few DB entries. Disadvantages:
  • slower DP performance in the case the chains differ, as more objects are encounterd in the switch path

21 bit key: Advantages:

  • faster DP performance Disadvantages
  • increased memory footprint.

Switching between schemes based on observed/measured action similarity is not considered on the grounds of complexity and flip-flopping.

VPP mantra - favour performance over memory. We choose a 21 bit key. All lookups in an MPLS_FIB table must result in a DPO of type load-balance. This is the default result which links to drop

Definition at line 62 of file mpls_fib.c.

vlib_cli_command_t mpls_fib_show_command
static
Initial value:
= {
.path = "show mpls fib",
.short_help = "show mpls fib [summary] [table <n>]",
.function = mpls_fib_show,
}
static clib_error_t * mpls_fib_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: mpls_fib.c:418

(constructor) VLIB_CLI_COMMAND (mpls_fib_show_command)

Definition at line 464 of file mpls_fib.c.