aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/sched/sch_hfsc.c32
1 files changed, 7 insertions, 25 deletions
diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c
index f85cfba647f8..3cc2714fd5ae 100644
--- a/net/sched/sch_hfsc.c
+++ b/net/sched/sch_hfsc.c
@@ -59,7 +59,6 @@
59#include <linux/skbuff.h> 59#include <linux/skbuff.h>
60#include <linux/string.h> 60#include <linux/string.h>
61#include <linux/slab.h> 61#include <linux/slab.h>
62#include <linux/timer.h>
63#include <linux/list.h> 62#include <linux/list.h>
64#include <linux/rbtree.h> 63#include <linux/rbtree.h>
65#include <linux/init.h> 64#include <linux/init.h>
@@ -192,7 +191,7 @@ struct hfsc_sched
192 struct list_head droplist; /* active leaf class list (for 191 struct list_head droplist; /* active leaf class list (for
193 dropping) */ 192 dropping) */
194 struct sk_buff_head requeue; /* requeued packet */ 193 struct sk_buff_head requeue; /* requeued packet */
195 struct timer_list wd_timer; /* watchdog timer */ 194 struct qdisc_watchdog watchdog; /* watchdog timer */
196}; 195};
197 196
198#define HT_INFINITY 0xffffffffffffffffULL /* infinite time value */ 197#define HT_INFINITY 0xffffffffffffffffULL /* infinite time value */
@@ -1434,21 +1433,11 @@ hfsc_walk(struct Qdisc *sch, struct qdisc_walker *arg)
1434} 1433}
1435 1434
1436static void 1435static void
1437hfsc_watchdog(unsigned long arg) 1436hfsc_schedule_watchdog(struct Qdisc *sch)
1438{
1439 struct Qdisc *sch = (struct Qdisc *)arg;
1440
1441 sch->flags &= ~TCQ_F_THROTTLED;
1442 netif_schedule(sch->dev);
1443}
1444
1445static void
1446hfsc_schedule_watchdog(struct Qdisc *sch, u64 cur_time)
1447{ 1437{
1448 struct hfsc_sched *q = qdisc_priv(sch); 1438 struct hfsc_sched *q = qdisc_priv(sch);
1449 struct hfsc_class *cl; 1439 struct hfsc_class *cl;
1450 u64 next_time = 0; 1440 u64 next_time = 0;
1451 long delay;
1452 1441
1453 if ((cl = eltree_get_minel(q)) != NULL) 1442 if ((cl = eltree_get_minel(q)) != NULL)
1454 next_time = cl->cl_e; 1443 next_time = cl->cl_e;
@@ -1457,11 +1446,7 @@ hfsc_schedule_watchdog(struct Qdisc *sch, u64 cur_time)
1457 next_time = q->root.cl_cfmin; 1446 next_time = q->root.cl_cfmin;
1458 } 1447 }
1459 WARN_ON(next_time == 0); 1448 WARN_ON(next_time == 0);
1460 delay = next_time - cur_time; 1449 qdisc_watchdog_schedule(&q->watchdog, next_time);
1461 delay = PSCHED_US2JIFFIE(delay);
1462
1463 sch->flags |= TCQ_F_THROTTLED;
1464 mod_timer(&q->wd_timer, jiffies + delay);
1465} 1450}
1466 1451
1467static int 1452static int
@@ -1498,9 +1483,7 @@ hfsc_init_qdisc(struct Qdisc *sch, struct rtattr *opt)
1498 1483
1499 list_add(&q->root.hlist, &q->clhash[hfsc_hash(q->root.classid)]); 1484 list_add(&q->root.hlist, &q->clhash[hfsc_hash(q->root.classid)]);
1500 1485
1501 init_timer(&q->wd_timer); 1486 qdisc_watchdog_init(&q->watchdog, sch);
1502 q->wd_timer.function = hfsc_watchdog;
1503 q->wd_timer.data = (unsigned long)sch;
1504 1487
1505 return 0; 1488 return 0;
1506} 1489}
@@ -1570,8 +1553,7 @@ hfsc_reset_qdisc(struct Qdisc *sch)
1570 __skb_queue_purge(&q->requeue); 1553 __skb_queue_purge(&q->requeue);
1571 q->eligible = RB_ROOT; 1554 q->eligible = RB_ROOT;
1572 INIT_LIST_HEAD(&q->droplist); 1555 INIT_LIST_HEAD(&q->droplist);
1573 del_timer(&q->wd_timer); 1556 qdisc_watchdog_cancel(&q->watchdog);
1574 sch->flags &= ~TCQ_F_THROTTLED;
1575 sch->q.qlen = 0; 1557 sch->q.qlen = 0;
1576} 1558}
1577 1559
@@ -1587,7 +1569,7 @@ hfsc_destroy_qdisc(struct Qdisc *sch)
1587 hfsc_destroy_class(sch, cl); 1569 hfsc_destroy_class(sch, cl);
1588 } 1570 }
1589 __skb_queue_purge(&q->requeue); 1571 __skb_queue_purge(&q->requeue);
1590 del_timer(&q->wd_timer); 1572 qdisc_watchdog_cancel(&q->watchdog);
1591} 1573}
1592 1574
1593static int 1575static int
@@ -1673,7 +1655,7 @@ hfsc_dequeue(struct Qdisc *sch)
1673 cl = vttree_get_minvt(&q->root, cur_time); 1655 cl = vttree_get_minvt(&q->root, cur_time);
1674 if (cl == NULL) { 1656 if (cl == NULL) {
1675 sch->qstats.overlimits++; 1657 sch->qstats.overlimits++;
1676 hfsc_schedule_watchdog(sch, cur_time); 1658 hfsc_schedule_watchdog(sch);
1677 return NULL; 1659 return NULL;
1678 } 1660 }
1679 } 1661 }