Netdev List
 help / color / mirror / Atom feed
* [PATCH] net_sched: prio: use qdisc_dequeue_peeked
@ 2011-08-09 12:04 Florian Westphal
  2011-08-09 12:56 ` Eric Dumazet
  2011-08-10  4:52 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Florian Westphal @ 2011-08-09 12:04 UTC (permalink / raw)
  To: netdev; +Cc: Florian Westphal, Eric Dumazet

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.

Cc: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
---
 Eric, does this look correct to you?
 I am not sure if sfq needs fixing instead of this patch here.

diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c
index 2a318f2..b5d56a2 100644
--- a/net/sched/sch_prio.c
+++ b/net/sched/sch_prio.c
@@ -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--;
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-08-10  4:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-09 12:04 [PATCH] net_sched: prio: use qdisc_dequeue_peeked Florian Westphal
2011-08-09 12:56 ` Eric Dumazet
2011-08-09 13:45   ` Florian Westphal
2011-08-10  4:52 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox