netdev
[Top] [All Lists]

[PATCH] (2/4) packet scheduler bad TDIFF_SAFE in csz

To: "David S. Miller" <davem@xxxxxxxxxx>
Subject: [PATCH] (2/4) packet scheduler bad TDIFF_SAFE in csz
From: Stephen Hemminger <shemminger@xxxxxxxx>
Date: Tue, 29 Jun 2004 14:00:16 -0700
Cc: netdev@xxxxxxxxxxx
Organization: Open Source Development Lab
Sender: netdev-bounce@xxxxxxxxxxx
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@xxxxxxxx>


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

<Prev in Thread] Current Thread [Next in Thread>