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: f6e0b239a2 "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>
This commit is contained in:
Jarek Poplawski 2008-11-25 13:56:06 -08:00 committed by David S. Miller
parent 723b46108f
commit f6486d40b3

View File

@ -204,28 +204,16 @@ struct Qdisc *qdisc_match_from_root(struct Qdisc *root, u32 handle)
return NULL; return NULL;
} }
/*
* This lock is needed until some qdiscs stop calling qdisc_tree_decrease_qlen()
* without rtnl_lock(); currently hfsc_dequeue(), netem_dequeue(), tbf_dequeue()
*/
static DEFINE_SPINLOCK(qdisc_list_lock);
static void qdisc_list_add(struct Qdisc *q) static void qdisc_list_add(struct Qdisc *q)
{ {
if ((q->parent != TC_H_ROOT) && !(q->flags & TCQ_F_INGRESS)) { if ((q->parent != TC_H_ROOT) && !(q->flags & TCQ_F_INGRESS))
spin_lock_bh(&qdisc_list_lock);
list_add_tail(&q->list, &qdisc_root_sleeping(q)->list); list_add_tail(&q->list, &qdisc_root_sleeping(q)->list);
spin_unlock_bh(&qdisc_list_lock);
}
} }
void qdisc_list_del(struct Qdisc *q) void qdisc_list_del(struct Qdisc *q)
{ {
if ((q->parent != TC_H_ROOT) && !(q->flags & TCQ_F_INGRESS)) { if ((q->parent != TC_H_ROOT) && !(q->flags & TCQ_F_INGRESS))
spin_lock_bh(&qdisc_list_lock);
list_del(&q->list); list_del(&q->list);
spin_unlock_bh(&qdisc_list_lock);
}
} }
EXPORT_SYMBOL(qdisc_list_del); EXPORT_SYMBOL(qdisc_list_del);
@ -234,22 +222,17 @@ struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle)
unsigned int i; unsigned int i;
struct Qdisc *q; struct Qdisc *q;
spin_lock_bh(&qdisc_list_lock);
for (i = 0; i < dev->num_tx_queues; i++) { for (i = 0; i < dev->num_tx_queues; i++) {
struct netdev_queue *txq = netdev_get_tx_queue(dev, i); struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
struct Qdisc *txq_root = txq->qdisc_sleeping; struct Qdisc *txq_root = txq->qdisc_sleeping;
q = qdisc_match_from_root(txq_root, handle); q = qdisc_match_from_root(txq_root, handle);
if (q) if (q)
goto unlock; goto out;
} }
q = qdisc_match_from_root(dev->rx_queue.qdisc_sleeping, handle); q = qdisc_match_from_root(dev->rx_queue.qdisc_sleeping, handle);
out:
unlock:
spin_unlock_bh(&qdisc_list_lock);
return q; return q;
} }