From patchwork Fri May 11 22:31:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 158622 X-Patchwork-Delegate: davem@davemloft.net 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 2A3E4B6FC3 for ; Sat, 12 May 2012 08:31:46 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030199Ab2EKWbk (ORCPT ); Fri, 11 May 2012 18:31:40 -0400 Received: from mail-we0-f174.google.com ([74.125.82.174]:53124 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761095Ab2EKWbi (ORCPT ); Fri, 11 May 2012 18:31:38 -0400 Received: by weyu7 with SMTP id u7so678153wey.19 for ; Fri, 11 May 2012 15:31:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:from:to:cc:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=PpYlu3eUoBQT76WLfP70vY0j3+essWNGomPprVjakO0=; b=Zz7U4V62AzqODq6z5MtvHO1l8lM/RMenhHzszFnQrVtPvQpaN810IrrrJnqZDDVlsc OswesqNcKiZT/NxSJnjJRQbmtmFhtMPVr00ZRAf6fmL/Tu2XLNeyd69rwCmOJkezzG8s /1DrZeeaOEuhtZiupi1mkhB7/EZaVh3ObpkfIYDJqs/sLdLPlWd0PmE65Dy1PRl96fCp Z/XrimbzlQir0QQQikbu7IdxGni77ApRirDcRJwDFFBhplLgKnIT/fVfYz1kK+1ti+3O qcw/JBYDKEqiLujQlcRTPg72LE4DsDPl2BD25X9fpTovIqvLk3N2eQpwZTWdU9rOcrYV l69g== Received: by 10.180.101.230 with SMTP id fj6mr11698226wib.13.1336775496750; Fri, 11 May 2012 15:31:36 -0700 (PDT) Received: from [192.168.179.128] ([74.125.122.49]) by mx.google.com with ESMTPS id fo7sm13824782wib.9.2012.05.11.15.31.35 (version=SSLv3 cipher=OTHER); Fri, 11 May 2012 15:31:35 -0700 (PDT) Subject: [PATCH net-next] sch_htb: report backlog information in htb classes From: Eric Dumazet To: David Miller Cc: netdev Date: Sat, 12 May 2012 00:31:34 +0200 Message-ID: <1336775494.31653.297.camel@edumazet-glaptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Eric Dumazet htb classes at level 0 can copy their qdisc child backlog to provide to "tc -s class" users more relevant information. (packet counter is correct but byte counter (backlog) is 0) Signed-off-by: Eric Dumazet --- net/sched/sch_htb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 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/net/sched/sch_htb.c b/net/sched/sch_htb.c index 9d75b77..0f4d534 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c @@ -1073,9 +1073,10 @@ static int htb_dump_class(struct Qdisc *sch, unsigned long arg, spin_lock_bh(root_lock); tcm->tcm_parent = cl->parent ? cl->parent->common.classid : TC_H_ROOT; tcm->tcm_handle = cl->common.classid; - if (!cl->level && cl->un.leaf.q) + if (!cl->level && cl->un.leaf.q) { tcm->tcm_info = cl->un.leaf.q->handle; - + sch->qstats.backlog = cl->un.leaf.q->qstats.backlog; + } nest = nla_nest_start(skb, TCA_OPTIONS); if (nest == NULL) goto nla_put_failure;