diff options
Diffstat (limited to 'net/sched/sch_api.c')
-rw-r--r-- | net/sched/sch_api.c | 44 |
1 files changed, 29 insertions, 15 deletions
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 408eea7086aa..b22ca2d1cebc 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c | |||
@@ -240,7 +240,10 @@ struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle) | |||
240 | if (q) | 240 | if (q) |
241 | goto out; | 241 | goto out; |
242 | 242 | ||
243 | q = qdisc_match_from_root(dev->rx_queue.qdisc_sleeping, handle); | 243 | if (dev_ingress_queue(dev)) |
244 | q = qdisc_match_from_root( | ||
245 | dev_ingress_queue(dev)->qdisc_sleeping, | ||
246 | handle); | ||
244 | out: | 247 | out: |
245 | return q; | 248 | return q; |
246 | } | 249 | } |
@@ -360,7 +363,7 @@ static struct qdisc_size_table *qdisc_get_stab(struct nlattr *opt) | |||
360 | tsize = nla_len(tb[TCA_STAB_DATA]) / sizeof(u16); | 363 | tsize = nla_len(tb[TCA_STAB_DATA]) / sizeof(u16); |
361 | } | 364 | } |
362 | 365 | ||
363 | if (!s || tsize != s->tsize || (!tab && tsize > 0)) | 366 | if (tsize != s->tsize || (!tab && tsize > 0)) |
364 | return ERR_PTR(-EINVAL); | 367 | return ERR_PTR(-EINVAL); |
365 | 368 | ||
366 | spin_lock(&qdisc_stab_lock); | 369 | spin_lock(&qdisc_stab_lock); |
@@ -690,6 +693,8 @@ static int qdisc_graft(struct net_device *dev, struct Qdisc *parent, | |||
690 | (new && new->flags & TCQ_F_INGRESS)) { | 693 | (new && new->flags & TCQ_F_INGRESS)) { |
691 | num_q = 1; | 694 | num_q = 1; |
692 | ingress = 1; | 695 | ingress = 1; |
696 | if (!dev_ingress_queue(dev)) | ||
697 | return -ENOENT; | ||
693 | } | 698 | } |
694 | 699 | ||
695 | if (dev->flags & IFF_UP) | 700 | if (dev->flags & IFF_UP) |
@@ -701,7 +706,7 @@ static int qdisc_graft(struct net_device *dev, struct Qdisc *parent, | |||
701 | } | 706 | } |
702 | 707 | ||
703 | for (i = 0; i < num_q; i++) { | 708 | for (i = 0; i < num_q; i++) { |
704 | struct netdev_queue *dev_queue = &dev->rx_queue; | 709 | struct netdev_queue *dev_queue = dev_ingress_queue(dev); |
705 | 710 | ||
706 | if (!ingress) | 711 | if (!ingress) |
707 | dev_queue = netdev_get_tx_queue(dev, i); | 712 | dev_queue = netdev_get_tx_queue(dev, i); |
@@ -979,7 +984,8 @@ static int tc_get_qdisc(struct sk_buff *skb, struct nlmsghdr *n, void *arg) | |||
979 | return -ENOENT; | 984 | return -ENOENT; |
980 | q = qdisc_leaf(p, clid); | 985 | q = qdisc_leaf(p, clid); |
981 | } else { /* ingress */ | 986 | } else { /* ingress */ |
982 | q = dev->rx_queue.qdisc_sleeping; | 987 | if (dev_ingress_queue(dev)) |
988 | q = dev_ingress_queue(dev)->qdisc_sleeping; | ||
983 | } | 989 | } |
984 | } else { | 990 | } else { |
985 | q = dev->qdisc; | 991 | q = dev->qdisc; |
@@ -1043,8 +1049,9 @@ replay: | |||
1043 | if ((p = qdisc_lookup(dev, TC_H_MAJ(clid))) == NULL) | 1049 | if ((p = qdisc_lookup(dev, TC_H_MAJ(clid))) == NULL) |
1044 | return -ENOENT; | 1050 | return -ENOENT; |
1045 | q = qdisc_leaf(p, clid); | 1051 | q = qdisc_leaf(p, clid); |
1046 | } else { /*ingress */ | 1052 | } else { /* ingress */ |
1047 | q = dev->rx_queue.qdisc_sleeping; | 1053 | if (dev_ingress_queue_create(dev)) |
1054 | q = dev_ingress_queue(dev)->qdisc_sleeping; | ||
1048 | } | 1055 | } |
1049 | } else { | 1056 | } else { |
1050 | q = dev->qdisc; | 1057 | q = dev->qdisc; |
@@ -1123,11 +1130,14 @@ replay: | |||
1123 | create_n_graft: | 1130 | create_n_graft: |
1124 | if (!(n->nlmsg_flags&NLM_F_CREATE)) | 1131 | if (!(n->nlmsg_flags&NLM_F_CREATE)) |
1125 | return -ENOENT; | 1132 | return -ENOENT; |
1126 | if (clid == TC_H_INGRESS) | 1133 | if (clid == TC_H_INGRESS) { |
1127 | q = qdisc_create(dev, &dev->rx_queue, p, | 1134 | if (dev_ingress_queue(dev)) |
1128 | tcm->tcm_parent, tcm->tcm_parent, | 1135 | q = qdisc_create(dev, dev_ingress_queue(dev), p, |
1129 | tca, &err); | 1136 | tcm->tcm_parent, tcm->tcm_parent, |
1130 | else { | 1137 | tca, &err); |
1138 | else | ||
1139 | err = -ENOENT; | ||
1140 | } else { | ||
1131 | struct netdev_queue *dev_queue; | 1141 | struct netdev_queue *dev_queue; |
1132 | 1142 | ||
1133 | if (p && p->ops->cl_ops && p->ops->cl_ops->select_queue) | 1143 | if (p && p->ops->cl_ops && p->ops->cl_ops->select_queue) |
@@ -1304,8 +1314,10 @@ static int tc_dump_qdisc(struct sk_buff *skb, struct netlink_callback *cb) | |||
1304 | if (tc_dump_qdisc_root(dev->qdisc, skb, cb, &q_idx, s_q_idx) < 0) | 1314 | if (tc_dump_qdisc_root(dev->qdisc, skb, cb, &q_idx, s_q_idx) < 0) |
1305 | goto done; | 1315 | goto done; |
1306 | 1316 | ||
1307 | dev_queue = &dev->rx_queue; | 1317 | dev_queue = dev_ingress_queue(dev); |
1308 | if (tc_dump_qdisc_root(dev_queue->qdisc_sleeping, skb, cb, &q_idx, s_q_idx) < 0) | 1318 | if (dev_queue && |
1319 | tc_dump_qdisc_root(dev_queue->qdisc_sleeping, skb, cb, | ||
1320 | &q_idx, s_q_idx) < 0) | ||
1309 | goto done; | 1321 | goto done; |
1310 | 1322 | ||
1311 | cont: | 1323 | cont: |
@@ -1595,8 +1607,10 @@ static int tc_dump_tclass(struct sk_buff *skb, struct netlink_callback *cb) | |||
1595 | if (tc_dump_tclass_root(dev->qdisc, skb, tcm, cb, &t, s_t) < 0) | 1607 | if (tc_dump_tclass_root(dev->qdisc, skb, tcm, cb, &t, s_t) < 0) |
1596 | goto done; | 1608 | goto done; |
1597 | 1609 | ||
1598 | dev_queue = &dev->rx_queue; | 1610 | dev_queue = dev_ingress_queue(dev); |
1599 | if (tc_dump_tclass_root(dev_queue->qdisc_sleeping, skb, tcm, cb, &t, s_t) < 0) | 1611 | if (dev_queue && |
1612 | tc_dump_tclass_root(dev_queue->qdisc_sleeping, skb, tcm, cb, | ||
1613 | &t, s_t) < 0) | ||
1600 | goto done; | 1614 | goto done; |
1601 | 1615 | ||
1602 | done: | 1616 | done: |