aboutsummaryrefslogtreecommitdiffstats
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 5ba66b555578..b47f556c66f8 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);
230/* Reset all TX qdiscs of a device. */ 230/* Reset all TX qdiscs of a device. */
231static inline void qdisc_reset_all_tx(struct net_device *dev) 231static inline void qdisc_reset_all_tx(struct net_device *dev)
232{ 232{
233 qdisc_reset(dev->tx_queue.qdisc); 233 unsigned int i;
234 for (i = 0; i < dev->num_tx_queues; i++)
235 qdisc_reset(netdev_get_tx_queue(dev, i)->qdisc);
234} 236}
235 237
236/* Are all TX queues of the device empty? */ 238/* Are all TX queues of the device empty? */
237static inline bool qdisc_all_tx_empty(const struct net_device *dev) 239static inline bool qdisc_all_tx_empty(const struct net_device *dev)
238{ 240{
239 const struct netdev_queue *txq = &dev->tx_queue; 241 unsigned int i;
240 const struct Qdisc *q = txq->qdisc; 242 for (i = 0; i < dev->num_tx_queues; i++) {
243 struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
244 const struct Qdisc *q = txq->qdisc;
241 245
242 return (q->q.qlen == 0); 246 if (q->q.qlen)
247 return false;
248 }
249 return true;
243} 250}
244 251
245/* Are any of the TX qdiscs changing? */ 252/* Are any of the TX qdiscs changing? */
246static inline bool qdisc_tx_changing(struct net_device *dev) 253static inline bool qdisc_tx_changing(struct net_device *dev)
247{ 254{
248 struct netdev_queue *txq = &dev->tx_queue; 255 unsigned int i;
249 256 for (i = 0; i < dev->num_tx_queues; i++) {
250 return (txq->qdisc != txq->qdisc_sleeping); 257 struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
258 if (txq->qdisc != txq->qdisc_sleeping)
259 return true;
260 }
261 return false;
251} 262}
252 263
253/* Is the device using the noop qdisc? */ 264/* Is the device using the noop qdisc on all queues? */
254static inline bool qdisc_tx_is_noop(const struct net_device *dev) 265static inline bool qdisc_tx_is_noop(const struct net_device *dev)
255{ 266{
256 const struct netdev_queue *txq = &dev->tx_queue; 267 unsigned int i;
257 268 for (i = 0; i < dev->num_tx_queues; i++) {
258 return (txq->qdisc == &noop_qdisc); 269 struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
270 if (txq->qdisc != &noop_qdisc)
271 return false;
272 }
273 return true;
259} 274}
260 275
261static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch, 276static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch,