aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_generic.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched/sch_generic.c')
-rw-r--r--net/sched/sch_generic.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 137db1cbde85..ac28f6a5d70e 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -46,6 +46,8 @@ EXPORT_SYMBOL(default_qdisc_ops);
46 * - updates to tree and tree walking are only done under the rtnl mutex. 46 * - updates to tree and tree walking are only done under the rtnl mutex.
47 */ 47 */
48 48
49#define SKB_XOFF_MAGIC ((struct sk_buff *)1UL)
50
49static inline struct sk_buff *__skb_dequeue_bad_txq(struct Qdisc *q) 51static inline struct sk_buff *__skb_dequeue_bad_txq(struct Qdisc *q)
50{ 52{
51 const struct netdev_queue *txq = q->dev_queue; 53 const struct netdev_queue *txq = q->dev_queue;
@@ -71,7 +73,7 @@ static inline struct sk_buff *__skb_dequeue_bad_txq(struct Qdisc *q)
71 q->q.qlen--; 73 q->q.qlen--;
72 } 74 }
73 } else { 75 } else {
74 skb = NULL; 76 skb = SKB_XOFF_MAGIC;
75 } 77 }
76 } 78 }
77 79
@@ -253,8 +255,11 @@ validate:
253 return skb; 255 return skb;
254 256
255 skb = qdisc_dequeue_skb_bad_txq(q); 257 skb = qdisc_dequeue_skb_bad_txq(q);
256 if (unlikely(skb)) 258 if (unlikely(skb)) {
259 if (skb == SKB_XOFF_MAGIC)
260 return NULL;
257 goto bulk; 261 goto bulk;
262 }
258 skb = q->dequeue(q); 263 skb = q->dequeue(q);
259 if (skb) { 264 if (skb) {
260bulk: 265bulk: