diff options
author | Patrick McHardy <kaber@trash.net> | 2009-09-04 02:41:18 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-09-06 05:07:03 -0400 |
commit | af356afa010f3cd2c8b8fcc3bce90f7a7b7ec02a (patch) | |
tree | 302d938363bbaec3e69a58e36dbf8a304b24144c /net/sched/cls_api.c | |
parent | 5b9a9ccfad8553dbf7a9b17ba78bad70215ed0e2 (diff) |
net_sched: reintroduce dev->qdisc for use by sch_api
Currently the multiqueue integration with the qdisc API suffers from
a few problems:
- with multiple queues, all root qdiscs use the same handle. This means
they can't be exposed to userspace in a backwards compatible fashion.
- all API operations always refer to queue number 0. Newly created
qdiscs are automatically shared between all queues, its not possible
to address individual queues or restore multiqueue behaviour once a
shared qdisc has been attached.
- Dumps only contain the root qdisc of queue 0, in case of non-shared
qdiscs this means the statistics are incomplete.
This patch reintroduces dev->qdisc, which points to the (single) root qdisc
from userspace's point of view. Currently it either points to the first
(non-shared) default qdisc, or a qdisc shared between all queues. The
following patches will introduce a classful dummy qdisc, which will be used
as root qdisc and contain the per-queue qdiscs as children.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/cls_api.c')
-rw-r--r-- | net/sched/cls_api.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index bcfbdb4758c9..6a536949cdc0 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c | |||
@@ -168,8 +168,7 @@ replay: | |||
168 | 168 | ||
169 | /* Find qdisc */ | 169 | /* Find qdisc */ |
170 | if (!parent) { | 170 | if (!parent) { |
171 | struct netdev_queue *dev_queue = netdev_get_tx_queue(dev, 0); | 171 | q = dev->qdisc; |
172 | q = dev_queue->qdisc_sleeping; | ||
173 | parent = q->handle; | 172 | parent = q->handle; |
174 | } else { | 173 | } else { |
175 | q = qdisc_lookup(dev, TC_H_MAJ(t->tcm_parent)); | 174 | q = qdisc_lookup(dev, TC_H_MAJ(t->tcm_parent)); |
@@ -408,7 +407,6 @@ static int tcf_node_dump(struct tcf_proto *tp, unsigned long n, | |||
408 | static int tc_dump_tfilter(struct sk_buff *skb, struct netlink_callback *cb) | 407 | static int tc_dump_tfilter(struct sk_buff *skb, struct netlink_callback *cb) |
409 | { | 408 | { |
410 | struct net *net = sock_net(skb->sk); | 409 | struct net *net = sock_net(skb->sk); |
411 | struct netdev_queue *dev_queue; | ||
412 | int t; | 410 | int t; |
413 | int s_t; | 411 | int s_t; |
414 | struct net_device *dev; | 412 | struct net_device *dev; |
@@ -427,9 +425,8 @@ static int tc_dump_tfilter(struct sk_buff *skb, struct netlink_callback *cb) | |||
427 | if ((dev = dev_get_by_index(&init_net, tcm->tcm_ifindex)) == NULL) | 425 | if ((dev = dev_get_by_index(&init_net, tcm->tcm_ifindex)) == NULL) |
428 | return skb->len; | 426 | return skb->len; |
429 | 427 | ||
430 | dev_queue = netdev_get_tx_queue(dev, 0); | ||
431 | if (!tcm->tcm_parent) | 428 | if (!tcm->tcm_parent) |
432 | q = dev_queue->qdisc_sleeping; | 429 | q = dev->qdisc; |
433 | else | 430 | else |
434 | q = qdisc_lookup(dev, TC_H_MAJ(tcm->tcm_parent)); | 431 | q = qdisc_lookup(dev, TC_H_MAJ(tcm->tcm_parent)); |
435 | if (!q) | 432 | if (!q) |