|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
40 #ifndef included_ip_ip4_fib_h
41 #define included_ip_ip4_fib_h
54 #define IP4_MTRIE_LEAF_EMPTY (1 + 2 * 0)
62 #define PLY_16_SIZE (1<<16)
72 #ifdef CLIB_HAVE_VEC128
95 #ifdef CLIB_HAVE_VEC128
96 u32x4 leaves_as_u32x4[256 / 4];
122 "IP4 Mtrie ply cache line");
165 u32 dst_address_length,
u32 adj_index);
167 u32 dst_address_length,
u32 adj_index);
174 u32 dst_address_length,
u32 adj_index,
175 u32 cover_address_length,
u32 cover_adj_index);
177 u32 dst_address_length,
u32 adj_index,
178 u32 cover_address_length,
u32 cover_adj_index);
222 u32 dst_address_byte_index)
228 if (!current_is_terminal)
231 return (ply->
leaves[dst_address->
as_u8[dst_address_byte_index]]);
254 u32 dst_address_byte_index)
260 if (!current_is_terminal)
263 return (ply->
leaves[dst_address->
as_u8[dst_address_byte_index]]);
void ip4_mtrie_16_free(ip4_mtrie_16_t *m)
Free an mtrie, It must be empty when free'd.
ip4_mtrie_leaf_t leaves[256]
void ip4_mtrie_8_route_del(ip4_mtrie_8_t *m, const ip4_address_t *dst_address, u32 dst_address_length, u32 adj_index, u32 cover_address_length, u32 cover_adj_index)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
uword ip4_mtrie_16_memory_usage(ip4_mtrie_16_t *m)
return the memory used by the table
ip4_mtrie_8_ply_t * ip4_ply_pool
A global pool of 8bit stride plys.
The mutiway-TRIE with a 8-8-8-8 stride.
static u32 ip4_mtrie_leaf_get_adj_index(ip4_mtrie_leaf_t n)
From the stored slot value extract the LB index value.
i32 n_non_empty_leafs
Number of non-empty leafs (whether terminal or not).
void ip4_mtrie_16_init(ip4_mtrie_16_t *m)
Initialise an mtrie.
static ip4_mtrie_leaf_t ip4_mtrie_16_lookup_step_one(const ip4_mtrie_16_t *m, const ip4_address_t *dst_address)
Lookup step number 1.
void ip4_mtrie_8_init(ip4_mtrie_8_t *m)
One ply of the 4 ply mtrie fib.
format_function_t format_ip4_mtrie_8
struct ip4_mtrie_8_ply_t_ ip4_mtrie_8_ply_t
One ply of the 4 ply mtrie fib.
format_function_t format_ip4_mtrie_16
Format/display the contents of the mtrie.
#define PLY_16_SIZE
the 16 way stride that is the top PLY of the mtrie We do not maintain the count of 'real' leaves in t...
void ip4_mtrie_16_route_del(ip4_mtrie_16_t *m, const ip4_address_t *dst_address, u32 dst_address_length, u32 adj_index, u32 cover_address_length, u32 cover_adj_index)
remove a route/entry to the mtrie
void ip4_mtrie_8_route_add(ip4_mtrie_8_t *m, const ip4_address_t *dst_address, u32 dst_address_length, u32 adj_index)
#define CLIB_CACHE_LINE_BYTES
u8 dst_address_bits_of_leaves[PLY_16_SIZE]
Prefix length for terminal leaves.
static ip4_mtrie_leaf_t ip4_mtrie_8_lookup_step(ip4_mtrie_leaf_t current_leaf, const ip4_address_t *dst_address, u32 dst_address_byte_index)
void ip4_mtrie_8_free(ip4_mtrie_8_t *m)
i32 dst_address_bits_base
The length of the ply's covering prefix.
void ip4_mtrie_16_route_add(ip4_mtrie_16_t *m, const ip4_address_t *dst_address, u32 dst_address_length, u32 adj_index)
Add a route/entry to the mtrie.
ip4_mtrie_leaf_t leaves[PLY_16_SIZE]
uword ip4_mtrie_8_memory_usage(ip4_mtrie_8_t *m)
ip4_mtrie_16_ply_t root_ply
Embed the PLY with the mtrie struct.
u8 pad[CLIB_CACHE_LINE_BYTES - 2 *sizeof(i32)]
static ip4_mtrie_leaf_t ip4_mtrie_16_lookup_step(ip4_mtrie_leaf_t current_leaf, const ip4_address_t *dst_address, u32 dst_address_byte_index)
Lookup step.
static ip4_mtrie_leaf_t ip4_mtrie_8_lookup_step_one(const ip4_mtrie_8_t *m, const ip4_address_t *dst_address)
The mutiway-TRIE with a 16-8-8 stride.
STATIC_ASSERT(0==sizeof(ip4_mtrie_8_ply_t) % CLIB_CACHE_LINE_BYTES, "IP4 Mtrie ply cache line")
u8 dst_address_bits_of_leaves[256]
Prefix length for leaves/ply.
static u32 ip4_mtrie_leaf_is_terminal(ip4_mtrie_leaf_t n)
Is the leaf terminal (i.e.
struct ip4_mtrie_16_ply_t_ ip4_mtrie_16_ply_t