diff options
author | Jarek Poplawski <jarkao2@gmail.com> | 2008-11-25 16:56:06 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-25 16:56:06 -0500 |
commit | f6486d40b33d1ac2c44c7c55db7edf022d9f4329 (patch) | |
tree | d3ad09264b9074cc70a3c7ec4229273f4779d8ed /net/sched | |
parent | 723b46108f8ee75b61ce703d0c9225e4f537bc46 (diff) |
pkt_sched: sch_api: Remove qdisc_list_lock
After implementing qdisc->ops->peek() there is no more calling
qdisc_tree_decrease_qlen() without rtnl_lock(), so qdisc_list_lock
added by commit: f6e0b239a2657ea8cb67f0d83d0bfdbfd19a481b "pkt_sched:
Fix qdisc list locking" can be removed.
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-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 1ef25e6ee1f..3fcfd4ef11d 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 | ||