43 return (bfm - bier_fmask_pool);
275 memset(bfm, 0,
sizeof(*bfm));
332 u32 indent = va_arg(*ap,
u32);
338 return (
format(s,
"No BIER f-mask %d", bfmi));
343 s =
format(s,
"fmask: nh:%U bs:%U locks:%d ",
358 s =
format(s,
" output-label:%U",
364 s =
format(s,
" output-bfit:[%U]",
520 .path =
"show bier fmask",
521 .short_help =
"show bier fmask",
dpo_lock_fn_t dv_lock
A reference counting lock function.
Contribute an object that is to be used to forward BIER packets.
static void bier_fmask_bits_init(bier_fmask_bits_t *bits, bier_hdr_len_id_t hlid)
clib_error_t * bier_fmask_module_init(vlib_main_t *vm)
u8 * format_bier_bit_string(u8 *string, va_list *args)
u32 bfmb_count
The total number of references to bits set on this mask in effect a count of the number of children...
u8 * format_bier_fmask(u8 *s, va_list *ap)
void bier_bit_string_set_bit(bier_bit_string_t *bit_string, bier_bp_t bp)
A virtual function table regisitered for a DPO type.
void fib_path_list_child_remove(fib_node_index_t path_list_index, u32 si)
void bier_fmask_lock(index_t bfmi)
static void bier_fmask_init(bier_fmask_t *bfm, const bier_fmask_id_t *fmid, const fib_route_path_t *rpaths)
A representation of a path as described by a route producer.
bier_fmask_t * bier_fmask_pool
void bier_fmask_contribute_forwarding(index_t bfmi, dpo_id_t *dpo)
void fib_node_init(fib_node_t *node, fib_node_type_t type)
static const char *const *const bier_fmask_nodes[DPO_PROTO_NUM]
bier_fmask_id_t * bfm_id
The key to this fmask - used for store/lookup in the DB.
static bier_fmask_t * bier_fmask_get(u32 index)
static void bier_fmask_dpo_lock(dpo_id_t *dpo)
enum fib_node_back_walk_rc_t_ fib_node_back_walk_rc_t
Return code from a back walk function.
u32 mpls_label_t
A label value only, i.e.
void dpo_copy(dpo_id_t *dst, const dpo_id_t *src)
atomic copy a data-plane object.
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
u8 * format_bier_bift_id(u8 *s, va_list *ap)
bier_fmask : The BIER fmask
#define STRUCT_OFFSET_OF(t, f)
bier_fmask_bits_t bfm_bits
The bits, and their ref counts, that are set on this mask This mask changes as BIER entries link to a...
fib_node_index_t bfm_pl
The path-list.
u32 fib_path_list_child_add(fib_node_index_t path_list_index, fib_node_type_t child_type, fib_node_index_t child_index)
#define pool_len(p)
Number of elements in pool vector.
u32 fib_node_child_add(fib_node_type_t parent_type, fib_node_index_t parent_index, fib_node_type_t type, fib_node_index_t index)
u16 bbs_len
The length of the string in BYTES.
void fib_node_register_type(fib_node_type_t type, const fib_node_vft_t *vft)
fib_node_register_type
static const char *const bier_fmask_mpls_nodes[]
void bier_fmask_unlink(index_t bfmi, bier_bp_t bp)
const dpo_id_t * drop_dpo_get(dpo_proto_t proto)
void dpo_register(dpo_type_t type, const dpo_vft_t *vft, const char *const *const *nodes)
For a given DPO type Register:
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
mpls_label_t * frp_label_stack
The outgoing MPLS label Stack.
#define VLIB_INIT_FUNCTION(x)
void fib_walk_sync(fib_node_type_t parent_type, fib_node_index_t parent_index, fib_node_back_walk_ctx_t *ctx)
Back walk all the children of a FIB node.
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...
void bier_fmask_child_remove(fib_node_index_t bfmi, u32 sibling_index)
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 index_t bier_fmask_get_index(const bier_fmask_t *bfm)
static void vnet_mpls_uc_set_label(mpls_label_t *label_exp_s_ttl, u32 value)
u32 bier_bp_t
A bit positon as assigned to egress PEs.
static void vnet_mpls_uc_set_exp(mpls_label_t *label_exp_s_ttl, u32 exp)
void bier_fmask_link(index_t bfmi, bier_bp_t bp)
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...
index_t bier_fmask_create_and_lock(const bier_fmask_id_t *fmid, const fib_route_path_t *rpaths)
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.
static fib_node_back_walk_rc_t bier_fmask_back_walk_notify(fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
void fib_node_lock(fib_node_t *node)
#define pool_put(P, E)
Free an object E in pool P.
void bier_bit_string_clear_bit(bier_bit_string_t *bit_string, bier_bp_t bp)
static u32 vnet_mpls_uc_get_label(mpls_label_t label_exp_s_ttl)
#define BIER_FMASK_ATTR_NAMES
An node in the FIB graph.
void fib_node_unlock(fib_node_t *node)
void bier_fmask_db_remove(const bier_fmask_id_t *fmid)
mpls_label_t bfm_label
The MPLS label to paint on the header during forwarding.
static bier_fmask_t * bier_fmask_get_from_node(fib_node_t *node)
#define pool_get_aligned(P, E, A)
Allocate an object E from a pool P (general version).
static void bier_fmask_stack(bier_fmask_t *bfm)
u32 fib_node_index_t
A typedef of a node index.
u32 bier_hdr_len_id_to_num_buckets(bier_hdr_len_id_t id)
Conversion functions for the enumerated bit-string length values, to bit and bytes.
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
enum bier_hdr_len_id_t_ bier_hdr_len_id_t
bier_hdr_len_id_t enumerator
bier_fmask_flags_t bfm_flags
operational/state flags on the fmask
fib_node_t bfm_node
The BIER fmask is a child of a FIB entry in the FIB graph.
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.
static void bier_fmask_dpo_mem_show(void)
Context passed between object during a back walk.
u32 bier_bift_id_t
The BIER universal 'label'.
#define VLIB_CLI_COMMAND(x,...)
A key/ID for a BIER forwarding Mas (FMask).
const bier_table_id_t * bier_table_get_id(index_t bti)
static void clib_mem_free(void *p)
enum fib_forward_chain_type_t_ fib_forward_chain_type_t
FIB output chain type.
#define FOR_EACH_BIER_FMASK_ATTR(_item)
bier_bit_mask_bucket_t * bbs_buckets
The buckets in the string.
void fib_node_child_remove(fib_node_type_t parent_type, fib_node_index_t parent_index, fib_node_index_t sibling_index)
static clib_error_t * bier_fmask_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static void * clib_mem_alloc(uword size)
static void vnet_mpls_uc_set_s(mpls_label_t *label_exp_s_ttl, u32 eos)
u8 * format_dpo_id(u8 *s, va_list *args)
Format a DPO_id_t oject
index_t bfmi_bti
The BIER table this fmask is in.
format_function_t format_mpls_unicast_label
static fib_node_t * bier_fmask_get_node(fib_node_index_t index)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
u32 fn_locks
Number of dependents on this node.
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
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...
u8 * fib_path_list_format(fib_node_index_t path_list_index, u8 *s)
#define DPO_INVALID
An initialiser for DPOs declared on the stack.
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_BP_TO_INDEX(bp)
bier_bit_string_t bfmb_input_reset_string
each bit in the mask needs to be reference counted and set/cleared on the 0->1 and 1->0 transitions...
static void bier_fmask_last_lock_gone(fib_node_t *node)
A FIB graph nodes virtual function table.
static void vnet_mpls_uc_set_ttl(mpls_label_t *label_exp_s_ttl, u32 ttl)
void bier_fmask_unlock(index_t bfmi)
static void * clib_mem_alloc_aligned(uword size, uword align)
static void bier_fmask_dpo_unlock(dpo_id_t *dpo)
enum fib_node_type_t_ fib_node_type_t
The types of nodes in a FIB graph.
static void bier_fmask_destroy(bier_fmask_t *bfm)
static const char *const bier_fmask_attr_names[]
dpo_id_t bfm_dpo
The index into the adj table for the adj that this fmask resolves via.
int dpo_is_drop(const dpo_id_t *dpo)
The Drop DPO will drop all packets, no questions asked.
void dpo_reset(dpo_id_t *dpo)
reset a DPO ID The DPO will be unlocked.
Contribute an object that is to be used to forward non-end-of-stack MPLS packets. ...
#define CLIB_CACHE_LINE_BYTES
#define ip46_address_is_zero(ip46)
u32 bier_fmask_child_add(fib_node_index_t bfmi, fib_node_type_t child_type, fib_node_index_t child_index)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
enum bier_fmask_attributes_t_ bier_fmask_attributes_t
Flags on fmask.
void dpo_stack(dpo_type_t child_type, dpo_proto_t child_proto, dpo_id_t *dpo, const dpo_id_t *parent)
Stack one DPO object on another, and thus establish a child-parent relationship.
ip46_address_t bfmi_nh
next-hop of the peer
u32 bfm_sibling
the index of this fmask in the parent's child list.
static uword pool_elts(void *v)
Number of active elements in a pool.