]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Modify way we query for inteface speed
authorDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 13 Jul 2019 19:28:50 +0000 (15:28 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 13 Jul 2019 19:42:41 +0000 (15:42 -0400)
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>
zebra/interface.c

index 719cf05db1d1f5a07b8c3b892e9ddce82847ae3f..4eec435f1cc7eb483a476d25cca057de8393744f 100644 (file)
@@ -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;
 }