]> Pileus Git - ~andy/linux/blobdiff - include/net/sch_generic.h
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
[~andy/linux] / include / net / sch_generic.h
index 9dcb5bfe094a3c6b833f253c1e04cba17c3d89ae..f8c47429044aee1db7ddf54a14e405305be51b0a 100644 (file)
@@ -53,7 +53,6 @@ struct Qdisc
        atomic_t                refcnt;
        unsigned long           state;
        struct sk_buff          *gso_skb;
-       struct sk_buff_head     requeue;
        struct sk_buff_head     q;
        struct netdev_queue     *dev_queue;
        struct Qdisc            *next_sched;
@@ -112,7 +111,6 @@ struct Qdisc_ops
        int                     (*enqueue)(struct sk_buff *, struct Qdisc *);
        struct sk_buff *        (*dequeue)(struct Qdisc *);
        struct sk_buff *        (*peek)(struct Qdisc *);
-       int                     (*requeue)(struct sk_buff *, struct Qdisc *);
        unsigned int            (*drop)(struct Qdisc *);
 
        int                     (*init)(struct Qdisc *, struct nlattr *arg);
@@ -442,8 +440,12 @@ static inline struct sk_buff *qdisc_peek_head(struct Qdisc *sch)
 static inline struct sk_buff *qdisc_peek_dequeued(struct Qdisc *sch)
 {
        /* we can reuse ->gso_skb because peek isn't called for root qdiscs */
-       if (!sch->gso_skb)
+       if (!sch->gso_skb) {
                sch->gso_skb = sch->dequeue(sch);
+               if (sch->gso_skb)
+                       /* it's still part of the queue */
+                       sch->q.qlen++;
+       }
 
        return sch->gso_skb;
 }
@@ -453,29 +455,16 @@ static inline struct sk_buff *qdisc_dequeue_peeked(struct Qdisc *sch)
 {
        struct sk_buff *skb = sch->gso_skb;
 
-       if (skb)
+       if (skb) {
                sch->gso_skb = NULL;
-       else
+               sch->q.qlen--;
+       } else {
                skb = sch->dequeue(sch);
+       }
 
        return skb;
 }
 
-static inline int __qdisc_requeue(struct sk_buff *skb, struct Qdisc *sch,
-                                 struct sk_buff_head *list)
-{
-       __skb_queue_head(list, skb);
-       sch->qstats.backlog += qdisc_pkt_len(skb);
-       sch->qstats.requeues++;
-
-       return NET_XMIT_SUCCESS;
-}
-
-static inline int qdisc_requeue(struct sk_buff *skb, struct Qdisc *sch)
-{
-       return __qdisc_requeue(skb, sch, &sch->q);
-}
-
 static inline void __qdisc_reset_queue(struct Qdisc *sch,
                                       struct sk_buff_head *list)
 {