Skip to content

Commit 2f09707

Browse files
tohojoPaolo Abeni
authored andcommitted
sch_sfb: Also store skb len before calling child enqueue
Cong Wang noticed that the previous fix for sch_sfb accessing the queued skb after enqueueing it to a child qdisc was incomplete: the SFB enqueue function was also calling qdisc_qstats_backlog_inc() after enqueue, which reads the pkt len from the skb cb field. Fix this by also storing the skb len, and using the stored value to increment the backlog after enqueueing. Fixes: 9efd232 ("sch_sfb: Don't assume the skb is still around after enqueueing to child") Signed-off-by: Toke Høiland-Jørgensen <[email protected]> Acked-by: Cong Wang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent 5382033 commit 2f09707

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/sched/sch_sfb.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ static int sfb_enqueue(struct sk_buff *skb, struct Qdisc *sch,
281281
{
282282

283283
struct sfb_sched_data *q = qdisc_priv(sch);
284+
unsigned int len = qdisc_pkt_len(skb);
284285
struct Qdisc *child = q->qdisc;
285286
struct tcf_proto *fl;
286287
struct sfb_skb_cb cb;
@@ -403,7 +404,7 @@ static int sfb_enqueue(struct sk_buff *skb, struct Qdisc *sch,
403404
memcpy(&cb, sfb_skb_cb(skb), sizeof(cb));
404405
ret = qdisc_enqueue(skb, child, to_free);
405406
if (likely(ret == NET_XMIT_SUCCESS)) {
406-
qdisc_qstats_backlog_inc(sch, skb);
407+
sch->qstats.backlog += len;
407408
sch->q.qlen++;
408409
increment_qlen(&cb, q);
409410
} else if (net_xmit_drop_count(ret)) {

0 commit comments

Comments
 (0)