aboutsummaryrefslogtreecommitdiff
path: root/include/net/sch_generic.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/sch_generic.h')
-rw-r--r--include/net/sch_generic.h37
1 files changed, 26 insertions, 11 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 5ba66b55557..b47f556c66f 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -230,32 +230,47 @@ extern void tcf_destroy_chain(struct tcf_proto **fl);
/* Reset all TX qdiscs of a device. */
static inline void qdisc_reset_all_tx(struct net_device *dev)
{
- qdisc_reset(dev->tx_queue.qdisc);
+ unsigned int i;
+ for (i = 0; i < dev->num_tx_queues; i++)
+ qdisc_reset(netdev_get_tx_queue(dev, i)->qdisc);
}
/* Are all TX queues of the device empty? */
static inline bool qdisc_all_tx_empty(const struct net_device *dev)
{
- const struct netdev_queue *txq = &dev->tx_queue;
- const struct Qdisc *q = txq->qdisc;
+ unsigned int i;
+ for (i = 0; i < dev->num_tx_queues; i++) {
+ struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
+ const struct Qdisc *q = txq->qdisc;
- return (q->q.qlen == 0);
+ if (q->q.qlen)
+ return false;
+ }
+ return true;
}
/* Are any of the TX qdiscs changing? */
static inline bool qdisc_tx_changing(struct net_device *dev)
{
- struct netdev_queue *txq = &dev->tx_queue;
-
- return (txq->qdisc != txq->qdisc_sleeping);
+ unsigned int i;
+ for (i = 0; i < dev->num_tx_queues; i++) {
+ struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
+ if (txq->qdisc != txq->qdisc_sleeping)
+ return true;
+ }
+ return false;
}
-/* Is the device using the noop qdisc? */
+/* Is the device using the noop qdisc on all queues? */
static inline bool qdisc_tx_is_noop(const struct net_device *dev)
{
- const struct netdev_queue *txq = &dev->tx_queue;
-
- return (txq->qdisc == &noop_qdisc);
+ unsigned int i;
+ for (i = 0; i < dev->num_tx_queues; i++) {
+ struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
+ if (txq->qdisc != &noop_qdisc)
+ return false;
+ }
+ return true;
}
static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch,