]> rtime.felk.cvut.cz Git - lisovros/iproute2_canprio.git/commitdiff
red: give a hint about burst value
authorEric Dumazet <eric.dumazet@gmail.com>
Thu, 1 Dec 2011 11:04:31 +0000 (12:04 +0100)
committerStephen Hemminger <shemminger@vyatta.com>
Thu, 1 Dec 2011 17:23:43 +0000 (09:23 -0800)
Check for burst values that are too small.

Reported-by: Dave Taht <dave.taht@gmail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
tc/tc_red.c

index 66658caccb09be4ea30f9e86460a9e5627092841..81a83bd2ea09a3da62e4a56e6cfdf595265e5f43 100644 (file)
@@ -56,8 +56,11 @@ int tc_red_eval_ewma(unsigned qmin, unsigned burst, unsigned avpkt)
        double W = 0.5;
        double a = (double)burst + 1 - (double)qmin/avpkt;
 
-       if (a < 1.0)
+       if (a < 1.0) {
+               fprintf(stderr, "tc_red_eval_ewma() burst %u is too small ?"
+                               " Try burst %u\n", burst, 1 + qmin/avpkt);
                return -1;
+       }
        for (wlog=1; wlog<32; wlog++, W /= 2) {
                if (a <= (1 - pow(1-W, burst))/W)
                        return wlog;