]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
sch_sfq: fix peek() implementation
authorEric Dumazet <eric.dumazet@gmail.com>
Wed, 25 May 2011 04:40:11 +0000 (04:40 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 3 Jun 2011 00:31:56 +0000 (09:31 +0900)
[ Upstream commit 07bd8df5df4369487812bf85a237322ff3569b77 ]

Since commit eeaeb068f139 (sch_sfq: allow big packets and be fair),
sfq_peek() can return a different skb that would be normally dequeued by
sfq_dequeue() [ if current slot->allot is negative ]

Use generic qdisc_peek_dequeued() instead of custom implementation, to
get consistent result.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Jarek Poplawski <jarkao2@gmail.com>
CC: Patrick McHardy <kaber@trash.net>
CC: Jesper Dangaard Brouer <hawk@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/sched/sch_sfq.c

index c2e628dfaaccb0f2dacffa9bbc5dec34bbb5f291..5b8ae41500c4ca8d85dfe2696272d4ac0a92ec11 100644 (file)
@@ -409,18 +409,6 @@ sfq_enqueue(struct sk_buff *skb, struct Qdisc *sch)
        return NET_XMIT_CN;
 }
 
-static struct sk_buff *
-sfq_peek(struct Qdisc *sch)
-{
-       struct sfq_sched_data *q = qdisc_priv(sch);
-
-       /* No active slots */
-       if (q->tail == NULL)
-               return NULL;
-
-       return q->slots[q->tail->next].skblist_next;
-}
-
 static struct sk_buff *
 sfq_dequeue(struct Qdisc *sch)
 {
@@ -702,7 +690,7 @@ static struct Qdisc_ops sfq_qdisc_ops __read_mostly = {
        .priv_size      =       sizeof(struct sfq_sched_data),
        .enqueue        =       sfq_enqueue,
        .dequeue        =       sfq_dequeue,
-       .peek           =       sfq_peek,
+       .peek           =       qdisc_peek_dequeued,
        .drop           =       sfq_drop,
        .init           =       sfq_init,
        .reset          =       sfq_reset,