netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] (2/4) delay scheduler - retry if requeue fails
@ 2004-06-17 22:55 Stephen Hemminger
  2004-06-18 20:44 ` David S. Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2004-06-17 22:55 UTC (permalink / raw)
  To: David S. Miller; +Cc: lartc, netdev

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

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>

diff -Nru a/net/sched/sch_delay.c b/net/sched/sch_delay.c
--- a/net/sched/sch_delay.c	2004-06-17 15:19:07 -07:00
+++ b/net/sched/sch_delay.c	2004-06-17 15:19:07 -07:00
@@ -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;

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

* Re: [PATCH] (2/4) delay scheduler - retry if requeue fails
  2004-06-17 22:55 [PATCH] (2/4) delay scheduler - retry if requeue fails Stephen Hemminger
@ 2004-06-18 20:44 ` David S. Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2004-06-18 20:44 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: lartc, netdev

On Thu, 17 Jun 2004 15:55:59 -0700
Stephen Hemminger <shemminger@osdl.org> wrote:

> 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.

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

end of thread, other threads:[~2004-06-18 20:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-17 22:55 [PATCH] (2/4) delay scheduler - retry if requeue fails Stephen Hemminger
2004-06-18 20:44 ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).