summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-07-13 15:28:50 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2019-07-13 15:42:41 -0400
commit8f08b1cc31d28261eef6b9c0b3567aeecd44bd8d (patch)
tree71fb3036d1474cc4cb416b6584a19fa925942a26
parent96e109772d064e9df9ce208b53f7ff1872e1c427 (diff)
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 <sharpd@cumulusnetworks.com>
-rw-r--r--zebra/interface.c5
1 files changed, 5 insertions, 0 deletions
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;
}