Permalink
Browse files

if ticks diverge from ifq_congestion too far the diff will go negative

detect this and bump ifq_congestion forward rather than claim the
system is congested for a long period of time.

ok mpi@ henning@ jmatthew@
  • Loading branch information...
dlg
dlg committed Mar 16, 2016
1 parent a1d8423 commit d0b51642ac65fc549021b57e7692e1b0513937af
Showing with 9 additions and 2 deletions.
  1. +9 −2 sys/net/if.c
View
@@ -1,4 +1,4 @@
/* $OpenBSD: if.c,v 1.428 2016/03/07 18:44:00 naddy Exp $ */
/* $OpenBSD: if.c,v 1.429 2016/03/16 12:08:09 dlg Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -1130,8 +1130,15 @@ int
if_congested(void)
{
extern int ticks;
int diff;
return (ticks - ifq_congestion <= (hz / 100));
diff = ticks - ifq_congestion;
if (diff < 0) {
ifq_congestion = ticks - hz;
return (0);
}
return (diff <= (hz / 100));
}
#define equal(a1, a2) \

0 comments on commit d0b5164

Please sign in to comment.