X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=net%2Fsched%2Festimator.c;h=393496b2f202da3862cdbfd7a8b066517de09036;hb=9bf4aaab3e101692164d49b7ca357651eb691cb6;hp=d0f0df64c350cd1cadb5e8298705075cb83b1943;hpb=db216c3d5e4c040e557a50f8f5d35d5c415e8c1c;p=linux-2.6.git diff --git a/net/sched/estimator.c b/net/sched/estimator.c index d0f0df64c..393496b2f 100644 --- a/net/sched/estimator.c +++ b/net/sched/estimator.c @@ -81,6 +81,7 @@ struct qdisc_estimator { struct qdisc_estimator *next; struct tc_stats *stats; + spinlock_t *stats_lock; unsigned interval; int ewma_log; u64 last_bytes; @@ -112,7 +113,7 @@ static void est_timer(unsigned long arg) u32 npackets; u32 rate; - spin_lock(st->lock); + spin_lock(e->stats_lock); nbytes = st->bytes; npackets = st->packets; rate = (nbytes - e->last_bytes)<<(7 - idx); @@ -124,14 +125,14 @@ static void est_timer(unsigned long arg) e->last_packets = npackets; e->avpps += ((long)rate - (long)e->avpps) >> e->ewma_log; e->stats->pps = (e->avpps+0x1FF)>>10; - spin_unlock(st->lock); + spin_unlock(e->stats_lock); } mod_timer(&elist[idx].timer, jiffies + ((HZ/4)<interval = parm->interval + 2; est->stats = stats; + est->stats_lock = stats_lock; est->ewma_log = parm->ewma_log; est->last_bytes = stats->bytes; est->avbps = stats->bps<<5;