32 return (bdt - bier_disp_table_pool);
121 pool_put(bier_disp_table_pool, bdt);
146 u32 indent = va_arg(*ap,
u32);
152 s =
format(s,
"bier-disp-table:[%d]; table-id:%d locks:%d",
165 clib_host_to_net_u16(src));
179 u32 indent = va_arg(*ap,
u32);
194 bdt->
bdt_db[clib_host_to_net_u16(src)] = bdei;
297 fn(bdt, bde, clib_host_to_net_u16(src), ctx);
346 &bier_disp_table_dpo_vft,
369 else if (
unformat (input,
"%d", &bdti))
402 .path =
"show bier disp table",
403 .short_help =
"show bier disp table [index]",
dpo_lock_fn_t dv_lock
A reference counting lock function.
static const char *const *const bier_disp_table_nodes[DPO_PROTO_NUM]
static void bier_disp_table_entry_insert(index_t bdti, bier_bp_t src, index_t bdei)
#define hash_set(h, key, value)
A virtual function table regisitered for a DPO type.
#define hash_unset(h, key)
vl_api_wireguard_peer_flags_t flags
A representation of a path as described by a route producer.
index_t bdt_db[BIER_BP_MAX]
The lookup DB based on sender BP.
static uword * bier_disp_table_id_to_index
Hash table to map client table IDs to VPP index.
enum bier_show_flags_t_ bier_show_flags_t
Flags to control show output.
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
bier_disp_table_t * bier_disp_table_pool
memory pool for disposition tables
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
void bier_disp_table_entry_path_remove(u32 table_id, bier_bp_t src, bier_hdr_proto_id_t payload_proto, const fib_route_path_t *rpath)
void bier_disp_table_entry_path_add(u32 table_id, bier_bp_t src, bier_hdr_proto_id_t payload_proto, const fib_route_path_t *rpaths)
u8 * format_bier_disp_table(u8 *s, va_list *ap)
Format the description/name of the table.
bier_disposition : The BIER disposition object
#define pool_len(p)
Number of elements in pool vector.
void bier_disp_entry_unlock(index_t bdei)
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.
#define VLIB_INIT_FUNCTION(x)
int bier_disp_entry_path_remove(index_t bdei, bier_hdr_proto_id_t pproto, const fib_route_path_t *rpaths)
static const char *const bier_disp_table_bier_nodes[]
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.
u16 bdt_locks
number of locks on the table
u32 bier_bp_t
A bit positon as assigned to egress PEs.
static void bier_disp_table_dpo_unlock(dpo_id_t *dpo)
void bier_disp_table_contribute_forwarding(index_t bdti, dpo_id_t *dpo)
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static void bier_disp_table_lock_i(bier_disp_table_t *bdt)
static index_t bier_disp_table_get_index(const bier_disp_table_t *bdt)
u16 bier_hdr_src_id_t
An identifier of the sender of BIER packets this is the source of the 'tree' - the BFIR...
#define pool_put(P, E)
Free an object E in pool P.
static u8 * format_bier_disp_table_dpo(u8 *s, va_list *ap)
static bier_disp_entry_t * bier_disp_entry_get(index_t bdi)
void bier_disp_entry_path_add(index_t bdei, bier_hdr_proto_id_t pproto, const fib_route_path_t *rpaths)
void bier_disp_table_lock(index_t bdti)
#define pool_get_aligned(P, E, A)
Allocate an object E from a pool P with alignment A.
u8 * format_bier_disp_entry(u8 *s, va_list *args)
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
enum bier_hdr_proto_id_t_ bier_hdr_proto_id_t
BIER header protocol payload types.
index_t bier_disp_table_find(u32 table_id)
static index_t bier_disp_table_lookup_hton(index_t bdti, bier_bp_t bp)
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.
#define VLIB_CLI_COMMAND(x,...)
static index_t bier_disp_table_lookup(index_t bdti, bier_hdr_src_id_t src)
#define hash_create(elts, value_bytes)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
void(* bier_disp_table_walk_fn_t)(const bier_disp_table_t *bdt, const bier_disp_entry_t *bde, u16 bp, void *ctx)
Types and functions to walk all the entries in one BIER Table.
clib_error_t * bier_disp_table_module_init(vlib_main_t *vm)
#define BIER_BP_MAX
The maximum BP that can be assigned.
index_t dpoi_index
the index of objects of that type
void bier_disp_table_unlock_w_table_id(u32 table_id)
index_t bier_disp_entry_add_or_lock(void)
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
static void bier_disp_table_dpo_lock(dpo_id_t *dpo)
static void bier_disp_table_dpo_mem_show(void)
A protocol Independent IP multicast FIB table.
static clib_error_t * show_bier_disp_table(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static void bier_disp_table_entry_remove(index_t bdti, bier_bp_t src)
void bier_disp_table_walk(u32 table_id, bier_disp_table_walk_fn_t fn, void *ctx)
static bier_disp_table_t * bier_disp_table_get(index_t bdti)
#define CLIB_CACHE_LINE_BYTES
u32 bdt_table_id
Table ID (hash key) for this FIB.
void bier_disp_table_unlock(index_t bdti)
index_t bier_disp_table_add_or_lock(u32 table_id)
static uword pool_elts(void *v)
Number of active elements in a pool.