]> git.hungrycats.org Git - linux/commitdiff
[PKT_SCHED]: HTB: Use gnet_stats for class statistics
authorThomas Graf <tgraf@suug.ch>
Thu, 21 Oct 2004 15:27:58 +0000 (08:27 -0700)
committerDavid S. Miller <davem@nuts.davemloft.net>
Thu, 21 Oct 2004 15:27:58 +0000 (08:27 -0700)
Converts HTB class statistic counters to gnet_stats
structures.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_htb.c

index d3964f0e2161bd9baf651c2c6e461a8fa2cf77c1..9f30fd83560cd3b31b984bb812758fa45d6f50a9 100644 (file)
@@ -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;
        }