Skip to contentSkip to conversation

multiq: requeue should rewind the current_band

PATCH Applied Alexander Duyck 2 participants 2 messages Sep 19, 2008 – Sep 21, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 multiq: requeue should rewind the current_band

Currently dequeueing a packet and requeueing the same packet will cause a different packet to be pulled on the next dequeue. This change forces requeue to rewind the current_band.

---

 net/sched/sch_multiq.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
net/sched/sch_multiq.c +5 -0
index 5d9cd68..915f314 100644
@@ -97,6 +97,7 @@ static int
 multiq_requeue(struct sk_buff *skb, struct Qdisc *sch)
 {
 	struct Qdisc *qdisc;
+	struct multiq_sched_data *q = qdisc_priv(sch);
 	int ret;
 
 	qdisc = multiq_classify(skb, sch, &ret);
@@ -113,6 +114,10 @@ multiq_requeue(struct sk_buff *skb, struct Qdisc *sch)
 	if (ret == NET_XMIT_SUCCESS) {
 		sch->q.qlen++;
 		sch->qstats.requeues++;
+		if (q->curband)
+			q->curband--;
+		else
+			q->curband = q->bands - 1;
 		return NET_XMIT_SUCCESS;
 	}
 	if (net_xmit_drop_count(ret))
maintainer Applied
#1 lore raw

From: Alexander Duyck <[email protected]>
Date: Thu, 18 Sep 2008 17:43:22 -0700

Quoted 5 lines

Currently dequeueing a packet and requeueing the same packet will cause a different packet to be pulled on the next dequeue. This change forces requeue to rewind the current_band.

Applied to net-next-2.6, thanks Alexander.