FD.io VPP  v17.04.2-2-ga8f93f8
Vector Packet Processing
mpls_fib.c File Reference
+ Include dependency graph for mpls_fib.c:

Go to the source code of this file.

Macros

#define MPLS_FLOW_HASH_DEFAULT   0
 FIXME. More...
 

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)
 
u32 mpls_fib_table_find_or_create_and_lock (u32 table_id)
 
u32 mpls_fib_table_create_and_lock (void)
 
void mpls_fib_table_destroy (mpls_fib_t *mf)
 
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)
 
flow_hash_config_t mpls_fib_table_get_flow_hash_config (u32 fib_index)
 
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...
 
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...
 

Macro Definition Documentation

#define MPLS_FLOW_HASH_DEFAULT   0

FIXME.

Definition at line 67 of file mpls_fib.c.

Function Documentation

static u32 mpls_fib_create_with_table_id ( u32  table_id)
static

Definition at line 91 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 70 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 328 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 313 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 78 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 404 of file mpls_fib.c.

+ Here is the call graph for this function:

u32 mpls_fib_table_create_and_lock ( void  )

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 ( mpls_fib_t mf)

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 296 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 305 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)

Definition at line 225 of file mpls_fib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

flow_hash_config_t mpls_fib_table_get_flow_hash_config ( u32  fib_index)

Definition at line 340 of file mpls_fib.c.

+ 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 281 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 361 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 384 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 347 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:404

(constructor) VLIB_CLI_COMMAND (mpls_fib_show_command)

Definition at line 450 of file mpls_fib.c.