Skip to content

Commit b262a5d

Browse files
Eric Dumazetgregkh
authored andcommitted
sch_sfq: fix peek() implementation
[ Upstream commit 07bd8df ] 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> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent 5e29567 commit b262a5d

1 file changed

Lines changed: 1 addition & 13 deletions

File tree

net/sched/sch_sfq.c

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -409,18 +409,6 @@ sfq_enqueue(struct sk_buff *skb, struct Qdisc *sch)
409409
return NET_XMIT_CN;
410410
}
411411

412-
static struct sk_buff *
413-
sfq_peek(struct Qdisc *sch)
414-
{
415-
struct sfq_sched_data *q = qdisc_priv(sch);
416-
417-
/* No active slots */
418-
if (q->tail == NULL)
419-
return NULL;
420-
421-
return q->slots[q->tail->next].skblist_next;
422-
}
423-
424412
static struct sk_buff *
425413
sfq_dequeue(struct Qdisc *sch)
426414
{
@@ -702,7 +690,7 @@ static struct Qdisc_ops sfq_qdisc_ops __read_mostly = {
702690
.priv_size = sizeof(struct sfq_sched_data),
703691
.enqueue = sfq_enqueue,
704692
.dequeue = sfq_dequeue,
705-
.peek = sfq_peek,
693+
.peek = qdisc_peek_dequeued,
706694
.drop = sfq_drop,
707695
.init = sfq_init,
708696
.reset = sfq_reset,

0 commit comments

Comments
 (0)