Commit 8c1dd613 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by Linus Torvalds

[PKT_SCHED]: Delay scheduler should 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
Signed-off-by: default avatarStephen Hemminger <shemminger@osdl.org>
Signed-off-by: default avatarDavid S. Miller <davem@redhat.com>
parent 981193ab
......@@ -104,8 +104,10 @@ static unsigned int dly_drop(struct Qdisc *sch)
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 @@ static struct sk_buff *dly_dequeue(struct Qdisc *sch)
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 @@ static struct sk_buff *dly_dequeue(struct Qdisc *sch)
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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment