|
FD.io VPP
v21.06-3-gbb25fbf28
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_FIB_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];
123 "IP4 Mtrie ply cache line");
154 u32 dst_address_length,
u32 adj_index);
160 u32 dst_address_length,
162 u32 cover_address_length,
u32 cover_adj_index);
205 u32 dst_address_byte_index)
211 if (!current_is_terminal)
214 return (ply->
leaves[dst_address->
as_u8[dst_address_byte_index]]);
ip4_fib_mtrie_leaf_t leaves[256]
STATIC_ASSERT(0==sizeof(ip4_fib_mtrie_8_ply_t) % CLIB_CACHE_LINE_BYTES, "IP4 Mtrie ply cache line")
ip4_fib_mtrie_leaf_t leaves[PLY_16_SIZE]
i32 dst_address_bits_base
The length of the ply's covering prefix.
static u32 ip4_fib_mtrie_leaf_get_adj_index(ip4_fib_mtrie_leaf_t n)
From the stored slot value extract the LB index value.
void ip4_fib_mtrie_route_del(ip4_fib_mtrie_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
uword ip4_fib_mtrie_memory_usage(ip4_fib_mtrie_t *m)
return the memory used by the table
static ip4_fib_mtrie_leaf_t ip4_fib_mtrie_lookup_step_one(const ip4_fib_mtrie_t *m, const ip4_address_t *dst_address)
Lookup step number 1.
format_function_t format_ip4_fib_mtrie
Format/display the contents of the mtrie.
static ip4_fib_mtrie_leaf_t ip4_fib_mtrie_lookup_step(const ip4_fib_mtrie_t *m, ip4_fib_mtrie_leaf_t current_leaf, const ip4_address_t *dst_address, u32 dst_address_byte_index)
Lookup step.
struct ip4_fib_mtrie_8_ply_t_ ip4_fib_mtrie_8_ply_t
One ply of the 4 ply mtrie fib.
u8 dst_address_bits_of_leaves[256]
Prefix length for leaves/ply.
void ip4_mtrie_init(ip4_fib_mtrie_t *m)
Initialise an mtrie.
u8 pad[CLIB_CACHE_LINE_BYTES - 2 *sizeof(i32)]
#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_fib_mtrie_route_add(ip4_fib_mtrie_t *m, const ip4_address_t *dst_address, u32 dst_address_length, u32 adj_index)
Add a route/entry to the mtrie.
struct ip4_fib_mtrie_16_ply_t_ ip4_fib_mtrie_16_ply_t
void ip4_mtrie_free(ip4_fib_mtrie_t *m)
Free an mtrie, It must be emty when free'd.
u8 dst_address_bits_of_leaves[PLY_16_SIZE]
Prefix length for terminal leaves.
ip4_fib_mtrie_8_ply_t * ip4_ply_pool
A global pool of 8bit stride plys.
i32 n_non_empty_leafs
Number of non-empty leafs (whether terminal or not).
#define CLIB_CACHE_LINE_BYTES
One ply of the 4 ply mtrie fib.
static u32 ip4_fib_mtrie_leaf_is_terminal(ip4_fib_mtrie_leaf_t n)
Is the leaf terminal (i.e.
ip4_fib_mtrie_16_ply_t root_ply
Embed the PLY with the mtrie struct.