summaryrefslogtreecommitdiffstats
path: root/include/net/sch_generic.h
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2010-07-26 01:52:21 +0200
committerGrant Likely <grant.likely@secretlab.ca>2010-07-26 01:52:21 +0200
commit5ffdcd94ea0171cf9a3ca63051c2246426103b5b (patch)
treedfa1522796d5af649caf64ac6e2f1e69119e85d0 /include/net/sch_generic.h
parentspi/mpc5121: change annotations for probe and remove functions (diff)
parentLinux 2.6.35-rc6 (diff)
downloadlinux-5ffdcd94ea0171cf9a3ca63051c2246426103b5b.tar.xz
linux-5ffdcd94ea0171cf9a3ca63051c2246426103b5b.zip
Merge commit 'v2.6.35-rc6' into spi/test
Diffstat (limited to 'include/net/sch_generic.h')
-rw-r--r--include/net/sch_generic.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 03ca5d826757..433604bb3fe8 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -313,12 +313,24 @@ extern void qdisc_calculate_pkt_len(struct sk_buff *skb,
extern void tcf_destroy(struct tcf_proto *tp);
extern void tcf_destroy_chain(struct tcf_proto **fl);
-/* Reset all TX qdiscs of a device. */
+/* Reset all TX qdiscs greater then index of a device. */
+static inline void qdisc_reset_all_tx_gt(struct net_device *dev, unsigned int i)
+{
+ struct Qdisc *qdisc;
+
+ for (; i < dev->num_tx_queues; i++) {
+ qdisc = netdev_get_tx_queue(dev, i)->qdisc;
+ if (qdisc) {
+ spin_lock_bh(qdisc_lock(qdisc));
+ qdisc_reset(qdisc);
+ spin_unlock_bh(qdisc_lock(qdisc));
+ }
+ }
+}
+
static inline void qdisc_reset_all_tx(struct net_device *dev)
{
- unsigned int i;
- for (i = 0; i < dev->num_tx_queues; i++)
- qdisc_reset(netdev_get_tx_queue(dev, i)->qdisc);
+ qdisc_reset_all_tx_gt(dev, 0);
}
/* Are all TX queues of the device empty? */