diff options
author | 2017-03-24 20:11:15 -0400 | |
---|---|---|
committer | 2017-03-28 22:36:13 +0000 | |
commit | 58f061dca4cb049410a72bb21a9643f7acffa738 (patch) | |
tree | 3871125ca8e4df0809f06e9fad66badce823d78f /src/vnet/l2/l2_fib.h | |
parent | 45e526f36fb43f0b2c86d136ab563a3c5c412546 (diff) |
Implement MAC Flush for BD or Interface from the L2FIB
Allow non-static MACs in the L2FIB which is associated with an
interface or a bridge domain (BD) be flushed. MAC flush are
initiated automatically when an interface is removed from a BD
or when a BD is deleted. MAC flush can also be invoked manually
via the following CLI:
l2fib mac-flush interface <if-name>
l2fib mac-flush bridge-domain <bd-id>
Change-Id: Ie33243622834810a765f48ebcd22bdb8e8fc87a4
Signed-off-by: John Lo <loj@cisco.com>
Diffstat (limited to 'src/vnet/l2/l2_fib.h')
-rw-r--r-- | src/vnet/l2/l2_fib.h | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/src/vnet/l2/l2_fib.h b/src/vnet/l2/l2_fib.h index 4a2da59bc01..7e49d74baf8 100644 --- a/src/vnet/l2/l2_fib.h +++ b/src/vnet/l2/l2_fib.h @@ -66,7 +66,8 @@ typedef struct u8 filter:1; /* drop packets to/from this mac */ u8 unused1:5; u8 timestamp; /* timestamp for aging */ - u16 unused2; + u8 int_sn; /* interface seq num */ + u8 bd_sn; /* bridge domain seq num */ } fields; u64 raw; }; @@ -313,22 +314,28 @@ l2fib_lookup_4 (BVT (clib_bihash) * mac_table, } } +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); + +u32 l2fib_del_entry (u64 mac, u32 bd_index); + +void l2fib_start_ager_scan (vlib_main_t * vm); + +void l2fib_flush_int_mac (vlib_main_t * vm, u32 sw_if_index); + +void l2fib_flush_bd_mac (vlib_main_t * vm, u32 bd_index); + +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); + 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); -u32 -l2fib_del_entry (u64 mac, u32 bd_index); - - 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); #endif |