net_sched: prio: use qdisc_dequeue_peeked
Subsystems (3)
PATCH 1/1 net_sched: prio: use qdisc_dequeue_peeked
commit 07bd8df5df4369487812bf85a237322ff3569b77 (sch_sfq: fix peek() implementation) changed sfq to use generic peek helper.
This makes HFSC complain about a non-work-conserving child qdisc, if prio with sfq child is used within hfsc:
hfsc peeks into prio qdisc, which will then peek into sfq. returned skb is stashed in sch->gso_skb.
Next, hfsc tries to dequeue from prio, but prio will call sfq dequeue directly, which may return NULL instead of previously peeked-at skb.
Have prio call qdisc_dequeue_peeked, so sfq->dequeue() is not called in this case.
---
Eric, does this look correct to you?
I am not sure if sfq needs fixing instead of this patch here.
net/sched/sch_prio.c +1 -1
@@ -112,7 +112,7 @@ static struct sk_buff *prio_dequeue(struct Qdisc *sch)for (prio =0 ; prio < q->bands; prio++) {struct Qdisc *qdisc = q->queues[prio]; -struct sk_buff *skb = qdisc->dequeue (qdisc); +struct sk_buff *skb =qdisc_dequeue_peeked (qdisc);if (skb) {qdisc_bstats_update (sch, skb); sch->q.qlen--;
Signature · 1 line
1.7.3.4
Quoted 27 lines · Florian Westphal
commit
07bd8df5df4369487812bf85a237322ff3569b77(sch_sfq: fixpeek()implementation) changed sfq to use generic peek helper.This makes HFSC complain about a non-work-conserving child qdisc, if prio with sfq child is used within hfsc:
hfsc peeks into prio qdisc, which will then peek into sfq. returned skb is stashed in
sch->gso_skb.Next, hfsc tries to dequeue from prio, but prio will call sfq dequeue directly, which may return NULL instead of previously peeked-at skb.
Have prio call
qdisc_dequeue_peeked, sosfq->dequeue()is not called in this case.Cc Eric Dumazet <[email protected]>Signed-off-by Florian Westphal <[email protected]>---
Eric, does this look correct to you?
I am not sure if sfq needs fixing instead of this patch here.net/sched/sch_prio.c +0
-0
net/sched/sch_prio.c static struct sk_buff *prio_dequeue(struct Qdisc *sch) · line 118
Quoted 8 lines
net/sched/sch_prio.c +1
-1@@ -112,7 +112,7 @@ static struct sk_buff *prio_dequeue(struct Qdisc *sch)for (prio =0 ; prio < q->bands; prio++) {struct Qdisc *qdisc = q->queues[prio]; -struct sk_buff *skb = qdisc->dequeue (qdisc); +struct sk_buff *skb =qdisc_dequeue_peeked (qdisc);if (skb) {qdisc_bstats_update (sch, skb); sch->q.qlen--;
Hi Florian
Are you sure this patch is still needed, after commit e1738bd9cecc5c867b0e2996470c1ff20f66ba79 (sch_sfq: fix sfq_enqueue())
I am asking before fully reviewing the code, I dont know who should/shouldnt call qdisc_dequeue_peeked() instead of qdisc->dequeue()
Thanks !
Quoted 20 lines · Eric Dumazet
Quoted 8 lines
Eric, does this look correct to you?
I am not sure if sfq needs fixing instead of this patch here.net/sched/sch_prio.c +0
-0net/sched/sch_prio.c static struct sk_buff *prio_dequeue(struct Qdisc *sch) · line 118
Quoted 8 lines
net/sched/sch_prio.c +1
-1@@ -112,7 +112,7 @@ static struct sk_buff *prio_dequeue(struct Qdisc *sch)for (prio =0 ; prio < q->bands; prio++) {struct Qdisc *qdisc = q->queues[prio]; -struct sk_buff *skb = qdisc->dequeue (qdisc); +struct sk_buff *skb =qdisc_dequeue_peeked (qdisc);if (skb) {qdisc_bstats_update (sch, skb); sch->q.qlen--;Hi Florian
Quoted 3 lines
Are you sure this patch is still needed, after commit
e1738bd9cecc5c867b0e2996470c1ff20f66ba79(sch_sfq: fixsfq_enqueue())
Yes, I double checked. This patch is applied, also I see HFSC complaints even without that code path touched by "sch_sfq: fix sfq_enqueue" being hit.
David Miller
maintainerFrom: Florian Westphal <[email protected]>
Date: Tue, 9 Aug 2011 14:04:43 +0200
Quoted 10 lines
commit
07bd8df5df4369487812bf85a237322ff3569b77(sch_sfq: fixpeek()implementation) changed sfq to use generic peek helper.This makes HFSC complain about a non-work-conserving child qdisc, if prio with sfq child is used within hfsc:
hfsc peeks into prio qdisc, which will then peek into sfq. returned skb is stashed in
sch->gso_skb.
Quoted 8 lines
Next, hfsc tries to dequeue from prio, but prio will call sfq dequeue directly, which may return NULL instead of previously peeked-at skb.
Have prio call
qdisc_dequeue_peeked, sosfq->dequeue()is not called in this case.Cc Eric Dumazet <[email protected]>Signed-off-by Florian Westphal <[email protected]>
Applied and queued up for -stable, thanks!