aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_hfsc.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched/sch_hfsc.c')
-rw-r--r--net/sched/sch_hfsc.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c
index 6a6735a2ed35..6eefa6995777 100644
--- a/net/sched/sch_hfsc.c
+++ b/net/sched/sch_hfsc.c
@@ -946,6 +946,7 @@ qdisc_peek_len(struct Qdisc *sch)
946 if (unlikely(sch->ops->requeue(skb, sch) != NET_XMIT_SUCCESS)) { 946 if (unlikely(sch->ops->requeue(skb, sch) != NET_XMIT_SUCCESS)) {
947 if (net_ratelimit()) 947 if (net_ratelimit())
948 printk("qdisc_peek_len: failed to requeue\n"); 948 printk("qdisc_peek_len: failed to requeue\n");
949 qdisc_tree_decrease_qlen(sch, 1);
949 return 0; 950 return 0;
950 } 951 }
951 return len; 952 return len;
@@ -957,11 +958,7 @@ hfsc_purge_queue(struct Qdisc *sch, struct hfsc_class *cl)
957 unsigned int len = cl->qdisc->q.qlen; 958 unsigned int len = cl->qdisc->q.qlen;
958 959
959 qdisc_reset(cl->qdisc); 960 qdisc_reset(cl->qdisc);
960 if (len > 0) { 961 qdisc_tree_decrease_qlen(cl->qdisc, len);
961 update_vf(cl, 0, 0);
962 set_passive(cl);
963 sch->q.qlen -= len;
964 }
965} 962}
966 963
967static void 964static void
@@ -1138,7 +1135,7 @@ hfsc_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
1138 cl->classid = classid; 1135 cl->classid = classid;
1139 cl->sched = q; 1136 cl->sched = q;
1140 cl->cl_parent = parent; 1137 cl->cl_parent = parent;
1141 cl->qdisc = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops); 1138 cl->qdisc = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops, classid);
1142 if (cl->qdisc == NULL) 1139 if (cl->qdisc == NULL)
1143 cl->qdisc = &noop_qdisc; 1140 cl->qdisc = &noop_qdisc;
1144 cl->stats_lock = &sch->dev->queue_lock; 1141 cl->stats_lock = &sch->dev->queue_lock;
@@ -1271,7 +1268,8 @@ hfsc_graft_class(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
1271 if (cl->level > 0) 1268 if (cl->level > 0)
1272 return -EINVAL; 1269 return -EINVAL;
1273 if (new == NULL) { 1270 if (new == NULL) {
1274 new = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops); 1271 new = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops,
1272 cl->classid);
1275 if (new == NULL) 1273 if (new == NULL)
1276 new = &noop_qdisc; 1274 new = &noop_qdisc;
1277 } 1275 }
@@ -1294,6 +1292,17 @@ hfsc_class_leaf(struct Qdisc *sch, unsigned long arg)
1294 return NULL; 1292 return NULL;
1295} 1293}
1296 1294
1295static void
1296hfsc_qlen_notify(struct Qdisc *sch, unsigned long arg)
1297{
1298 struct hfsc_class *cl = (struct hfsc_class *)arg;
1299
1300 if (cl->qdisc->q.qlen == 0) {
1301 update_vf(cl, 0, 0);
1302 set_passive(cl);
1303 }
1304}
1305
1297static unsigned long 1306static unsigned long
1298hfsc_get_class(struct Qdisc *sch, u32 classid) 1307hfsc_get_class(struct Qdisc *sch, u32 classid)
1299{ 1308{
@@ -1514,7 +1523,8 @@ hfsc_init_qdisc(struct Qdisc *sch, struct rtattr *opt)
1514 q->root.refcnt = 1; 1523 q->root.refcnt = 1;
1515 q->root.classid = sch->handle; 1524 q->root.classid = sch->handle;
1516 q->root.sched = q; 1525 q->root.sched = q;
1517 q->root.qdisc = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops); 1526 q->root.qdisc = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops,
1527 sch->handle);
1518 if (q->root.qdisc == NULL) 1528 if (q->root.qdisc == NULL)
1519 q->root.qdisc = &noop_qdisc; 1529 q->root.qdisc = &noop_qdisc;
1520 q->root.stats_lock = &sch->dev->queue_lock; 1530 q->root.stats_lock = &sch->dev->queue_lock;
@@ -1777,6 +1787,7 @@ static struct Qdisc_class_ops hfsc_class_ops = {
1777 .delete = hfsc_delete_class, 1787 .delete = hfsc_delete_class,
1778 .graft = hfsc_graft_class, 1788 .graft = hfsc_graft_class,
1779 .leaf = hfsc_class_leaf, 1789 .leaf = hfsc_class_leaf,
1790 .qlen_notify = hfsc_qlen_notify,
1780 .get = hfsc_get_class, 1791 .get = hfsc_get_class,
1781 .put = hfsc_put_class, 1792 .put = hfsc_put_class,
1782 .bind_tcf = hfsc_bind_tcf, 1793 .bind_tcf = hfsc_bind_tcf,