From patchwork Thu Dec 1 11:04:31 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 128681 X-Patchwork-Delegate: shemminger@vyatta.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id A90ED1007D1 for ; Thu, 1 Dec 2011 22:04:44 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753185Ab1LALEf (ORCPT ); Thu, 1 Dec 2011 06:04:35 -0500 Received: from mail-qy0-f174.google.com ([209.85.216.174]:50751 "EHLO mail-qy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753064Ab1LALEe (ORCPT ); Thu, 1 Dec 2011 06:04:34 -0500 Received: by qyk7 with SMTP id 7so165553qyk.19 for ; Thu, 01 Dec 2011 03:04:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:subject:from:to:cc:date:in-reply-to:references :content-type:x-mailer:content-transfer-encoding:mime-version; bh=UI5Ib+GZ23igZmelhC2Hi79LRtT9DXuVa+oVYnYLq18=; b=Mf10RoQPirnrFwDow4/QsKzEYSC+NDqxRCvP/Rtz+VXBiZLzT4CAbiU1qjqEUAsHIo MJS57E3pPKBoUmWlCRJP+d5myCKI44wRdMNcbjEnk4pXjF4bKiMZHb7+4a+vCDbkbrMF Ed9+HGuJOdgk6PBuvQeapErcQJ0/R0E9vZIGw= Received: by 10.229.64.144 with SMTP id e16mr1126937qci.112.1322737473821; Thu, 01 Dec 2011 03:04:33 -0800 (PST) Received: from [10.150.51.215] (gw0.net.jmsp.net. [212.23.165.14]) by mx.google.com with ESMTPS id ha3sm5290528qab.2.2011.12.01.03.04.32 (version=SSLv3 cipher=OTHER); Thu, 01 Dec 2011 03:04:33 -0800 (PST) Message-ID: <1322737471.2335.25.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC> Subject: [PATCH iproute2] red: give a hint about burst value From: Eric Dumazet To: Dave Taht Cc: David Miller , netdev , Stephen Hemminger Date: Thu, 01 Dec 2011 12:04:31 +0100 In-Reply-To: <1322693086.2602.28.camel@edumazet-laptop> References: <1322688891.2602.15.camel@edumazet-laptop> <1322689213.2602.18.camel@edumazet-laptop> <1322691053.2602.24.camel@edumazet-laptop> <1322693086.2602.28.camel@edumazet-laptop> X-Mailer: Evolution 3.2.1- Mime-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Le mercredi 30 novembre 2011 à 23:44 +0100, Eric Dumazet a écrit : > Le mercredi 30 novembre 2011 à 23:35 +0100, Dave Taht a écrit : > > > One of my other problems is when I try to size red (or choke) appropriately > > (or so I think) for GigE bandwidths and queue depths, it would fail > > to calculate the ewma value. > > Do you have one example of such failure ? > Oh I understand your burst value is really too small. Stephen, can we add this helper to iproute2 ? [PATCH iproute2] red: try to give hint about burst value Reported-by: Dave Taht Signed-off-by: Eric Dumazet --- -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/tc/tc_red.c b/tc/tc_red.c index 66658ca..a65435e 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;