44 #define BIER_N_ECMP_TABLES 16 49 return (bt - bier_table_pool);
70 u32 key = ((
id->bti_sub_domain << 24) |
242 .fp_label = bt->
bt_ll,
361 bt->
bt_ll = local_label;
434 bt->
bt_ll = local_label;
554 index_t bfmi, bti, bei, *bfmip, *bfmis = NULL;
852 return (
format(s,
"No BIER table %d", bti));
857 s =
format(s,
"[@%d] bier-table:[%U local-label:%U",
868 if (flags & BIER_SHOW_DETAIL)
890 s =
format(s,
"\n bp:%d\n %U", ii,
static bier_table_t * bier_table_mk_ecmp(index_t bti)
void bier_entry_path_update(index_t bei, const fib_route_path_t *rpaths)
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
fib_protocol_t fp_proto
protocol type
dpo_lock_fn_t dv_lock
A reference counting lock function.
Contribute an object that is to be used to forward BIER packets.
#define vec_foreach_index(var, v)
Iterate over vector indices.
#define hash_set(h, key, value)
u8 * format_bier_fmask(u8 *s, va_list *ap)
static void bier_table_mk_bift(bier_table_t *bt)
A virtual function table regisitered for a DPO type.
#define hash_unset(h, key)
vl_api_wireguard_peer_flags_t flags
void bier_fmask_lock(index_t bfmi)
u32 bier_fmask_db_find_or_create_and_lock(index_t bti, const fib_route_path_t *rpath)
index_t fib_path_get_resolving_index(fib_node_index_t path_index)
A representation of a path as described by a route producer.
#define BIER_N_ECMP_TABLES
The magic number of BIER ECMP tables to create.
u8 * format_bier_table(u8 *s, va_list *ap)
u16 bt_locks
Number of locks on the table.
u8 * format_bier_table_id(u8 *s, va_list *ap)
Format a BIER table ID.
index_t * bt_fmasks
f-masks in the ECMP table This is a vector sized to the appropriate number of entries given the table...
enum bier_show_flags_t_ bier_show_flags_t
Flags to control show output.
static const char *const *const bier_table_nodes[DPO_PROTO_NUM]
static index_t bier_table_get_index(const bier_table_t *bt)
void bier_entry_delete(index_t bei)
void bier_table_ecmp_unlock(index_t bti)
u32 mpls_label_t
A label value only, i.e.
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
static index_t bier_table_create(const bier_table_id_t *btid, mpls_label_t local_label)
index_t bier_entry_create(index_t bti, bier_bp_t bp)
void(* bier_table_ecmp_walk_fn_t)(index_t btei, void *ctx)
Types and functions to walk the ECMP tables of a main table.
A path that resolves via a BIER [ECMP] Table.
void fib_path_list_walk(fib_node_index_t path_list_index, fib_path_list_walk_fn_t func, void *ctx)
static const char *const bier_table_mpls_nodes[]
static void bier_table_insert(bier_table_t *bt, bier_bp_t bp, index_t bei)
static bier_entry_t * bier_entry_get(index_t bei)
static bier_table_t * bier_table_get(index_t bti)
bier_table_id_t frp_bier_tbl
A path that resolves via a BIER Table.
#define pool_len(p)
Number of elements in pool vector.
void bier_bift_table_entry_add(bier_bift_id_t id, const dpo_id_t *dpo)
static void bier_table_unlock_i(bier_table_t *bt)
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
static uword * bier_tables_by_key
DB store of all BIER tables index by SD/set/hdr-len.
static bier_table_t * bier_table_find(const bier_table_id_t *bti)
void(* bier_tables_walk_fn_t)(const bier_table_t *bt, void *ctx)
Types and functions to walk all the BIER Tables.
void dpo_register(dpo_type_t type, const dpo_vft_t *vft, const char *const *const *nodes)
For a given DPO type Register:
#define VLIB_INIT_FUNCTION(x)
bier_table_ecmp_id_t bti_ecmp
The SUB/ECMP-ID Constructed by FIB to achieve ECMP between BFR-NBRs.
void bier_table_contribute_forwarding(index_t bti, dpo_id_t *dpo)
int bier_table_is_main(const bier_table_t *bt)
bier_table_set_id_t bti_set
The SET-ID The control plane divdies the bit-position space into sets in the case the max bit-positio...
Aggregate type for a prefix.
bier_bift_id_t bier_bift_id_encode(bier_table_set_id_t set, bier_table_sub_domain_id_t sd, bier_hdr_len_id_t bsl)
Encode a BIFT-ID as per draft-wijnandsxu-bier-non-mpls-bift-encoding-00.txt.
void fib_show_memory_usage(const char *name, u32 in_use_elts, u32 allocd_elts, size_t size_elt)
Show the memory usage for a type.
static void bier_table_dpo_unlock(dpo_id_t *dpo)
void bier_table_route_path_remove(const bier_table_id_t *btid, bier_bp_t bp, fib_route_path_t *brps)
static void bier_table_destroy(bier_table_t *bt)
u32 fib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
mpls_label_t bt_ll
Save the MPLS local label associated with the table.
u32 bier_bp_t
A bit positon as assigned to egress PEs.
index_t frp_bier_fmask
Resolving via a BIER Fmask.
u32 bier_hdr_len_id_to_num_bits(bier_hdr_len_id_t id)
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
static fib_path_list_walk_rc_t bier_table_ecmp_walk_path_list(fib_node_index_t pl_index, fib_node_index_t path_index, void *arg)
fib_node_index_t fib_path_list_create(fib_path_list_flags_t flags, const fib_route_path_t *rpaths)
bier_hdr_len_id_t bti_hdr_len
The size of the bit string processed by this table.
index_t bier_table_add_or_lock(const bier_table_id_t *btid, mpls_label_t local_label)
static void bier_table_remove(bier_table_t *bt, bier_bp_t bp)
#define pool_put(P, E)
Free an object E in pool P.
static const index_t bier_table_fwd_lookup(const bier_table_t *bt, bier_bp_t bp)
#define vec_del1(v, i)
Delete the element at index I.
void fib_path_list_lock(fib_node_index_t path_list_index)
bier_table_ecmp_walk_fn_t fn
void fib_table_unlock(u32 fib_index, fib_protocol_t proto, fib_source_t source)
Take a reference counting lock on the table.
u8 * format_bier_table_entry(u8 *s, va_list *ap)
#define pool_get_aligned(P, E, A)
Allocate an object E from a pool P with alignment A.
int bier_entry_path_remove(index_t bei, const fib_route_path_t *rpaths)
#define MPLS_FIB_DEFAULT_TABLE_ID
static u32 bier_table_mk_key(const bier_table_id_t *id)
void fib_table_entry_delete_index(fib_node_index_t fib_entry_index, fib_source_t source)
Delete a FIB entry.
#define MPLS_LABEL_INVALID
#define vec_free(V)
Free vector's memory (no header).
static const index_t bier_table_lookup(const bier_table_t *bt, bier_bp_t bp)
u32 fib_node_index_t
A typedef of a node index.
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
void dpo_set(dpo_id_t *dpo, dpo_type_t type, dpo_proto_t proto, index_t index)
Set/create a DPO ID The DPO will be locked.
void fib_path_list_unlock(fib_node_index_t path_list_index)
void bier_table_walk(const bier_table_id_t *bti, bier_table_walk_fn_t fn, void *ctx)
bier_table_t * bier_table_pool
Memory pool of all the allocated tables.
fib_node_index_t fib_table_entry_special_dpo_add(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, const dpo_id_t *dpo)
Add a 'special' entry to the FIB that links to the DPO passed A special entry is an entry that the FI...
fib_node_index_t bt_lfei
The index of the lfib entry created for this table.
void bier_table_unlock(const bier_table_id_t *bti)
static void bier_table_init(bier_table_t *bt, const bier_table_id_t *id, mpls_label_t ll)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
index_t * bt_entries
Entries in the table This is a vector sized to the appropriate number of entries given the table's su...
static void bier_table_mk_lfib(bier_table_t *bt)
const bier_table_id_t * bier_table_get_id(index_t bti)
void bier_table_route_delete(const bier_table_id_t *btid, bier_bp_t bp)
static void bier_table_lock_i(bier_table_t *bt)
index_t bier_table_ecmp_create_and_lock(const bier_table_id_t *btid)
static void bier_table_dpo_lock(dpo_id_t *dpo)
u32 fib_table_find_or_create_and_lock(fib_protocol_t proto, u32 table_id, fib_source_t src)
Get the index of the FIB for a Table-ID.
fib_route_path_flags_t frp_flags
flags on the path
u8 * format_bier_entry(u8 *s, va_list *ap)
void bier_table_route_path_update_i(const bier_table_id_t *btid, bier_bp_t bp, fib_route_path_t *brps, u8 is_replace)
fib_node_index_t bt_pl
The path-list used for the ECMP-tables.
A path that resolves via a BIER F-Mask.
format_function_t format_mpls_unicast_label
index_t bier_table_lock(const bier_table_id_t *btid)
void(* bier_table_walk_fn_t)(const bier_table_t *bt, const bier_entry_t *be, void *ctx)
Types and functions to walk all the entries in one BIER Table.
bier_table_id_t bt_id
The identity/key or the table.
enum fib_path_list_walk_rc_t_ fib_path_list_walk_rc_t
return code to control pat-hlist walk
#define FIB_NODE_INDEX_INVALID
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
void bier_table_route_path_add(const bier_table_id_t *btid, bier_bp_t bp, fib_route_path_t *brps)
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
A BIER Table is the bit-indexed forwarding table.
bier_table_sub_domain_id_t bti_sub_domain
The Sub-Domain-ID The control plane has the configuration option to specify multiple domains or topol...
void bier_table_show_all(vlib_main_t *vm, bier_show_flags_t flags)
#define DPO_INVALID
An initialiser for DPOs declared on the stack.
static clib_error_t * bier_table_module_init(vlib_main_t *vm)
void fib_path_list_contribute_forwarding(fib_node_index_t path_list_index, fib_forward_chain_type_t fct, fib_path_list_fwd_flags_t flags, dpo_id_t *dpo)
#define BIER_ECMP_TABLE_ID_MAIN
Definition of the ID of the BIER main table.
static void bier_table_rm_bift(bier_table_t *bt)
#define BIER_BP_TO_INDEX(bp)
void bier_fmask_unlock(index_t bfmi)
void bier_entry_path_add(index_t bei, const fib_route_path_t *rpaths)
void bier_bift_table_entry_remove(bier_bift_id_t id)
#define vec_validate_init_empty_aligned(V, I, INIT, A)
Make sure vector is long enough for given index and initialize empty space (no header, alignment alignment)
void dpo_reset(dpo_id_t *dpo)
reset a DPO ID The DPO will be unlocked.
#define vec_foreach(var, vec)
Vector iterator.
struct bier_table_ecmp_walk_ctx_t_ bier_table_ecmp_walk_ctx_t
void bier_table_ecmp_walk(index_t bti, bier_table_ecmp_walk_fn_t fn, void *ctx)
void bier_table_ecmp_set_fmask(index_t bti, bier_bp_t bp, index_t bfmi)
static u8 * format_bier_table_dpo(u8 *s, va_list *ap)
#define pool_foreach_index(i, v, body)
Iterate pool by index.
void bier_tables_walk(bier_tables_walk_fn_t fn, void *ctx)
#define CLIB_CACHE_LINE_BYTES
u32 bier_fmask_db_find(index_t bti, const fib_route_path_t *rpath)
void bier_table_route_path_update(const bier_table_id_t *btid, bier_bp_t bp, fib_route_path_t *brps)
static void bier_table_rm_lfib(bier_table_t *bt)
CLIB vectors are ubiquitous dynamically resized arrays with by user defined "headers".
static void bier_table_dpo_mem_show(void)
static uword pool_elts(void *v)
Number of active elements in a pool.