Commit 4b53b3b7 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

[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: default avatarStephen Hemminger <shemminger@osdl.org>
Signed-off-by: default avatarDavid S. Miller <davem@redhat.com>
parent 53a37077
...@@ -378,10 +378,8 @@ static unsigned long csz_update(struct Qdisc *sch) ...@@ -378,10 +378,8 @@ static unsigned long csz_update(struct Qdisc *sch)
unsigned long R_c; unsigned long R_c;
PSCHED_GET_TIME(now); 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) { if (delay>>q->delta_log) {
do_reset:
/* Delta is too large. /* Delta is too large.
It is possible if MTU/BW > 1<<q->delta_log It is possible if MTU/BW > 1<<q->delta_log
(i.e. configuration error) or because of hardware (i.e. configuration error) or because of hardware
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment