diff options
author | David S. Miller <davem@davemloft.net> | 2008-07-08 20:06:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-08 20:06:30 -0400 |
commit | 5ce2d488fe039ddd86a638496cf704df86c74eeb (patch) | |
tree | 71b4d982bfa8bd457bb41c0693c0e70d75b524b4 /net/sched/sch_cbq.c | |
parent | bb949fbd1878973c3539d9aecff52f284482a937 (diff) |
pkt_sched: Remove 'dev' member of struct Qdisc.
It can be obtained via the netdev_queue. So create a helper routine,
qdisc_dev(), to make the transformations nicer looking.
Now, qdisc_alloc() now no longer needs a net_device pointer argument.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_cbq.c')
-rw-r--r-- | net/sched/sch_cbq.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c index d360dcd0818b..9f2ace585fd6 100644 --- a/net/sched/sch_cbq.c +++ b/net/sched/sch_cbq.c | |||
@@ -650,7 +650,7 @@ static enum hrtimer_restart cbq_undelay(struct hrtimer *timer) | |||
650 | } | 650 | } |
651 | 651 | ||
652 | sch->flags &= ~TCQ_F_THROTTLED; | 652 | sch->flags &= ~TCQ_F_THROTTLED; |
653 | netif_schedule(sch->dev); | 653 | netif_schedule(qdisc_dev(sch)); |
654 | return HRTIMER_NORESTART; | 654 | return HRTIMER_NORESTART; |
655 | } | 655 | } |
656 | 656 | ||
@@ -1077,9 +1077,9 @@ static void cbq_normalize_quanta(struct cbq_sched_data *q, int prio) | |||
1077 | cl->quantum = (cl->weight*cl->allot*q->nclasses[prio])/ | 1077 | cl->quantum = (cl->weight*cl->allot*q->nclasses[prio])/ |
1078 | q->quanta[prio]; | 1078 | q->quanta[prio]; |
1079 | } | 1079 | } |
1080 | if (cl->quantum <= 0 || cl->quantum>32*cl->qdisc->dev->mtu) { | 1080 | if (cl->quantum <= 0 || cl->quantum>32*qdisc_dev(cl->qdisc)->mtu) { |
1081 | printk(KERN_WARNING "CBQ: class %08x has bad quantum==%ld, repaired.\n", cl->common.classid, cl->quantum); | 1081 | printk(KERN_WARNING "CBQ: class %08x has bad quantum==%ld, repaired.\n", cl->common.classid, cl->quantum); |
1082 | cl->quantum = cl->qdisc->dev->mtu/2 + 1; | 1082 | cl->quantum = qdisc_dev(cl->qdisc)->mtu/2 + 1; |
1083 | } | 1083 | } |
1084 | } | 1084 | } |
1085 | } | 1085 | } |
@@ -1401,7 +1401,7 @@ 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, sch->dev_queue, | 1404 | if (!(q->link.q = qdisc_create_dflt(qdisc_dev(sch), sch->dev_queue, |
1405 | &pfifo_qdisc_ops, | 1405 | &pfifo_qdisc_ops, |
1406 | sch->handle))) | 1406 | sch->handle))) |
1407 | q->link.q = &noop_qdisc; | 1407 | q->link.q = &noop_qdisc; |
@@ -1411,7 +1411,7 @@ static int cbq_init(struct Qdisc *sch, struct nlattr *opt) | |||
1411 | q->link.cpriority = TC_CBQ_MAXPRIO-1; | 1411 | q->link.cpriority = TC_CBQ_MAXPRIO-1; |
1412 | q->link.ovl_strategy = TC_CBQ_OVL_CLASSIC; | 1412 | q->link.ovl_strategy = TC_CBQ_OVL_CLASSIC; |
1413 | q->link.overlimit = cbq_ovl_classic; | 1413 | q->link.overlimit = cbq_ovl_classic; |
1414 | q->link.allot = psched_mtu(sch->dev); | 1414 | q->link.allot = psched_mtu(qdisc_dev(sch)); |
1415 | q->link.quantum = q->link.allot; | 1415 | q->link.quantum = q->link.allot; |
1416 | q->link.weight = q->link.R_tab->rate.rate; | 1416 | q->link.weight = q->link.R_tab->rate.rate; |
1417 | 1417 | ||
@@ -1646,7 +1646,7 @@ static int cbq_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new, | |||
1646 | 1646 | ||
1647 | if (cl) { | 1647 | if (cl) { |
1648 | if (new == NULL) { | 1648 | if (new == NULL) { |
1649 | new = qdisc_create_dflt(sch->dev, sch->dev_queue, | 1649 | new = qdisc_create_dflt(qdisc_dev(sch), sch->dev_queue, |
1650 | &pfifo_qdisc_ops, | 1650 | &pfifo_qdisc_ops, |
1651 | cl->common.classid); | 1651 | cl->common.classid); |
1652 | if (new == NULL) | 1652 | if (new == NULL) |
@@ -1746,10 +1746,10 @@ static void cbq_put(struct Qdisc *sch, unsigned long arg) | |||
1746 | #ifdef CONFIG_NET_CLS_ACT | 1746 | #ifdef CONFIG_NET_CLS_ACT |
1747 | struct cbq_sched_data *q = qdisc_priv(sch); | 1747 | struct cbq_sched_data *q = qdisc_priv(sch); |
1748 | 1748 | ||
1749 | spin_lock_bh(&sch->dev->queue_lock); | 1749 | spin_lock_bh(&qdisc_dev(sch)->queue_lock); |
1750 | if (q->rx_class == cl) | 1750 | if (q->rx_class == cl) |
1751 | q->rx_class = NULL; | 1751 | q->rx_class = NULL; |
1752 | spin_unlock_bh(&sch->dev->queue_lock); | 1752 | spin_unlock_bh(&qdisc_dev(sch)->queue_lock); |
1753 | #endif | 1753 | #endif |
1754 | 1754 | ||
1755 | cbq_destroy_class(sch, cl); | 1755 | cbq_destroy_class(sch, cl); |
@@ -1828,7 +1828,7 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct nlattr **t | |||
1828 | 1828 | ||
1829 | if (tca[TCA_RATE]) | 1829 | if (tca[TCA_RATE]) |
1830 | gen_replace_estimator(&cl->bstats, &cl->rate_est, | 1830 | gen_replace_estimator(&cl->bstats, &cl->rate_est, |
1831 | &sch->dev->queue_lock, | 1831 | &qdisc_dev(sch)->queue_lock, |
1832 | tca[TCA_RATE]); | 1832 | tca[TCA_RATE]); |
1833 | return 0; | 1833 | return 0; |
1834 | } | 1834 | } |
@@ -1879,7 +1879,7 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct nlattr **t | |||
1879 | cl->R_tab = rtab; | 1879 | cl->R_tab = rtab; |
1880 | rtab = NULL; | 1880 | rtab = NULL; |
1881 | cl->refcnt = 1; | 1881 | cl->refcnt = 1; |
1882 | if (!(cl->q = qdisc_create_dflt(sch->dev, sch->dev_queue, | 1882 | if (!(cl->q = qdisc_create_dflt(qdisc_dev(sch), sch->dev_queue, |
1883 | &pfifo_qdisc_ops, classid))) | 1883 | &pfifo_qdisc_ops, classid))) |
1884 | cl->q = &noop_qdisc; | 1884 | cl->q = &noop_qdisc; |
1885 | cl->common.classid = classid; | 1885 | cl->common.classid = classid; |
@@ -1919,7 +1919,7 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct nlattr **t | |||
1919 | 1919 | ||
1920 | if (tca[TCA_RATE]) | 1920 | if (tca[TCA_RATE]) |
1921 | gen_new_estimator(&cl->bstats, &cl->rate_est, | 1921 | gen_new_estimator(&cl->bstats, &cl->rate_est, |
1922 | &sch->dev->queue_lock, tca[TCA_RATE]); | 1922 | &qdisc_dev(sch)->queue_lock, tca[TCA_RATE]); |
1923 | 1923 | ||
1924 | *arg = (unsigned long)cl; | 1924 | *arg = (unsigned long)cl; |
1925 | return 0; | 1925 | return 0; |