aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/sch_api.c12
-rw-r--r--net/sched/sch_atm.c6
-rw-r--r--net/sched/sch_cbq.c9
-rw-r--r--net/sched/sch_dsmark.c6
-rw-r--r--net/sched/sch_fifo.c3
-rw-r--r--net/sched/sch_generic.c14
-rw-r--r--net/sched/sch_hfsc.c9
-rw-r--r--net/sched/sch_htb.c11
-rw-r--r--net/sched/sch_netem.c3
-rw-r--r--net/sched/sch_prio.c3
10 files changed, 50 insertions, 26 deletions
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 69e918bb4278..b86c98bd06a3 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -552,8 +552,8 @@ static int qdisc_graft(struct net_device *dev, struct Qdisc *parent,
552 */ 552 */
553 553
554static struct Qdisc * 554static struct Qdisc *
555qdisc_create(struct net_device *dev, u32 parent, u32 handle, 555qdisc_create(struct net_device *dev, struct netdev_queue *dev_queue,
556 struct nlattr **tca, int *errp) 556 u32 parent, u32 handle, struct nlattr **tca, int *errp)
557{ 557{
558 int err; 558 int err;
559 struct nlattr *kind = tca[TCA_KIND]; 559 struct nlattr *kind = tca[TCA_KIND];
@@ -593,7 +593,7 @@ qdisc_create(struct net_device *dev, u32 parent, u32 handle,
593 if (ops == NULL) 593 if (ops == NULL)
594 goto err_out; 594 goto err_out;
595 595
596 sch = qdisc_alloc(dev, ops); 596 sch = qdisc_alloc(dev, dev_queue, ops);
597 if (IS_ERR(sch)) { 597 if (IS_ERR(sch)) {
598 err = PTR_ERR(sch); 598 err = PTR_ERR(sch);
599 goto err_out2; 599 goto err_out2;
@@ -892,10 +892,12 @@ create_n_graft:
892 if (!(n->nlmsg_flags&NLM_F_CREATE)) 892 if (!(n->nlmsg_flags&NLM_F_CREATE))
893 return -ENOENT; 893 return -ENOENT;
894 if (clid == TC_H_INGRESS) 894 if (clid == TC_H_INGRESS)
895 q = qdisc_create(dev, tcm->tcm_parent, tcm->tcm_parent, 895 q = qdisc_create(dev, &dev->rx_queue,
896 tcm->tcm_parent, tcm->tcm_parent,
896 tca, &err); 897 tca, &err);
897 else 898 else
898 q = qdisc_create(dev, tcm->tcm_parent, tcm->tcm_handle, 899 q = qdisc_create(dev, &dev->tx_queue,
900 tcm->tcm_parent, tcm->tcm_handle,
899 tca, &err); 901 tca, &err);
900 if (q == NULL) { 902 if (q == NULL) {
901 if (err == -EAGAIN) 903 if (err == -EAGAIN)
diff --git a/net/sched/sch_atm.c b/net/sched/sch_atm.c
index db0e23ae85f8..3dddab531d5a 100644
--- a/net/sched/sch_atm.c
+++ b/net/sched/sch_atm.c
@@ -296,7 +296,8 @@ static int atm_tc_change(struct Qdisc *sch, u32 classid, u32 parent,
296 goto err_out; 296 goto err_out;
297 } 297 }
298 flow->filter_list = NULL; 298 flow->filter_list = NULL;
299 flow->q = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops, classid); 299 flow->q = qdisc_create_dflt(sch->dev, sch->dev_queue,
300 &pfifo_qdisc_ops, classid);
300 if (!flow->q) 301 if (!flow->q)
301 flow->q = &noop_qdisc; 302 flow->q = &noop_qdisc;
302 pr_debug("atm_tc_change: qdisc %p\n", flow->q); 303 pr_debug("atm_tc_change: qdisc %p\n", flow->q);
@@ -555,7 +556,8 @@ static int atm_tc_init(struct Qdisc *sch, struct nlattr *opt)
555 556
556 pr_debug("atm_tc_init(sch %p,[qdisc %p],opt %p)\n", sch, p, opt); 557 pr_debug("atm_tc_init(sch %p,[qdisc %p],opt %p)\n", sch, p, opt);
557 p->flows = &p->link; 558 p->flows = &p->link;
558 p->link.q = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops, sch->handle); 559 p->link.q = qdisc_create_dflt(sch->dev, sch->dev_queue,
560 &pfifo_qdisc_ops, sch->handle);
559 if (!p->link.q) 561 if (!p->link.q)
560 p->link.q = &noop_qdisc; 562 p->link.q = &noop_qdisc;
561 pr_debug("atm_tc_init: link (%p) qdisc %p\n", &p->link, p->link.q); 563 pr_debug("atm_tc_init: link (%p) qdisc %p\n", &p->link, p->link.q);
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
index 968b4c73c9c1..d360dcd0818b 100644
--- a/net/sched/sch_cbq.c
+++ b/net/sched/sch_cbq.c
@@ -1401,7 +1401,8 @@ static int cbq_init(struct Qdisc *sch, struct nlattr *opt)
1401 q->link.sibling = &q->link; 1401 q->link.sibling = &q->link;
1402 q->link.common.classid = sch->handle; 1402 q->link.common.classid = sch->handle;
1403 q->link.qdisc = sch; 1403 q->link.qdisc = sch;
1404 if (!(q->link.q = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops, 1404 if (!(q->link.q = qdisc_create_dflt(sch->dev, sch->dev_queue,
1405 &pfifo_qdisc_ops,
1405 sch->handle))) 1406 sch->handle)))
1406 q->link.q = &noop_qdisc; 1407 q->link.q = &noop_qdisc;
1407 1408
@@ -1645,7 +1646,8 @@ static int cbq_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
1645 1646
1646 if (cl) { 1647 if (cl) {
1647 if (new == NULL) { 1648 if (new == NULL) {
1648 new = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops, 1649 new = qdisc_create_dflt(sch->dev, sch->dev_queue,
1650 &pfifo_qdisc_ops,
1649 cl->common.classid); 1651 cl->common.classid);
1650 if (new == NULL) 1652 if (new == NULL)
1651 return -ENOBUFS; 1653 return -ENOBUFS;
@@ -1877,7 +1879,8 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct nlattr **t
1877 cl->R_tab = rtab; 1879 cl->R_tab = rtab;
1878 rtab = NULL; 1880 rtab = NULL;
1879 cl->refcnt = 1; 1881 cl->refcnt = 1;
1880 if (!(cl->q = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops, classid))) 1882 if (!(cl->q = qdisc_create_dflt(sch->dev, sch->dev_queue,
1883 &pfifo_qdisc_ops, classid)))
1881 cl->q = &noop_qdisc; 1884 cl->q = &noop_qdisc;
1882 cl->common.classid = classid; 1885 cl->common.classid = classid;
1883 cl->tparent = parent; 1886 cl->tparent = parent;
diff --git a/net/sched/sch_dsmark.c b/net/sched/sch_dsmark.c
index c4c1317cd47d..c955ba24e5cf 100644
--- a/net/sched/sch_dsmark.c
+++ b/net/sched/sch_dsmark.c
@@ -60,7 +60,8 @@ static int dsmark_graft(struct Qdisc *sch, unsigned long arg,
60 sch, p, new, old); 60 sch, p, new, old);
61 61
62 if (new == NULL) { 62 if (new == NULL) {
63 new = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops, 63 new = qdisc_create_dflt(sch->dev, sch->dev_queue,
64 &pfifo_qdisc_ops,
64 sch->handle); 65 sch->handle);
65 if (new == NULL) 66 if (new == NULL)
66 new = &noop_qdisc; 67 new = &noop_qdisc;
@@ -390,7 +391,8 @@ static int dsmark_init(struct Qdisc *sch, struct nlattr *opt)
390 p->default_index = default_index; 391 p->default_index = default_index;
391 p->set_tc_index = nla_get_flag(tb[TCA_DSMARK_SET_TC_INDEX]); 392 p->set_tc_index = nla_get_flag(tb[TCA_DSMARK_SET_TC_INDEX]);
392 393
393 p->q = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops, sch->handle); 394 p->q = qdisc_create_dflt(sch->dev, sch->dev_queue,
395 &pfifo_qdisc_ops, sch->handle);
394 if (p->q == NULL) 396 if (p->q == NULL)
395 p->q = &noop_qdisc; 397 p->q = &noop_qdisc;
396 398
diff --git a/net/sched/sch_fifo.c b/net/sched/sch_fifo.c
index 82d7d7bbbb16..779eae85faf0 100644
--- a/net/sched/sch_fifo.c
+++ b/net/sched/sch_fifo.c
@@ -137,7 +137,8 @@ struct Qdisc *fifo_create_dflt(struct Qdisc *sch, struct Qdisc_ops *ops,
137 struct Qdisc *q; 137 struct Qdisc *q;
138 int err = -ENOMEM; 138 int err = -ENOMEM;
139 139
140 q = qdisc_create_dflt(sch->dev, ops, TC_H_MAKE(sch->handle, 1)); 140 q = qdisc_create_dflt(sch->dev, sch->dev_queue,
141 ops, TC_H_MAKE(sch->handle, 1));
141 if (q) { 142 if (q) {
142 err = fifo_set_limit(q, limit); 143 err = fifo_set_limit(q, limit);
143 if (err < 0) { 144 if (err < 0) {
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 13afa7214392..d97086480893 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -440,7 +440,9 @@ static struct Qdisc_ops pfifo_fast_ops __read_mostly = {
440 .owner = THIS_MODULE, 440 .owner = THIS_MODULE,
441}; 441};
442 442
443struct Qdisc *qdisc_alloc(struct net_device *dev, struct Qdisc_ops *ops) 443struct Qdisc *qdisc_alloc(struct net_device *dev,
444 struct netdev_queue *dev_queue,
445 struct Qdisc_ops *ops)
444{ 446{
445 void *p; 447 void *p;
446 struct Qdisc *sch; 448 struct Qdisc *sch;
@@ -462,6 +464,7 @@ struct Qdisc *qdisc_alloc(struct net_device *dev, struct Qdisc_ops *ops)
462 sch->ops = ops; 464 sch->ops = ops;
463 sch->enqueue = ops->enqueue; 465 sch->enqueue = ops->enqueue;
464 sch->dequeue = ops->dequeue; 466 sch->dequeue = ops->dequeue;
467 sch->dev_queue = dev_queue;
465 sch->dev = dev; 468 sch->dev = dev;
466 dev_hold(dev); 469 dev_hold(dev);
467 atomic_set(&sch->refcnt, 1); 470 atomic_set(&sch->refcnt, 1);
@@ -471,12 +474,14 @@ errout:
471 return ERR_PTR(err); 474 return ERR_PTR(err);
472} 475}
473 476
474struct Qdisc * qdisc_create_dflt(struct net_device *dev, struct Qdisc_ops *ops, 477struct Qdisc * qdisc_create_dflt(struct net_device *dev,
478 struct netdev_queue *dev_queue,
479 struct Qdisc_ops *ops,
475 unsigned int parentid) 480 unsigned int parentid)
476{ 481{
477 struct Qdisc *sch; 482 struct Qdisc *sch;
478 483
479 sch = qdisc_alloc(dev, ops); 484 sch = qdisc_alloc(dev, dev_queue, ops);
480 if (IS_ERR(sch)) 485 if (IS_ERR(sch))
481 goto errout; 486 goto errout;
482 sch->stats_lock = &dev->queue_lock; 487 sch->stats_lock = &dev->queue_lock;
@@ -545,7 +550,8 @@ void dev_activate(struct net_device *dev)
545 if (dev->qdisc_sleeping == &noop_qdisc) { 550 if (dev->qdisc_sleeping == &noop_qdisc) {
546 struct Qdisc *qdisc; 551 struct Qdisc *qdisc;
547 if (dev->tx_queue_len) { 552 if (dev->tx_queue_len) {
548 qdisc = qdisc_create_dflt(dev, &pfifo_fast_ops, 553 qdisc = qdisc_create_dflt(dev, &dev->tx_queue,
554 &pfifo_fast_ops,
549 TC_H_ROOT); 555 TC_H_ROOT);
550 if (qdisc == NULL) { 556 if (qdisc == NULL) {
551 printk(KERN_INFO "%s: activation failed\n", dev->name); 557 printk(KERN_INFO "%s: activation failed\n", dev->name);
diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c
index 3a8267246a4f..5a22fec4eadd 100644
--- a/net/sched/sch_hfsc.c
+++ b/net/sched/sch_hfsc.c
@@ -1083,7 +1083,8 @@ hfsc_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
1083 cl->refcnt = 1; 1083 cl->refcnt = 1;
1084 cl->sched = q; 1084 cl->sched = q;
1085 cl->cl_parent = parent; 1085 cl->cl_parent = parent;
1086 cl->qdisc = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops, classid); 1086 cl->qdisc = qdisc_create_dflt(sch->dev, sch->dev_queue,
1087 &pfifo_qdisc_ops, classid);
1087 if (cl->qdisc == NULL) 1088 if (cl->qdisc == NULL)
1088 cl->qdisc = &noop_qdisc; 1089 cl->qdisc = &noop_qdisc;
1089 INIT_LIST_HEAD(&cl->children); 1090 INIT_LIST_HEAD(&cl->children);
@@ -1201,7 +1202,8 @@ hfsc_graft_class(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
1201 if (cl->level > 0) 1202 if (cl->level > 0)
1202 return -EINVAL; 1203 return -EINVAL;
1203 if (new == NULL) { 1204 if (new == NULL) {
1204 new = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops, 1205 new = qdisc_create_dflt(sch->dev, sch->dev_queue,
1206 &pfifo_qdisc_ops,
1205 cl->cl_common.classid); 1207 cl->cl_common.classid);
1206 if (new == NULL) 1208 if (new == NULL)
1207 new = &noop_qdisc; 1209 new = &noop_qdisc;
@@ -1443,7 +1445,8 @@ hfsc_init_qdisc(struct Qdisc *sch, struct nlattr *opt)
1443 q->root.cl_common.classid = sch->handle; 1445 q->root.cl_common.classid = sch->handle;
1444 q->root.refcnt = 1; 1446 q->root.refcnt = 1;
1445 q->root.sched = q; 1447 q->root.sched = q;
1446 q->root.qdisc = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops, 1448 q->root.qdisc = qdisc_create_dflt(sch->dev, sch->dev_queue,
1449 &pfifo_qdisc_ops,
1447 sch->handle); 1450 sch->handle);
1448 if (q->root.qdisc == NULL) 1451 if (q->root.qdisc == NULL)
1449 q->root.qdisc = &noop_qdisc; 1452 q->root.qdisc = &noop_qdisc;
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index ee8b4ffe110c..956a67f66b9c 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -1129,7 +1129,8 @@ static int htb_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
1129 1129
1130 if (cl && !cl->level) { 1130 if (cl && !cl->level) {
1131 if (new == NULL && 1131 if (new == NULL &&
1132 (new = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops, 1132 (new = qdisc_create_dflt(sch->dev, sch->dev_queue,
1133 &pfifo_qdisc_ops,
1133 cl->common.classid)) 1134 cl->common.classid))
1134 == NULL) 1135 == NULL)
1135 return -ENOBUFS; 1136 return -ENOBUFS;
@@ -1256,8 +1257,9 @@ static int htb_delete(struct Qdisc *sch, unsigned long arg)
1256 return -EBUSY; 1257 return -EBUSY;
1257 1258
1258 if (!cl->level && htb_parent_last_child(cl)) { 1259 if (!cl->level && htb_parent_last_child(cl)) {
1259 new_q = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops, 1260 new_q = qdisc_create_dflt(sch->dev, sch->dev_queue,
1260 cl->parent->common.classid); 1261 &pfifo_qdisc_ops,
1262 cl->parent->common.classid);
1261 last_child = 1; 1263 last_child = 1;
1262 } 1264 }
1263 1265
@@ -1376,7 +1378,8 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
1376 /* create leaf qdisc early because it uses kmalloc(GFP_KERNEL) 1378 /* create leaf qdisc early because it uses kmalloc(GFP_KERNEL)
1377 so that can't be used inside of sch_tree_lock 1379 so that can't be used inside of sch_tree_lock
1378 -- thanks to Karlis Peisenieks */ 1380 -- thanks to Karlis Peisenieks */
1379 new_q = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops, classid); 1381 new_q = qdisc_create_dflt(sch->dev, sch->dev_queue,
1382 &pfifo_qdisc_ops, classid);
1380 sch_tree_lock(sch); 1383 sch_tree_lock(sch);
1381 if (parent && !parent->level) { 1384 if (parent && !parent->level) {
1382 unsigned int qlen = parent->un.leaf.q->q.qlen; 1385 unsigned int qlen = parent->un.leaf.q->q.qlen;
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index 24697667247c..aa7a04e32ae9 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -536,7 +536,8 @@ static int netem_init(struct Qdisc *sch, struct nlattr *opt)
536 536
537 qdisc_watchdog_init(&q->watchdog, sch); 537 qdisc_watchdog_init(&q->watchdog, sch);
538 538
539 q->qdisc = qdisc_create_dflt(sch->dev, &tfifo_qdisc_ops, 539 q->qdisc = qdisc_create_dflt(sch->dev, sch->dev_queue,
540 &tfifo_qdisc_ops,
540 TC_H_MAKE(sch->handle, 1)); 541 TC_H_MAKE(sch->handle, 1));
541 if (!q->qdisc) { 542 if (!q->qdisc) {
542 pr_debug("netem: qdisc create failed\n"); 543 pr_debug("netem: qdisc create failed\n");
diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c
index 5532f1031ab5..ca58a039208e 100644
--- a/net/sched/sch_prio.c
+++ b/net/sched/sch_prio.c
@@ -281,7 +281,8 @@ static int prio_tune(struct Qdisc *sch, struct nlattr *opt)
281 for (i=0; i<q->bands; i++) { 281 for (i=0; i<q->bands; i++) {
282 if (q->queues[i] == &noop_qdisc) { 282 if (q->queues[i] == &noop_qdisc) {
283 struct Qdisc *child; 283 struct Qdisc *child;
284 child = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops, 284 child = qdisc_create_dflt(sch->dev, sch->dev_queue,
285 &pfifo_qdisc_ops,
285 TC_H_MAKE(sch->handle, i + 1)); 286 TC_H_MAKE(sch->handle, i + 1));
286 if (child) { 287 if (child) {
287 sch_tree_lock(sch); 288 sch_tree_lock(sch);