aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/sch_generic.h1
-rw-r--r--net/sched/sch_generic.c22
2 files changed, 18 insertions, 5 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 3b983e8a0555..3fe49d808957 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -52,6 +52,7 @@ struct Qdisc
52 u32 parent; 52 u32 parent;
53 atomic_t refcnt; 53 atomic_t refcnt;
54 unsigned long state; 54 unsigned long state;
55 struct sk_buff *gso_skb;
55 struct sk_buff_head requeue; 56 struct sk_buff_head requeue;
56 struct sk_buff_head q; 57 struct sk_buff_head q;
57 struct netdev_queue *dev_queue; 58 struct netdev_queue *dev_queue;
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);