diff options
Diffstat (limited to 'net/sched/sch_api.c')
-rw-r--r-- | net/sched/sch_api.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index e7fb9e0d21b4..1122c952aa99 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c | |||
@@ -624,7 +624,7 @@ static struct Qdisc *dev_graft_qdisc(struct netdev_queue *dev_queue, | |||
624 | struct Qdisc *oqdisc = dev_queue->qdisc_sleeping; | 624 | struct Qdisc *oqdisc = dev_queue->qdisc_sleeping; |
625 | spinlock_t *root_lock; | 625 | spinlock_t *root_lock; |
626 | 626 | ||
627 | root_lock = qdisc_root_lock(oqdisc); | 627 | root_lock = qdisc_lock(oqdisc); |
628 | spin_lock_bh(root_lock); | 628 | spin_lock_bh(root_lock); |
629 | 629 | ||
630 | /* Prune old scheduler */ | 630 | /* Prune old scheduler */ |
@@ -635,7 +635,7 @@ static struct Qdisc *dev_graft_qdisc(struct netdev_queue *dev_queue, | |||
635 | if (qdisc == NULL) | 635 | if (qdisc == NULL) |
636 | qdisc = &noop_qdisc; | 636 | qdisc = &noop_qdisc; |
637 | dev_queue->qdisc_sleeping = qdisc; | 637 | dev_queue->qdisc_sleeping = qdisc; |
638 | dev_queue->qdisc = &noop_qdisc; | 638 | rcu_assign_pointer(dev_queue->qdisc, &noop_qdisc); |
639 | 639 | ||
640 | spin_unlock_bh(root_lock); | 640 | spin_unlock_bh(root_lock); |
641 | 641 | ||
@@ -830,9 +830,16 @@ qdisc_create(struct net_device *dev, struct netdev_queue *dev_queue, | |||
830 | sch->stab = stab; | 830 | sch->stab = stab; |
831 | } | 831 | } |
832 | if (tca[TCA_RATE]) { | 832 | if (tca[TCA_RATE]) { |
833 | spinlock_t *root_lock; | ||
834 | |||
835 | if ((sch->parent != TC_H_ROOT) && | ||
836 | !(sch->flags & TCQ_F_INGRESS)) | ||
837 | root_lock = qdisc_root_sleeping_lock(sch); | ||
838 | else | ||
839 | root_lock = qdisc_lock(sch); | ||
840 | |||
833 | err = gen_new_estimator(&sch->bstats, &sch->rate_est, | 841 | err = gen_new_estimator(&sch->bstats, &sch->rate_est, |
834 | qdisc_root_lock(sch), | 842 | root_lock, tca[TCA_RATE]); |
835 | tca[TCA_RATE]); | ||
836 | if (err) { | 843 | if (err) { |
837 | /* | 844 | /* |
838 | * Any broken qdiscs that would require | 845 | * Any broken qdiscs that would require |
@@ -884,7 +891,8 @@ static int qdisc_change(struct Qdisc *sch, struct nlattr **tca) | |||
884 | 891 | ||
885 | if (tca[TCA_RATE]) | 892 | if (tca[TCA_RATE]) |
886 | gen_replace_estimator(&sch->bstats, &sch->rate_est, | 893 | gen_replace_estimator(&sch->bstats, &sch->rate_est, |
887 | qdisc_root_lock(sch), tca[TCA_RATE]); | 894 | qdisc_root_sleeping_lock(sch), |
895 | tca[TCA_RATE]); | ||
888 | return 0; | 896 | return 0; |
889 | } | 897 | } |
890 | 898 | ||
@@ -1161,8 +1169,8 @@ static int tc_fill_qdisc(struct sk_buff *skb, struct Qdisc *q, u32 clid, | |||
1161 | if (q->stab && qdisc_dump_stab(skb, q->stab) < 0) | 1169 | if (q->stab && qdisc_dump_stab(skb, q->stab) < 0) |
1162 | goto nla_put_failure; | 1170 | goto nla_put_failure; |
1163 | 1171 | ||
1164 | if (gnet_stats_start_copy_compat(skb, TCA_STATS2, TCA_STATS, | 1172 | if (gnet_stats_start_copy_compat(skb, TCA_STATS2, TCA_STATS, TCA_XSTATS, |
1165 | TCA_XSTATS, qdisc_root_lock(q), &d) < 0) | 1173 | qdisc_root_sleeping_lock(q), &d) < 0) |
1166 | goto nla_put_failure; | 1174 | goto nla_put_failure; |
1167 | 1175 | ||
1168 | if (q->ops->dump_stats && q->ops->dump_stats(q, &d) < 0) | 1176 | if (q->ops->dump_stats && q->ops->dump_stats(q, &d) < 0) |
@@ -1453,8 +1461,8 @@ static int tc_fill_tclass(struct sk_buff *skb, struct Qdisc *q, | |||
1453 | if (cl_ops->dump && cl_ops->dump(q, cl, skb, tcm) < 0) | 1461 | if (cl_ops->dump && cl_ops->dump(q, cl, skb, tcm) < 0) |
1454 | goto nla_put_failure; | 1462 | goto nla_put_failure; |
1455 | 1463 | ||
1456 | if (gnet_stats_start_copy_compat(skb, TCA_STATS2, TCA_STATS, | 1464 | if (gnet_stats_start_copy_compat(skb, TCA_STATS2, TCA_STATS, TCA_XSTATS, |
1457 | TCA_XSTATS, qdisc_root_lock(q), &d) < 0) | 1465 | qdisc_root_sleeping_lock(q), &d) < 0) |
1458 | goto nla_put_failure; | 1466 | goto nla_put_failure; |
1459 | 1467 | ||
1460 | if (cl_ops->dump_stats && cl_ops->dump_stats(q, cl, &d) < 0) | 1468 | if (cl_ops->dump_stats && cl_ops->dump_stats(q, cl, &d) < 0) |