Commit ddbde508 authored by Thomas Graf's avatar Thomas Graf Committed by David S. Miller

[PKT_SCHED]: CBQ: Use gnet_stats for class statistics

Converts CBQ class statistics counters to gnet_stats
structures.
Signed-off-by: default avatarThomas Graf <tgraf@suug.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ec220224
...@@ -146,7 +146,9 @@ struct cbq_class ...@@ -146,7 +146,9 @@ struct cbq_class
long avgidle; long avgidle;
long deficit; /* Saved deficit for WRR */ long deficit; /* Saved deficit for WRR */
unsigned long penalized; 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; spinlock_t *stats_lock;
struct tc_cbq_xstats xstats; struct tc_cbq_xstats xstats;
...@@ -448,7 +450,7 @@ cbq_enqueue(struct sk_buff *skb, struct Qdisc *sch) ...@@ -448,7 +450,7 @@ cbq_enqueue(struct sk_buff *skb, struct Qdisc *sch)
kfree_skb(skb); kfree_skb(skb);
else { else {
cbq_mark_toplevel(q, cl); cbq_mark_toplevel(q, cl);
cl->stats.drops++; cl->qstats.drops++;
} }
#else #else
if ( NET_XMIT_DROP == ret) { if ( NET_XMIT_DROP == ret) {
...@@ -457,7 +459,7 @@ cbq_enqueue(struct sk_buff *skb, struct Qdisc *sch) ...@@ -457,7 +459,7 @@ cbq_enqueue(struct sk_buff *skb, struct Qdisc *sch)
if (cl != NULL) { if (cl != NULL) {
cbq_mark_toplevel(q, cl); cbq_mark_toplevel(q, cl);
cl->stats.drops++; cl->qstats.drops++;
} }
#endif #endif
return ret; return ret;
...@@ -491,7 +493,7 @@ cbq_requeue(struct sk_buff *skb, struct Qdisc *sch) ...@@ -491,7 +493,7 @@ cbq_requeue(struct sk_buff *skb, struct Qdisc *sch)
return 0; return 0;
} }
sch->qstats.drops++; sch->qstats.drops++;
cl->stats.drops++; cl->qstats.drops++;
return ret; return ret;
} }
...@@ -789,8 +791,8 @@ cbq_update(struct cbq_sched_data *q) ...@@ -789,8 +791,8 @@ cbq_update(struct cbq_sched_data *q)
long avgidle = cl->avgidle; long avgidle = cl->avgidle;
long idle; long idle;
cl->stats.packets++; cl->bstats.packets++;
cl->stats.bytes += len; cl->bstats.bytes += len;
/* /*
(now - last) is total time between packet right edges. (now - last) is total time between packet right edges.
...@@ -888,7 +890,7 @@ cbq_under_limit(struct cbq_class *cl) ...@@ -888,7 +890,7 @@ cbq_under_limit(struct cbq_class *cl)
no another solution exists. no another solution exists.
*/ */
if ((cl = cl->borrow) == NULL) { if ((cl = cl->borrow) == NULL) {
this_cl->stats.overlimits++; this_cl->qstats.overlimits++;
this_cl->overlimit(this_cl); this_cl->overlimit(this_cl);
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment