netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] (2/4) packet scheduler bad TDIFF_SAFE in csz
@ 2004-06-29 21:00 Stephen Hemminger
  2004-06-29 21:45 ` David S. Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2004-06-29 21:00 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev

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>


diff -Nru a/net/sched/sch_csz.c b/net/sched/sch_csz.c
--- a/net/sched/sch_csz.c	2004-06-29 11:32:40 -07:00
+++ b/net/sched/sch_csz.c	2004-06-29 11:32:40 -07:00
@@ -378,10 +378,8 @@
 	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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-06-29 22:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-29 21:00 [PATCH] (2/4) packet scheduler bad TDIFF_SAFE in csz Stephen Hemminger
2004-06-29 21:45 ` David S. Miller
2004-06-29 22:22   ` jamal
2004-06-29 22:28     ` David S. Miller
2004-06-29 22:43       ` jamal
2004-06-29 22:49         ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).