diff options
| -rw-r--r-- | net/sched/sch_api.c | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 1ef25e6ee1f9..3fcfd4ef11d1 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c | |||
| @@ -204,28 +204,16 @@ struct Qdisc *qdisc_match_from_root(struct Qdisc *root, u32 handle) | |||
| 204 | return NULL; | 204 | return NULL; |
| 205 | } | 205 | } |
| 206 | 206 | ||
| 207 | /* | ||
| 208 | * This lock is needed until some qdiscs stop calling qdisc_tree_decrease_qlen() | ||
| 209 | * without rtnl_lock(); currently hfsc_dequeue(), netem_dequeue(), tbf_dequeue() | ||
| 210 | */ | ||
| 211 | static DEFINE_SPINLOCK(qdisc_list_lock); | ||
| 212 | |||
| 213 | static void qdisc_list_add(struct Qdisc *q) | 207 | static void qdisc_list_add(struct Qdisc *q) |
| 214 | { | 208 | { |
| 215 | if ((q->parent != TC_H_ROOT) && !(q->flags & TCQ_F_INGRESS)) { | 209 | if ((q->parent != TC_H_ROOT) && !(q->flags & TCQ_F_INGRESS)) |
| 216 | spin_lock_bh(&qdisc_list_lock); | ||
| 217 | list_add_tail(&q->list, &qdisc_root_sleeping(q)->list); | 210 | list_add_tail(&q->list, &qdisc_root_sleeping(q)->list); |
| 218 | spin_unlock_bh(&qdisc_list_lock); | ||
| 219 | } | ||
| 220 | } | 211 | } |
| 221 | 212 | ||
| 222 | void qdisc_list_del(struct Qdisc *q) | 213 | void qdisc_list_del(struct Qdisc *q) |
| 223 | { | 214 | { |
| 224 | if ((q->parent != TC_H_ROOT) && !(q->flags & TCQ_F_INGRESS)) { | 215 | if ((q->parent != TC_H_ROOT) && !(q->flags & TCQ_F_INGRESS)) |
| 225 | spin_lock_bh(&qdisc_list_lock); | ||
| 226 | list_del(&q->list); | 216 | list_del(&q->list); |
| 227 | spin_unlock_bh(&qdisc_list_lock); | ||
| 228 | } | ||
| 229 | } | 217 | } |
| 230 | EXPORT_SYMBOL(qdisc_list_del); | 218 | EXPORT_SYMBOL(qdisc_list_del); |
| 231 | 219 | ||
| @@ -234,22 +222,17 @@ struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle) | |||
| 234 | unsigned int i; | 222 | unsigned int i; |
| 235 | struct Qdisc *q; | 223 | struct Qdisc *q; |
| 236 | 224 | ||
| 237 | spin_lock_bh(&qdisc_list_lock); | ||
| 238 | |||
| 239 | for (i = 0; i < dev->num_tx_queues; i++) { | 225 | for (i = 0; i < dev->num_tx_queues; i++) { |
| 240 | struct netdev_queue *txq = netdev_get_tx_queue(dev, i); | 226 | struct netdev_queue *txq = netdev_get_tx_queue(dev, i); |
| 241 | struct Qdisc *txq_root = txq->qdisc_sleeping; | 227 | struct Qdisc *txq_root = txq->qdisc_sleeping; |
| 242 | 228 | ||
| 243 | q = qdisc_match_from_root(txq_root, handle); | 229 | q = qdisc_match_from_root(txq_root, handle); |
| 244 | if (q) | 230 | if (q) |
| 245 | goto unlock; | 231 | goto out; |
| 246 | } | 232 | } |
| 247 | 233 | ||
| 248 | q = qdisc_match_from_root(dev->rx_queue.qdisc_sleeping, handle); | 234 | q = qdisc_match_from_root(dev->rx_queue.qdisc_sleeping, handle); |
| 249 | 235 | out: | |
| 250 | unlock: | ||
| 251 | spin_unlock_bh(&qdisc_list_lock); | ||
| 252 | |||
| 253 | return q; | 236 | return q; |
| 254 | } | 237 | } |
| 255 | 238 | ||
