Skip to content

Commit

Permalink
sch_sfq: fix peek() implementation
Browse files Browse the repository at this point in the history
Since commit eeaeb06 (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>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed May 25, 2011
1 parent 367bbf2 commit 07bd8df
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions net/sched/sch_sfq.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,18 +413,6 @@ sfq_enqueue(struct sk_buff *skb, struct Qdisc *sch)
return (qlen != slot->qlen) ? NET_XMIT_CN : NET_XMIT_SUCCESS;
}

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)
{
Expand Down Expand Up @@ -706,7 +694,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,
Expand Down

0 comments on commit 07bd8df

Please sign in to comment.