FD.io VPP
v16.09
Vector Packet Processing
|
Go to the source code of this file.
Data Structures | |
struct | l2fib_entry_key_t |
struct | l2fib_entry_result_t |
Macros | |
#define | L2FIB_NUM_BUCKETS (64 * 1024) |
#define | L2FIB_MEMORY_SIZE (256<<20) |
Functions | |
static u32 | l2fib_compute_hash_bucket (l2fib_entry_key_t *key) |
Compute the hash for the given key and return the corresponding bucket index. More... | |
static u64 | l2fib_make_key (u8 *mac_address, u16 bd_index) |
static_always_inline void | l2fib_lookup_1 (BVT(clib_bihash)*mac_table, l2fib_entry_key_t *cached_key, l2fib_entry_result_t *cached_result, u8 *mac0, u16 bd_index0, l2fib_entry_key_t *key0, u32 *bucket0, l2fib_entry_result_t *result0) |
Lookup the entry for mac and bd_index in the mac table for 1 packet. More... | |
static_always_inline void | l2fib_lookup_2 (BVT(clib_bihash)*mac_table, l2fib_entry_key_t *cached_key, l2fib_entry_result_t *cached_result, u8 *mac0, u8 *mac1, u16 bd_index0, u16 bd_index1, l2fib_entry_key_t *key0, l2fib_entry_key_t *key1, u32 *bucket0, u32 *bucket1, l2fib_entry_result_t *result0, l2fib_entry_result_t *result1) |
Lookup the entry for mac and bd_index in the mac table for 2 packets. More... | |
BVT (clib_bihash)*get_mac_table(void) | |
void | l2fib_clear_table (uint keep_static) |
void | l2fib_add_entry (u64 mac, u32 bd_index, u32 sw_if_index, u32 static_mac, u32 drop_mac, u32 bvi_mac) |
Add an entry to the l2fib. More... | |
u32 | l2fib_del_entry (u64 mac, u32 bd_index) |
Delete an entry from the l2fib. More... | |
void | l2fib_table_dump (u32 bd_index, l2fib_entry_key_t **l2fe_key, l2fib_entry_result_t **l2fe_res) |
u8 * | format_vnet_sw_if_index_name_with_NA (u8 *s, va_list *args) |
Format sw_if_index. More... | |
BVT | ( | clib_bihash | ) |
void l2fib_clear_table | ( | uint | keep_static | ) |
|
inlinestatic |
static_always_inline void l2fib_lookup_1 | ( | BVT(clib_bihash)* | mac_table, |
l2fib_entry_key_t * | cached_key, | ||
l2fib_entry_result_t * | cached_result, | ||
u8 * | mac0, | ||
u16 | bd_index0, | ||
l2fib_entry_key_t * | key0, | ||
u32 * | bucket0, | ||
l2fib_entry_result_t * | result0 | ||
) |
Lookup the entry for mac and bd_index in the mac table for 1 packet.
Cached_key and cached_result are used as a one-entry cache. The function reads and updates them as needed.
mac0 and bd_index0 are the keys. The entry is written to result0. If the entry was not found, result0 is set to ~0.
key0 and bucket0 return with the computed key and hash bucket, convenient if the entry needs to be updated afterward. If the cached_result was used, bucket0 is set to ~0.
Definition at line 138 of file l2_fib.h.
static_always_inline void l2fib_lookup_2 | ( | BVT(clib_bihash)* | mac_table, |
l2fib_entry_key_t * | cached_key, | ||
l2fib_entry_result_t * | cached_result, | ||
u8 * | mac0, | ||
u8 * | mac1, | ||
u16 | bd_index0, | ||
u16 | bd_index1, | ||
l2fib_entry_key_t * | key0, | ||
l2fib_entry_key_t * | key1, | ||
u32 * | bucket0, | ||
u32 * | bucket1, | ||
l2fib_entry_result_t * | result0, | ||
l2fib_entry_result_t * | result1 | ||
) |
Lookup the entry for mac and bd_index in the mac table for 2 packets.
The lookups for the two packets are interleaved.
Cached_key and cached_result are used as a one-entry cache. The function reads and updates them as needed.
mac0 and bd_index0 are the keys. The entry is written to result0. If the entry was not found, result0 is set to ~0. The same holds for mac1/bd_index1/result1.
Definition at line 184 of file l2_fib.h.
void l2fib_table_dump | ( | u32 | bd_index, |
l2fib_entry_key_t ** | l2fe_key, | ||
l2fib_entry_result_t ** | l2fe_res | ||
) |