summaryrefslogtreecommitdiffstats
path: root/net/sched
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-07-16 00:56:32 -0700
committerDavid S. Miller <davem@davemloft.net>2008-07-17 19:21:18 -0700
commite2627c8c2241bce45e368e150654d076b58a4595 (patch)
treee3ad7d1867339f254a324ba1acd5d8bdac1aca76 /net/sched
parentd3b753db7c4f1f37a98b51974d484fda5d86dab5 (diff)
downloadop-kernel-dev-e2627c8c2241bce45e368e150654d076b58a4595.zip
op-kernel-dev-e2627c8c2241bce45e368e150654d076b58a4595.tar.gz
pkt_sched: Make QDISC_RUNNING a qdisc state.
Currently it is associated with a netdev_queue, but when we have qdisc sharing that no longer makes any sense. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/sch_generic.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 2bd75be..ac208c2 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -130,8 +130,8 @@ static inline int handle_dev_cpu_collision(struct sk_buff *skb,
/*
* NOTE: Called under queue->lock with locally disabled BH.
*
- * __QUEUE_STATE_QDISC_RUNNING guarantees only one CPU can process
- * this queue at a time. queue->lock serializes queue accesses for
+ * __QDISC_STATE_RUNNING guarantees only one CPU can process
+ * this qdisc at a time. queue->lock serializes queue accesses for
* this queue AND txq->qdisc pointer itself.
*
* netif_tx_lock serializes accesses to device driver.
@@ -146,9 +146,9 @@ static inline int handle_dev_cpu_collision(struct sk_buff *skb,
* >0 - queue is not empty.
*
*/
-static inline int qdisc_restart(struct netdev_queue *txq)
+static inline int qdisc_restart(struct netdev_queue *txq,
+ struct Qdisc *q)
{
- struct Qdisc *q = txq->qdisc;
int ret = NETDEV_TX_BUSY;
struct net_device *dev;
struct sk_buff *skb;
@@ -168,7 +168,6 @@ static inline int qdisc_restart(struct netdev_queue *txq)
HARD_TX_UNLOCK(dev, txq);
spin_lock(&txq->lock);
- q = txq->qdisc;
switch (ret) {
case NETDEV_TX_OK:
@@ -197,8 +196,9 @@ static inline int qdisc_restart(struct netdev_queue *txq)
void __qdisc_run(struct netdev_queue *txq)
{
unsigned long start_time = jiffies;
+ struct Qdisc *q = txq->qdisc;
- while (qdisc_restart(txq)) {
+ while (qdisc_restart(txq, q)) {
if (netif_tx_queue_stopped(txq))
break;
@@ -213,7 +213,7 @@ void __qdisc_run(struct netdev_queue *txq)
}
}
- clear_bit(__QUEUE_STATE_QDISC_RUNNING, &txq->state);
+ clear_bit(__QDISC_STATE_RUNNING, &q->state);
}
static void dev_watchdog(unsigned long arg)
@@ -666,14 +666,16 @@ static bool some_qdisc_is_running(struct net_device *dev, int lock)
for (i = 0; i < dev->num_tx_queues; i++) {
struct netdev_queue *dev_queue;
+ struct Qdisc *q;
int val;
dev_queue = netdev_get_tx_queue(dev, i);
+ q = dev_queue->qdisc;
if (lock)
spin_lock_bh(&dev_queue->lock);
- val = test_bit(__QUEUE_STATE_QDISC_RUNNING, &dev_queue->state);
+ val = test_bit(__QDISC_STATE_RUNNING, &q->state);
if (lock)
spin_unlock_bh(&dev_queue->lock);
OpenPOWER on IntegriCloud