netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Graf <tgraf@suug.ch>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@oss.sgi.com, hadi@cyberus.ca
Subject: [PATCH 1/16] PKT_SCHED: Requeues statistics
Date: Thu, 21 Oct 2004 14:33:40 +0200	[thread overview]
Message-ID: <20041021123340.GF21977@postel.suug.ch> (raw)
In-Reply-To: <20041021123209.GE21977@postel.suug.ch>

Introduces requeue statistics for qdiscs. Patch is based on a
patch of Jamal Hadi Salim and adapted to new statistic API.

Signed-off-by: Thomas Graf <tgraf@suug.ch>


--- linux-2.6.9-rc5.orig/net/sched/sch_atm.c	2004-10-21 10:45:08.000000000 +0200
+++ linux-2.6.9-rc5/net/sched/sch_atm.c	2004-10-21 11:01:21.000000000 +0200
@@ -545,8 +545,10 @@
 
 	D2PRINTK("atm_tc_requeue(skb %p,sch %p,[qdisc %p])\n",skb,sch,p);
 	ret = p->link.q->ops->requeue(skb,p->link.q);
-	if (!ret) sch->q.qlen++;
-	else {
+	if (!ret) {
+        sch->q.qlen++;
+        sch->qstats.requeues++;
+    } else {
 		sch->qstats.drops++;
 		p->link.stats.drops++;
 	}
--- linux-2.6.9-rc5.orig/net/sched/sch_cbq.c	2004-10-21 10:45:08.000000000 +0200
+++ linux-2.6.9-rc5/net/sched/sch_cbq.c	2004-10-21 10:52:50.000000000 +0200
@@ -485,6 +485,7 @@
 #endif
 	if ((ret = cl->q->ops->requeue(skb, cl->q)) == 0) {
 		sch->q.qlen++;
+		sch->qstats.requeues++;
 		if (!cl->next_alive)
 			cbq_activate_class(cl);
 		return 0;
--- linux-2.6.9-rc5.orig/net/sched/sch_dsmark.c	2004-10-21 10:45:08.000000000 +0200
+++ linux-2.6.9-rc5/net/sched/sch_dsmark.c	2004-10-21 10:52:50.000000000 +0200
@@ -297,6 +297,7 @@
 	D2PRINTK("dsmark_requeue(skb %p,sch %p,[qdisc %p])\n",skb,sch,p);
         if ((ret = p->q->ops->requeue(skb, p->q)) == 0) {
 		sch->q.qlen++;
+		sch->qstats.requeues++;
 		return 0;
 	}
 	sch->qstats.drops++;
--- linux-2.6.9-rc5.orig/net/sched/sch_fifo.c	2004-10-21 10:45:08.000000000 +0200
+++ linux-2.6.9-rc5/net/sched/sch_fifo.c	2004-10-21 10:52:50.000000000 +0200
@@ -67,6 +67,7 @@
 {
 	__skb_queue_head(&sch->q, skb);
 	sch->qstats.backlog += skb->len;
+	sch->qstats.requeues++;
 	return 0;
 }
 
@@ -126,6 +127,7 @@
 pfifo_requeue(struct sk_buff *skb, struct Qdisc* sch)
 {
 	__skb_queue_head(&sch->q, skb);
+	sch->qstats.requeues++;
 	return 0;
 }
 
--- linux-2.6.9-rc5.orig/net/sched/sch_generic.c	2004-10-21 10:45:08.000000000 +0200
+++ linux-2.6.9-rc5/net/sched/sch_generic.c	2004-10-21 10:52:50.000000000 +0200
@@ -353,6 +353,7 @@
 
 	__skb_queue_head(list, skb);
 	qdisc->q.qlen++;
+	qdisc->qstats.requeues++;
 	return 0;
 }
 
--- linux-2.6.9-rc5.orig/net/sched/sch_gred.c	2004-10-21 10:45:08.000000000 +0200
+++ linux-2.6.9-rc5/net/sched/sch_gred.c	2004-10-21 10:52:50.000000000 +0200
@@ -222,6 +222,7 @@
 
 	__skb_queue_head(&sch->q, skb);
 	sch->qstats.backlog += skb->len;
+	sch->qstats.requeues++;
 	q->backlog += skb->len;
 	return 0;
 }
--- linux-2.6.9-rc5.orig/net/sched/sch_hfsc.c	2004-10-21 10:45:08.000000000 +0200
+++ linux-2.6.9-rc5/net/sched/sch_hfsc.c	2004-10-21 10:52:50.000000000 +0200
@@ -1779,6 +1779,7 @@
 
 	__skb_queue_head(&q->requeue, skb);
 	sch->q.qlen++;
+	sch->qstats.requeues++;
 	return NET_XMIT_SUCCESS;
 }
 
--- linux-2.6.9-rc5.orig/net/sched/sch_htb.c	2004-10-21 10:45:08.000000000 +0200
+++ linux-2.6.9-rc5/net/sched/sch_htb.c	2004-10-21 10:52:50.000000000 +0200
@@ -794,6 +794,7 @@
 	    htb_activate (q,cl);
 
     sch->q.qlen++;
+    sch->qstats.requeues++;
     HTB_DBG(1,1,"htb_req_ok cl=%X skb=%p\n",(cl && cl != HTB_DIRECT)?cl->classid:0,skb);
     return NET_XMIT_SUCCESS;
 }
--- linux-2.6.9-rc5.orig/net/sched/sch_netem.c	2004-10-21 10:45:08.000000000 +0200
+++ linux-2.6.9-rc5/net/sched/sch_netem.c	2004-10-21 10:52:50.000000000 +0200
@@ -211,8 +211,10 @@
 	struct netem_sched_data *q = qdisc_priv(sch);
 	int ret;
 
