40 #ifndef included_ip_ip4_fib_h 41 #define included_ip_ip4_fib_h 54 #define IP4_FIB_MTRIE_LEAF_EMPTY (1 + 2*0) 55 #define IP4_FIB_MTRIE_LEAF_ROOT (0 + 2*0) 85 ip4_fib_mtrie_leaf_t l;
86 l = 1 + 2 * adj_index;
107 ip4_fib_mtrie_leaf_t l;
118 ip4_fib_mtrie_leaf_t leaves[256];
120 #ifdef CLIB_HAVE_VEC128 121 u32x4 leaves_as_u32x4[256 / 4];
126 u8 dst_address_bits_of_leaves[256];
137 "IP4 Mtrie ply cache line");
154 u32 dst_address_length,
155 u32 adj_index,
u32 is_del);
165 ip4_fib_mtrie_leaf_t current_leaf,
167 u32 dst_address_byte_index)
169 ip4_fib_mtrie_leaf_t next_leaf;
170 ip4_fib_mtrie_ply_t *ply;
173 ply = m->
ply_pool + (current_is_terminal ? 0 : (current_leaf >> 1));
174 next_leaf = ply->
leaves[dst_address->
as_u8[dst_address_byte_index]];
175 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)
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 ip4_fib_mtrie_leaf_t ip4_fib_mtrie_lookup_step(ip4_fib_mtrie_t *m, ip4_fib_mtrie_leaf_t current_leaf, const ip4_address_t *dst_address, u32 dst_address_byte_index)
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_leaf_set_adj_index(u32 adj_index)
STATIC_ASSERT(0==sizeof(ip4_fib_mtrie_ply_t)%CLIB_CACHE_LINE_BYTES,"IP4 Mtrie ply cache line")
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