aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2007-03-16 04:21:11 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:26:09 -0400
commit88a993540a65c38865f83961520494b4ad5d0363 (patch)
tree0cb5d41b58cd9de8d1ecee4d27a1ef74b069b72b /net/sched
parent59cb5c6734021acc68590c7c2e0e92ad9a4952c6 (diff)
[NET_SCHED]: sch_cbq: use hrtimer based watchdog
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/sch_cbq.c28
1 files changed, 7 insertions, 21 deletions
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
index 76c92e710a33..d29d1212934d 100644
--- a/net/sched/sch_cbq.c
+++ b/net/sched/sch_cbq.c
@@ -181,11 +181,11 @@ struct cbq_sched_data
181 unsigned pmask; 181 unsigned pmask;
182 182
183 struct timer_list delay_timer; 183 struct timer_list delay_timer;
184 struct timer_list wd_timer; /* Watchdog timer, 184 struct qdisc_watchdog watchdog; /* Watchdog timer,
185 started when CBQ has 185 started when CBQ has
186 backlog, but cannot 186 backlog, but cannot
187 transmit just now */ 187 transmit just now */
188 long wd_expires; 188 psched_tdiff_t wd_expires;
189 int toplevel; 189 int toplevel;
190 u32 hgenerator; 190 u32 hgenerator;
191}; 191};
@@ -604,14 +604,6 @@ static void cbq_ovl_drop(struct cbq_class *cl)
604 cbq_ovl_classic(cl); 604 cbq_ovl_classic(cl);
605} 605}
606 606
607static void cbq_watchdog(unsigned long arg)
608{
609 struct Qdisc *sch = (struct Qdisc*)arg;
610
611 sch->flags &= ~TCQ_F_THROTTLED;
612 netif_schedule(sch->dev);
613}
614
615static unsigned long cbq_undelay_prio(struct cbq_sched_data *q, int prio) 607static unsigned long cbq_undelay_prio(struct cbq_sched_data *q, int prio)
616{ 608{
617 struct cbq_class *cl; 609 struct cbq_class *cl;
@@ -1063,13 +1055,9 @@ cbq_dequeue(struct Qdisc *sch)
1063 1055
1064 if (sch->q.qlen) { 1056 if (sch->q.qlen) {
1065 sch->qstats.overlimits++; 1057 sch->qstats.overlimits++;
1066 if (q->wd_expires) { 1058 if (q->wd_expires)
1067 long delay = PSCHED_US2JIFFIE(q->wd_expires); 1059 qdisc_watchdog_schedule(&q->watchdog,
1068 if (delay <= 0) 1060 q->now + q->wd_expires);
1069 delay = 1;
1070 mod_timer(&q->wd_timer, jiffies + delay);
1071 sch->flags |= TCQ_F_THROTTLED;
1072 }
1073 } 1061 }
1074 return NULL; 1062 return NULL;
1075} 1063}
@@ -1276,7 +1264,7 @@ cbq_reset(struct Qdisc* sch)
1276 q->pmask = 0; 1264 q->pmask = 0;
1277 q->tx_class = NULL; 1265 q->tx_class = NULL;
1278 q->tx_borrowed = NULL; 1266 q->tx_borrowed = NULL;
1279 del_timer(&q->wd_timer); 1267 qdisc_watchdog_cancel(&q->watchdog);
1280 del_timer(&q->delay_timer); 1268 del_timer(&q->delay_timer);
1281 q->toplevel = TC_CBQ_MAXLEVEL; 1269 q->toplevel = TC_CBQ_MAXLEVEL;
1282 PSCHED_GET_TIME(q->now); 1270 PSCHED_GET_TIME(q->now);
@@ -1446,9 +1434,7 @@ static int cbq_init(struct Qdisc *sch, struct rtattr *opt)
1446 q->link.minidle = -0x7FFFFFFF; 1434 q->link.minidle = -0x7FFFFFFF;
1447 q->link.stats_lock = &sch->dev->queue_lock; 1435 q->link.stats_lock = &sch->dev->queue_lock;
1448 1436
1449 init_timer(&q->wd_timer); 1437 qdisc_watchdog_init(&q->watchdog, sch);
1450 q->wd_timer.data = (unsigned long)sch;
1451 q->wd_timer.function = cbq_watchdog;
1452 init_timer(&q->delay_timer); 1438 init_timer(&q->delay_timer);
1453 q->delay_timer.data = (unsigned long)sch; 1439 q->delay_timer.data = (unsigned long)sch;
1454 q->delay_timer.function = cbq_undelay; 1440 q->delay_timer.function = cbq_undelay;