-	if ((ret = q->qdisc->ops->requeue(skb, q->qdisc)) == 0)
+	if ((ret = q->qdisc->ops->requeue(skb, q->qdisc)) == 0) {
 		sch->q.qlen++;
+		sch->qstats.requeues++;
+	}
 
 	return ret;
 }
--- linux-2.6.9-rc5.orig/net/sched/sch_prio.c	2004-10-21 10:45:08.000000000 +0200
+++ linux-2.6.9-rc5/net/sched/sch_prio.c	2004-10-21 10:52:50.000000000 +0200
@@ -139,6 +139,7 @@
 
 	if ((ret = qdisc->ops->requeue(skb, qdisc)) == 0) {
 		sch->q.qlen++;
+		sch->qstats.requeues++;
 		return 0;
 	}
 dropped:
--- linux-2.6.9-rc5.orig/net/sched/sch_red.c	2004-10-21 10:45:08.000000000 +0200
+++ linux-2.6.9-rc5/net/sched/sch_red.c	2004-10-21 10:52:50.000000000 +0200
@@ -309,6 +309,7 @@
 
 	__skb_queue_head(&sch->q, skb);
 	sch->qstats.backlog += skb->len;
+	sch->qstats.requeues++;
 	return 0;
 }
 
--- linux-2.6.9-rc5.orig/net/sched/sch_sfq.c	2004-10-21 10:45:08.000000000 +0200
+++ linux-2.6.9-rc5/net/sched/sch_sfq.c	2004-10-21 10:52:50.000000000 +0200
@@ -310,8 +310,10 @@
 			q->tail = x;
 		}
 	}
-	if (++sch->q.qlen < q->limit - 1)
+	if (++sch->q.qlen < q->limit - 1) {
+		sch->qstats.requeues++;
 		return 0;
+	}
 
 	sch->qstats.drops++;
 	sfq_drop(sch);
--- linux-2.6.9-rc5.orig/net/sched/sch_tbf.c	2004-10-21 10:45:08.000000000 +0200
+++ linux-2.6.9-rc5/net/sched/sch_tbf.c	2004-10-21 10:52:50.000000000 +0200
@@ -166,8 +166,10 @@
 	struct tbf_sched_data *q = qdisc_priv(sch);
 	int ret;
 
-	if ((ret = q->qdisc->ops->requeue(skb, q->qdisc)) == 0)
+	if ((ret = q->qdisc->ops->requeue(skb, q->qdisc)) == 0) {
 		sch->q.qlen++;
+		sch->qstats.requeues++;
+	}
 
 	return ret;
 }
--- linux-2.6.9-rc5.orig/net/sched/sch_teql.c	2004-10-21 10:45:08.000000000 +0200
+++ linux-2.6.9-rc5/net/sched/sch_teql.c	2004-10-21 10:52:50.000000000 +0200
@@ -113,6 +113,7 @@
 	struct teql_sched_data *q = qdisc_priv(sch);
 
 	__skb_queue_head(&q->q, skb);
+	sch->qstats.requeues++;
 	return 0;
 }
 

  reply	other threads:[~2004-10-21 12:33 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-21 12:32 [PATCHSET 0/16] More gnet_stats conversions Thomas Graf
2004-10-21 12:33 ` Thomas Graf [this message]
2004-10-21 12:34 ` [PATCH 2/16] PKT_SCHED: Max TLV types cleanup Thomas Graf
2004-10-21 12:36 ` [PATCH 3/16] PKT_SCHED: Add dump_stats qdisc op Thomas Graf
2004-10-21 12:37 ` [PATCH 4/16] CBQ: use dump_stats Thomas Graf
2004-10-21 12:38 ` [PATCH 5/16] RED: " Thomas Graf
2004-10-21 12:39 ` [PATCH 6/16] PKT_SCHED: Add dump_stats class op Thomas Graf
2004-10-21 12:40 ` [PATCH 7/16] CBQ: Use gnet_stats for class statistics Thomas Graf
2004-10-21 12:43 ` [PATCH 8/16] CBQ: Use dump_stats for class statistics dumping Thomas Graf
2004-10-21 12:44 ` [PATCH 9/16] CBQ: Use generic rate estimator Thomas Graf
2004-10-21 12:45 ` [PATCH 10/16] HTB: Use gnet_stats for class statistics Thomas Graf
2004-10-21 12:46 ` [PATCH 11/16] HTB: Use dump_stats for class statistics dumping Thomas Graf
2004-10-21 12:47 ` [PATCH 12/16] HTB: Remove unneeded rate estimator bits Thomas Graf
2004-10-21 12:48 ` [PATCH 13/16] HFSC: Use gnet_stats for class statistics Thomas Graf
2004-10-21 12:49 ` [PATCH 14/16] HFSC: Use generic rate estimator Thomas Graf
2004-10-21 12:51 ` [PATCH 15/16] HFSC: Use dump_stats for class statistics dumping Thomas Graf
2004-10-21 12:52 ` [PATCH 16/16] ATM: Use gnet_stats for class statistics and dump them Thomas Graf
2004-10-21 15:42   ` [RESEND " Thomas Graf
2004-10-21 19:42 ` [PATCH] iproute2: support generic statistics and add requeues statistics Thomas Graf
2004-10-22  5:48 ` [PATCHSET 0/16] More gnet_stats conversions David S. Miller
2004-10-22 11:08   ` jamal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041021123340.GF21977@postel.suug.ch \
    --to=tgraf@suug.ch \
    --cc=davem@davemloft.net \
    --cc=hadi@cyberus.ca \
    --cc=netdev@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).