Skip to contentSkip to conversation

(2/4) delay scheduler - retry if requeue fails

PATCH Applied Stephen Hemminger 2 participants 2 messages Jun 17, 2004 – Jun 18, 2004

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

PATCH 1/1 (2/4) delay scheduler - retry if requeue fails

If delay scheduler decides not to send the packet right away, it requeues it. If the requeue fails, it should go and look again rather than waking up prematurely.

Same patch should apply to both 2.6 and 2.4

net/sched/sch_delay.c +9 -5
diff -Nru a/net/sched/sch_delay.c b/net/sched/sch_delay.c
@@ -104,8 +104,10 @@
 static struct sk_buff *dly_dequeue(struct Qdisc *sch)
 {
 	struct dly_sched_data *q = (struct dly_sched_data *)sch->data;
-	struct sk_buff *skb = q->qdisc->dequeue(q->qdisc);
+	struct sk_buff *skb;
 
+ retry:
+	skb = q->qdisc->dequeue(q->qdisc);
 	if (skb) {
 		struct dly_skb_cb *cb = (struct dly_skb_cb *)skb->cb;
 		psched_time_t now;
@@ -120,6 +122,12 @@
 			return skb;
 		}
 
+		if (q->qdisc->ops->requeue(skb, q->qdisc) != NET_XMIT_SUCCESS) {
+			sch->q.qlen--;
+			sch->stats.drops++;
+			goto retry;
+		}
+
 		if (!netif_queue_stopped(sch->dev)) {
 			long delay = PSCHED_US2JIFFIE(diff);
 			if (delay <= 0)
@@ -127,10 +135,6 @@
 			mod_timer(&q->timer, jiffies+delay);
 		}
 
-		if (q->qdisc->ops->requeue(skb, q->qdisc) != NET_XMIT_SUCCESS) {
-			sch->q.qlen--;
-			sch->stats.drops++;
-		}
 		sch->flags |= TCQ_F_THROTTLED;
 	}
 	return NULL;

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

#1 lore raw
Quoted 5 lines · On Thu, 17 Jun 2004 15:55:59 -0700 Stephen Hemminger <[email protected]>…

If delay scheduler decides not to send the packet right away, it requeues it. If the requeue fails, it should go and look again rather than waking up prematurely.

Same patch should apply to both 2.6 and 2.4

Applied.