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.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 5e7e0bd38fe8..3db4cf1bd263 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -44,7 +44,10 @@ static inline int qdisc_qlen(struct Qdisc *q)
44 44
45static inline int dev_requeue_skb(struct sk_buff *skb, struct Qdisc *q) 45static inline int dev_requeue_skb(struct sk_buff *skb, struct Qdisc *q)
46{ 46{
47 __skb_queue_head(&q->requeue, skb); 47 if (unlikely(skb->next))
48 q->gso_skb = skb;
49 else
50 __skb_queue_head(&q->requeue, skb);
48 51
49 __netif_schedule(q); 52 __netif_schedule(q);
50 return 0; 53 return 0;
@@ -52,7 +55,10 @@ static inline int dev_requeue_skb(struct sk_buff *skb, struct Qdisc *q)
52 55
53static inline struct sk_buff *dequeue_skb(struct Qdisc *q) 56static inline struct sk_buff *dequeue_skb(struct Qdisc *q)
54{ 57{
55 struct sk_buff *skb = skb_peek(&q->requeue); 58 struct sk_buff *skb = q->gso_skb;
59
60 if (!skb)
61 skb = skb_peek(&q->requeue);
56 62
57 if (unlikely(skb)) { 63 if (unlikely(skb)) {
58 struct net_device *dev = qdisc_dev(q); 64 struct net_device *dev = qdisc_dev(q);
@@ -60,10 +66,15 @@ static inline struct sk_buff *dequeue_skb(struct Qdisc *q)
60 66
61 /* check the reason of requeuing without tx lock first */ 67 /* check the reason of requeuing without tx lock first */
62 txq = netdev_get_tx_queue(dev, skb_get_queue_mapping(skb)); 68 txq = netdev_get_tx_queue(dev, skb_get_queue_mapping(skb));
63 if (!netif_tx_queue_stopped(txq) && !netif_tx_queue_frozen(txq)) 69 if (!netif_tx_queue_stopped(txq) &&
64 __skb_unlink(skb, &q->requeue); 70 !netif_tx_queue_frozen(txq)) {
65 else 71 if (q->gso_skb)
72 q->gso_skb = NULL;
73 else
74 __skb_unlink(skb, &q->requeue);
75 } else {
66 skb = NULL; 76 skb = NULL;
77 }
67 } else { 78 } else {
68 skb = q->dequeue(q); 79 skb = q->dequeue(q);
69 } 80 }
@@ -548,6 +559,7 @@ void qdisc_destroy(struct Qdisc *qdisc)
548 module_put(ops->owner); 559 module_put(ops->owner);
549 dev_put(qdisc_dev(qdisc)); 560 dev_put(qdisc_dev(qdisc));
550 561
562 kfree_skb(qdisc->gso_skb);
551 __skb_queue_purge(&qdisc->requeue); 563 __skb_queue_purge(&qdisc->requeue);
552 564
553 kfree((char *) qdisc - qdisc->padded); 565 kfree((char *) qdisc - qdisc->padded);