netdev
[Top] [All Lists]

[PATCH 7/16] CBQ: Use gnet_stats for class statistics

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@xxxxxxxxxxxxxx>
References: <20041021123209.GE21977@xxxxxxxxxxxxxx>
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;
                }

<Prev in Thread] Current Thread [Next in Thread>