48 return (bfm - bier_fmask_pool);
347 u32 indent = va_arg(*ap,
u32);
354 return (
format(s,
"No BIER f-mask %d", bfmi));
359 s =
format(s,
"fmask: nh:%U bs:%U locks:%d ",
376 s =
format(s,
" output-label:%U",
382 s =
format(s,
" output-bfit:[%U]",
575 .path =
"show bier fmask",
576 .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)
ip46_address_t frp_addr
The next-hop address.
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.
A representation of a fib path for fib_path_encode to convey the information to the caller...
void vlib_validate_combined_counter(vlib_combined_counter_main_t *cm, u32 index)
validate a combined counter
void fib_path_list_child_remove(fib_node_index_t path_list_index, u32 si)
void bier_fmask_lock(index_t bfmi)
u32 bfmi_id
ID of the next-hop object, e.g.
A representation of a path as described by a route producer.
index_t bier_fmask_create_and_lock(const bier_fmask_id_t *fmid, const fib_route_path_t *rpath)
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.
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
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...
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
u8 * format_bier_bift_id(u8 *s, va_list *ap)
BIER header in non-MPLS networks.
Combined counter to hold both packets and byte differences.
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.
u32 frp_sw_if_index
The interface.
#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)
A path via a UDP encap object.
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...
static void vlib_zero_combined_counter(vlib_combined_counter_main_t *cm, u32 index)
Clear a combined counter Clears the set of per-thread counters.
fib_node_index_t fib_path_list_create(fib_path_list_flags_t flags, const fib_route_path_t *rpaths)
counter_t packets
packet counter
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)
fib_mpls_label_t * frp_label_stack
The outgoing MPLS label Stack.
#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 with alignment A.
static void vlib_get_combined_counter(const vlib_combined_counter_main_t *cm, u32 index, vlib_counter_t *result)
Get the value of a combined counter, never called in the speed path Scrapes the entire set of per-thr...
#define vec_free(V)
Free vector's memory (no header).
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
mpls_label_t fml_value
The label value.
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)
fib_route_path_flags_t frp_flags
flags on the path
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
counter_t bytes
byte counter
static fib_node_t * bier_fmask_get_node(fib_node_index_t index)
u32 fn_locks
Number of dependents on this node.
void bier_fmask_get_stats(index_t bfmi, u64 *packets, u64 *bytes)
#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)
bier_nh_type_t bfmi_nh_type
Union discriminator.
vlib_combined_counter_main_t bier_fmask_counters
Stats for each BIER fmask object.
BIER Header in MPLS networks.
#define DPO_INVALID
An initialiser for DPOs declared on the stack.
A collection of combined counters.
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 bier_fmask_init(bier_fmask_t *bfm, const bier_fmask_id_t *fmid, const fib_route_path_t *rpath)
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. ...
void bier_fmask_encode(index_t bfmi, bier_table_id_t *btid, fib_route_path_encode_t *rpath)
#define CLIB_CACHE_LINE_BYTES
u32 frp_udp_encap_id
UDP encap ID.
#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.