From 0cf67ead7bdc95700958b9cfd341b75b4432bb88 Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Thu, 1 Dec 2011 12:04:31 +0100 Subject: [PATCH] red: give a hint about burst value Check for burst values that are too small. Reported-by: Dave Taht Signed-off-by: Eric Dumazet --- tc/tc_red.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tc/tc_red.c b/tc/tc_red.c index 66658cac..81a83bd2 100644 --- a/tc/tc_red.c +++ b/tc/tc_red.c @@ -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;