diff options
| author | Stephen Hemminger <shemminger@osdl.org> | 2004-06-29 00:38:31 -0700 |
|---|---|---|
| committer | David S. Miller <davem@nuts.davemloft.net> | 2004-06-29 00:38:31 -0700 |
| commit | 4b53b3b771cee1f7c1c47ff6ad345bf7ff4c5311 (patch) | |
| tree | 22391a0d45d48c82d800ea0f81f39beaa3d30c76 | |
| parent | 53a3707761ddcc7c79c675854c5d5c2e38a111ca (diff) | |
[PKT_SCHED]: Bad TDIFF_SAFE in csz.
This code in the csz scheduler, is just plain broken. The TDIFF_SAFE
effectively expands to:
unsigned long delay = now - q->t_c;
if (delay > 0) {
delay = 0;
goto do_reset;
}
if (delay >> q->delta_log)
So delay is always 0! I assume that what was originally intended
is the to keep delay bounded to 1<<q->delta_log.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: David S. Miller <davem@redhat.com>
| -rw-r--r-- | net/sched/sch_csz.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/net/sched/sch_csz.c b/net/sched/sch_csz.c index 3d9a5538b5ab..d0f8d51fedf8 100644 --- a/net/sched/sch_csz.c +++ b/net/sched/sch_csz.c @@ -378,10 +378,8 @@ static unsigned long csz_update(struct Qdisc *sch) unsigned long R_c; PSCHED_GET_TIME(now); - delay = PSCHED_TDIFF_SAFE(now, q->t_c, 0, goto do_reset); - + delay = PSCHED_TDIFF(now, q->t_c); if (delay>>q->delta_log) { -do_reset: /* Delta is too large. It is possible if MTU/BW > 1<<q->delta_log (i.e. configuration error) or because of hardware |
