aboutsummaryrefslogtreecommitdiffstats
path: root/vnet/vnet/interface.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2016-11-21 12:25:22 +0000
committerDamjan Marion <dmarion.lists@gmail.com>2016-11-21 14:18:09 +0000
commit8b37b8732d5f9883ab594fc0ba2b5be21c27c4fd (patch)
tree5cf5accc899d67e874fecdb14150e1bacdec211e /vnet/vnet/interface.c
parentc008ee186b13a1246f265372679f5a80970387b5 (diff)
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 <nranns@cisco.com>
Diffstat (limited to 'vnet/vnet/interface.c')
-rw-r--r--vnet/vnet/interface.c43
1 files changed, 36 insertions, 7 deletions
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)
{