40 #ifndef included_ip_ip4_fib_h 41 #define included_ip_ip4_fib_h 54 #define IP4_FIB_MTRIE_LEAF_EMPTY (1 + 2*IP_LOOKUP_MISS_ADJ_INDEX) 55 #define IP4_FIB_MTRIE_LEAF_ROOT (0 + 2*0) 81 {
return (n & 1) == 0; }
102 #ifdef CLIB_HAVE_VEC128 103 u32x4 leaves_as_u32x4[256 / 4];
108 u8 dst_address_bits_of_leaves[256];
132 u32 dst_address_length,
148 u32 dst_address_byte_index)
154 ply = m->
ply_pool + (current_is_terminal ? 0 : (current_leaf >> 1));
155 next_leaf = ply->
leaves[dst_address->
as_u8[dst_address_byte_index]];
156 next_leaf = current_is_terminal ? current_leaf : next_leaf;
u8 pad[3]
log2 (size of the packing page block)
sll srl srl sll sra u16x4 i
u32 ip4_mtrie_lookup_address(ip4_fib_mtrie_t *m, ip4_address_t dst)
static u32 ip4_fib_mtrie_leaf_get_next_ply_index(ip4_fib_mtrie_leaf_t n)
Definitions for all things IP (v4|v6) unicast and multicast lookup related.
void ip4_fib_mtrie_add_del_route(struct ip4_fib_t *f, ip4_address_t dst_address, u32 dst_address_length, u32 adj_index, u32 is_del)
static u32 ip4_fib_mtrie_leaf_is_next_ply(ip4_fib_mtrie_leaf_t n)
void ip4_mtrie_maybe_remap_adjacencies(ip_lookup_main_t *lm, ip4_fib_mtrie_t *m)
static ip4_fib_mtrie_leaf_t ip4_fib_mtrie_leaf_set_next_ply_index(u32 i)
#define IP4_FIB_MTRIE_LEAF_EMPTY
ip4_fib_mtrie_ply_t * ply_pool
static u32 ip4_fib_mtrie_leaf_get_adj_index(ip4_fib_mtrie_leaf_t n)
void ip4_fib_mtrie_init(ip4_fib_mtrie_t *m)
static ip4_fib_mtrie_leaf_t ip4_fib_mtrie_lookup_step(ip4_fib_mtrie_t *m, ip4_fib_mtrie_leaf_t current_leaf, ip4_address_t *dst_address, u32 dst_address_byte_index)
static ip4_fib_mtrie_leaf_t ip4_fib_mtrie_leaf_set_adj_index(u32 adj_index)
ip4_fib_mtrie_leaf_t leaves[256]
static u32 ip4_fib_mtrie_leaf_is_non_empty(ip4_fib_mtrie_leaf_t n)
format_function_t format_ip4_fib_mtrie
static u32 ip4_fib_mtrie_leaf_is_empty(ip4_fib_mtrie_leaf_t n)
#define CLIB_CACHE_LINE_BYTES
static u32 ip4_fib_mtrie_leaf_is_terminal(ip4_fib_mtrie_leaf_t n)
ip4_fib_mtrie_leaf_t default_leaf