From 8f08b1cc31d28261eef6b9c0b3567aeecd44bd8d Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sat, 13 Jul 2019 15:28:50 -0400 Subject: [PATCH] zebra: Modify way we query for inteface speed Initial commit of understanding interface speed changes on startup was this commit: dc7b3caefbd8baccb7fc3787a774e78d1a96636f Effectively we had encountered situations on system startup where the interface speed for a device was not properly setup when zebra learns about the interface ( Imagine a bond being brought up and the controlling software creating the bond is not fast given system load, the bond's speed changes upwards for each interface added ). The initial workup on this was to allow a 15 second window and then just reread the interface speed. We've since noticed that under heavy system load on startup this is not always sufficient. So modify the code to wait the 15 seconds and then check the interfaces speed. If the interfaces speed is still MAX_UINT32T or it has changed let's wait a bit longer and try again. Signed-off-by: Donald Sharp --- zebra/interface.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zebra/interface.c b/zebra/interface.c index 719cf05db1..4eec435f1c 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -69,6 +69,7 @@ static int if_zebra_speed_update(struct thread *thread) struct interface *ifp = THREAD_ARG(thread); struct zebra_if *zif = ifp->info; uint32_t new_speed; + bool changed = false; zif->speed_update = NULL; @@ -79,8 +80,12 @@ static int if_zebra_speed_update(struct thread *thread) new_speed); ifp->speed = new_speed; if_add_update(ifp); + changed = true; } + if (changed || new_speed == UINT32_MAX) + thread_add_timer(zrouter.master, if_zebra_speed_update, ifp, 5, + &zif->speed_update); return 1; }