18 #ifndef included_l2fib_h 19 #define included_l2fib_h 27 #define L2FIB_NUM_BUCKETS (64 * 1024) 28 #define L2FIB_MEMORY_SIZE (256<<20) 87 temp_a = key->
words.w0;
88 temp_b = key->
words.w1;
103 #if CLIB_ARCH_IS_LITTLE_ENDIAN 108 temp = *((
u64 *) (mac_address - 2));
109 temp = (temp & ~0xffff) | (
u64) (bd_index);
115 temp = *((
u64 *) (mac_address)) >> 16;
116 temp = temp | (((
u64) bd_index) << 48);
150 if (key0->
raw == cached_key->
raw)
153 result0->
raw = cached_result->
raw;
158 BVT (clib_bihash_kv) kv;
162 BV (clib_bihash_search_inline) (mac_table, &kv);
163 result0->
raw = kv.value;
166 cached_key->
raw = key0->
raw;
167 cached_result->
raw = result0->
raw;
202 if ((key0->
raw == cached_key->
raw) && (key1->
raw == cached_key->
raw))
205 result0->
raw = cached_result->
raw;
206 result1->
raw = cached_result->
raw;
213 BVT (clib_bihash_kv) kv0, kv1;
224 BV (clib_bihash_search_inline) (mac_table, &kv0);
225 BV (clib_bihash_search_inline) (mac_table, &kv1);
227 result0->
raw = kv0.value;
228 result1->
raw = kv1.value;
231 cached_key->
raw = key1->
raw;
232 cached_result->
raw = result1->
raw;
237 BVT (clib_bihash) * get_mac_table (
void);
244 u32 static_mac,
u32 drop_mac,
u32 bvi_mac);
struct l2fib_entry_key_t::@155::@158 words
#define static_always_inline
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.
BVT(clib_bihash)*get_mac_table(void)
#define L2FIB_NUM_BUCKETS
u32 l2fib_del_entry(u64 mac, u32 bd_index)
Delete an entry from the l2fib.
#define hash_mix32(a0, b0, c0)
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.
void l2fib_clear_table(uint keep_static)
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.
static u32 l2fib_compute_hash_bucket(l2fib_entry_key_t *key)
Compute the hash for the given key and return the corresponding bucket index.
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.