From 8b37b8732d5f9883ab594fc0ba2b5be21c27c4fd Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Mon, 21 Nov 2016 12:25:22 +0000 Subject: Convergence Improvements addressing convergence times when interface is shut. 1) prioritise the registered callback handlers. Add FIB convergence handler as high priority 2) hook the FIB convergence call-back into HW link down. 3) don't schedule a walk of a FIB node if it has no children 4) Checks at fib_path_t to prevent unnecessary walks, that it prevent the same information propagting the graph multiple times. Change-Id: I406966b50f31d77c221821b8649776d66655194c Signed-off-by: Neale Ranns --- vnet/vnet/interface.c | 43 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 7 deletions(-) (limited to 'vnet/vnet/interface.c') diff --git a/vnet/vnet/interface.c b/vnet/vnet/interface.c index 97855d53d73..33827e2b673 100644 --- a/vnet/vnet/interface.c +++ b/vnet/vnet/interface.c @@ -240,17 +240,25 @@ unserialize_vnet_interface_state (serialize_main_t * m, va_list * va) static clib_error_t * call_elf_section_interface_callbacks (vnet_main_t * vnm, u32 if_index, u32 flags, - _vnet_interface_function_list_elt_t * - elt) + _vnet_interface_function_list_elt_t ** + elts) { + _vnet_interface_function_list_elt_t *elt; + vnet_interface_function_priority_t prio; clib_error_t *error = 0; - while (elt) + for (prio = VNET_ITF_FUNC_PRIORITY_LOW; + prio <= VNET_ITF_FUNC_PRIORITY_HIGH; prio++) { - error = elt->fp (vnm, if_index, flags); - if (error) - return error; - elt = elt->next_interface_function; + elt = elts[prio]; + + while (elt) + { + error = elt->fp (vnm, if_index, flags); + if (error) + return error; + elt = elt->next_interface_function; + } } return error; } @@ -888,6 +896,27 @@ vnet_delete_hw_interface (vnet_main_t * vnm, u32 hw_if_index) pool_put (im->hw_interfaces, hw); } +void +vnet_hw_interface_walk_sw (vnet_main_t * vnm, + u32 hw_if_index, + vnet_hw_sw_interface_walk_t fn, void *ctx) +{ + vnet_hw_interface_t *hi; + u32 id, sw_if_index; + + hi = vnet_get_hw_interface (vnm, hw_if_index); + /* the super first, then the and sub interfaces */ + fn (vnm, hi->sw_if_index, ctx); + + /* *INDENT-OFF* */ + hash_foreach (id, sw_if_index, + hi->sub_interface_sw_if_index_by_id, + ({ + fn (vnm, sw_if_index, ctx); + })); + /* *INDENT-ON* */ +} + static void serialize_vnet_hw_interface_set_class (serialize_main_t * m, va_list * va) { -- cgit 1.2.3-korg