| To: | "David S. Miller" <davem@xxxxxxxxxxxxx> |
|---|---|
| Subject: | [PATCH 7/16] CBQ: Use gnet_stats for class statistics |
| From: | Thomas Graf <tgraf@xxxxxxx> |
| Date: | Thu, 21 Oct 2004 14:40:39 +0200 |
| Cc: | netdev@xxxxxxxxxxx, hadi@xxxxxxxxxx |
| In-reply-to: | <20041021123209.GE21977@postel.suug.ch> |
| References: | <20041021123209.GE21977@postel.suug.ch> |
| Sender: | netdev-bounce@xxxxxxxxxxx |
Converts CBQ class statistics counters to gnet_stats
structures.
Signed-off-by: Thomas Graf <tgraf@xxxxxxx>
--- linux-2.6.9-rc5.orig/net/sched/sch_cbq.c 2004-10-21 12:45:47.000000000
+0200
+++ linux-2.6.9-rc5/net/sched/sch_cbq.c 2004-10-21 12:57:37.000000000 +0200
@@ -146,7 +146,9 @@
long avgidle;
long deficit; /* Saved deficit for WRR */
unsigned long penalized;
- struct tc_stats stats;
+ struct gnet_stats_basic bstats;
+ struct gnet_stats_queue qstats;
+ struct gnet_stats_rate_est rate_est;
spinlock_t *stats_lock;
struct tc_cbq_xstats xstats;
@@ -448,7 +450,7 @@
kfree_skb(skb);
else {
cbq_mark_toplevel(q, cl);
- cl->stats.drops++;
+ cl->qstats.drops++;
}
#else
if ( NET_XMIT_DROP == ret) {
@@ -457,7 +459,7 @@
if (cl != NULL) {
cbq_mark_toplevel(q, cl);
- cl->stats.drops++;
+ cl->qstats.drops++;
}
#endif
return ret;
@@ -491,7 +493,7 @@
return 0;
}
sch->qstats.drops++;
- cl->stats.drops++;
+ cl->qstats.drops++;
return ret;
}
@@ -789,8 +791,8 @@
long avgidle = cl->avgidle;
long idle;
- cl->stats.packets++;
- cl->stats.bytes += len;
+ cl->bstats.packets++;
+ cl->bstats.bytes += len;
/*
(now - last) is total time between packet right edges.
@@ -888,7 +890,7 @@
no another solution exists.
*/
if ((cl = cl->borrow) == NULL) {
- this_cl->stats.overlimits++;
+ this_cl->qstats.overlimits++;
this_cl->overlimit(this_cl);
return NULL;
}
|
| Previous by Date: | [PATCH 6/16] PKT_SCHED: Add dump_stats class op, Thomas Graf |
|---|---|
| Next by Date: | [PATCH 8/16] CBQ: Use dump_stats for class statistics dumping, Thomas Graf |
| Previous by Thread: | [PATCH 6/16] PKT_SCHED: Add dump_stats class op, Thomas Graf |
| Next by Thread: | [PATCH 8/16] CBQ: Use dump_stats for class statistics dumping, Thomas Graf |
| Indexes: | [Date] [Thread] [Top] [All Lists] |