summaryrefslogtreecommitdiff
path: root/zebra/interface.c
diff options
context:
space:
mode:
authorJafar Al-Gharaibeh <jafar@atcorp.com>2022-01-21 09:01:42 -0600
committerGitHub <noreply@github.com>2022-01-21 09:01:42 -0600
commitcdaa204effe98908a2396b528fdfe0d8dfe4393c (patch)
tree7943c9b7a689662f315823ea1fa912816994b823 /zebra/interface.c
parentc63f4b0ffdd1fd4c08f6ccc15fa3144a6cd4d4ea (diff)
parente8b3a2f74b707529c70908c6afc97a486588ef30 (diff)
Merge pull request #8011 from donaldsharp/starvation
lib: Figure out if we are being starved for cpu
Diffstat (limited to 'zebra/interface.c')
-rw-r--r--zebra/interface.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/zebra/interface.c b/zebra/interface.c
index 8b5dbabb92..534953d903 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -91,9 +91,12 @@ static int if_zebra_speed_update(struct thread *thread)
changed = true;
}
- if (changed || new_speed == UINT32_MAX)
+ if (changed || new_speed == UINT32_MAX) {
thread_add_timer(zrouter.master, if_zebra_speed_update, ifp, 5,
&zif->speed_update);
+ thread_ignore_late_timer(zif->speed_update);
+ }
+
return 1;
}
@@ -187,6 +190,8 @@ static int if_zebra_new_hook(struct interface *ifp)
*/
thread_add_timer(zrouter.master, if_zebra_speed_update, ifp, 15,
&zebra_if->speed_update);
+ thread_ignore_late_timer(zebra_if->speed_update);
+
return 0;
}
@@ -1074,6 +1079,7 @@ void if_up(struct interface *ifp)
thread_add_timer(zrouter.master, if_zebra_speed_update, ifp, 0,
&zif->speed_update);
+ thread_ignore_late_timer(zif->speed_update);
}
/* Interface goes down. We have to manage different behavior of based