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

[PKT_SCHED]: HTB: Use gnet_stats for class statistics

Converts HTB class statistic 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 b1b9a7c6
......@@ -142,7 +142,9 @@ struct htb_class
#endif
/* general class parameters */
u32 classid;
struct tc_stats stats; /* generic stats */
struct gnet_stats_basic bstats;
struct gnet_stats_queue qstats;
struct gnet_stats_rate_est rate_est;
spinlock_t *stats_lock;
struct tc_htb_xstats xstats;/* our special stats */
int refcnt; /* usage count of this class */
......@@ -754,10 +756,10 @@ static int htb_enqueue(struct sk_buff *skb, struct Qdisc *sch)
#endif
else if (cl->un.leaf.q->enqueue(skb, cl->un.leaf.q) != NET_XMIT_SUCCESS) {
sch->qstats.drops++;
cl->stats.drops++;
cl->qstats.drops++;
return NET_XMIT_DROP;
} else {
cl->stats.packets++; cl->stats.bytes += skb->len;
cl->bstats.packets++; cl->bstats.bytes += skb->len;
htb_activate (q,cl);
}
......@@ -788,7 +790,7 @@ static int htb_requeue(struct sk_buff *skb, struct Qdisc *sch)
}
} else if (cl->un.leaf.q->ops->requeue(skb, cl->un.leaf.q) != NET_XMIT_SUCCESS) {
sch->qstats.drops++;
cl->stats.drops++;
cl->qstats.drops++;
return NET_XMIT_DROP;
} else
htb_activate (q,cl);
......@@ -906,8 +908,8 @@ static void htb_charge_class(struct htb_sched *q,struct htb_class *cl,
/* update byte stats except for leaves which are already updated */
if (cl->level) {
cl->stats.bytes += bytes;
cl->stats.packets++;
cl->bstats.bytes += bytes;
cl->bstats.packets++;
}
cl = cl->parent;
}
......
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