diff options
author | Jarek Poplawski <jarkao2@gmail.com> | 2009-09-15 05:53:07 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-09-15 05:53:07 -0400 |
commit | 926e61b7c44db83013159ac2f74bccd451607b5a (patch) | |
tree | 512b532e22d4374948e0d149902304edfbef7e25 /net/sched/sch_api.c | |
parent | ca519274d537706b6fb1e3e91238d34a23320584 (diff) |
pkt_sched: Fix tx queue selection in tc_modify_qdisc
After the recent mq change there is the new select_queue qdisc class
method used in tc_modify_qdisc, but it works OK only for direct child
qdiscs of mq qdisc. Grandchildren always get the first tx queue, which
would give wrong qdisc_root etc. results (e.g. for sch_htb as child of
sch_prio). This patch fixes it by using parent's dev_queue for such
grandchildren qdiscs. The select_queue method's return type is changed
BTW.
With feedback from: Patrick McHardy <kaber@trash.net>
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_api.c')
-rw-r--r-- | net/sched/sch_api.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index c6e4063f698c..1367aa21fad5 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c | |||
@@ -1116,12 +1116,16 @@ create_n_graft: | |||
1116 | tcm->tcm_parent, tcm->tcm_parent, | 1116 | tcm->tcm_parent, tcm->tcm_parent, |
1117 | tca, &err); | 1117 | tca, &err); |
1118 | else { | 1118 | else { |
1119 | unsigned int ntx = 0; | 1119 | struct netdev_queue *dev_queue; |
1120 | 1120 | ||
1121 | if (p && p->ops->cl_ops && p->ops->cl_ops->select_queue) | 1121 | if (p && p->ops->cl_ops && p->ops->cl_ops->select_queue) |
1122 | ntx = p->ops->cl_ops->select_queue(p, tcm); | 1122 | dev_queue = p->ops->cl_ops->select_queue(p, tcm); |
1123 | else if (p) | ||
1124 | dev_queue = p->dev_queue; | ||
1125 | else | ||
1126 | dev_queue = netdev_get_tx_queue(dev, 0); | ||
1123 | 1127 | ||
1124 | q = qdisc_create(dev, netdev_get_tx_queue(dev, ntx), p, | 1128 | q = qdisc_create(dev, dev_queue, p, |
1125 | tcm->tcm_parent, tcm->tcm_handle, | 1129 | tcm->tcm_parent, tcm->tcm_handle, |
1126 | tca, &err); | 1130 | tca, &err); |
1127 | } | 1131 | } |