zebra: Modify way we query for inteface speed

Initial commit of understanding interface speed changes
on startup was this commit:

dc7b3caefb

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 <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2019-07-13 15:28:50 -04:00
parent 96e109772d
commit 8f08b1cc31

View File

@ -69,6 +69,7 @@ static int if_zebra_speed_update(struct thread *thread)
struct interface *ifp = THREAD_ARG(thread); struct interface *ifp = THREAD_ARG(thread);
struct zebra_if *zif = ifp->info; struct zebra_if *zif = ifp->info;
uint32_t new_speed; uint32_t new_speed;
bool changed = false;
zif->speed_update = NULL; zif->speed_update = NULL;
@ -79,8 +80,12 @@ static int if_zebra_speed_update(struct thread *thread)
new_speed); new_speed);
ifp->speed = new_speed; ifp->speed = new_speed;
if_add_update(ifp); 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; return 1;
} }