diff options
Diffstat (limited to 'net/sched/sch_netem.c')
-rw-r--r-- | net/sched/sch_netem.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c index 2898d9dc31eb..74fbdb52baed 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c | |||
@@ -283,25 +283,22 @@ static struct sk_buff *netem_dequeue(struct Qdisc *sch) | |||
283 | if (sch->flags & TCQ_F_THROTTLED) | 283 | if (sch->flags & TCQ_F_THROTTLED) |
284 | return NULL; | 284 | return NULL; |
285 | 285 | ||
286 | skb = q->qdisc->dequeue(q->qdisc); | 286 | skb = q->qdisc->ops->peek(q->qdisc); |
287 | if (skb) { | 287 | if (skb) { |
288 | const struct netem_skb_cb *cb = netem_skb_cb(skb); | 288 | const struct netem_skb_cb *cb = netem_skb_cb(skb); |
289 | psched_time_t now = psched_get_time(); | 289 | psched_time_t now = psched_get_time(); |
290 | 290 | ||
291 | /* if more time remaining? */ | 291 | /* if more time remaining? */ |
292 | if (cb->time_to_send <= now) { | 292 | if (cb->time_to_send <= now) { |
293 | skb = q->qdisc->dequeue(q->qdisc); | ||
294 | if (!skb) | ||
295 | return NULL; | ||
296 | |||
293 | pr_debug("netem_dequeue: return skb=%p\n", skb); | 297 | pr_debug("netem_dequeue: return skb=%p\n", skb); |
294 | sch->q.qlen--; | 298 | sch->q.qlen--; |
295 | return skb; | 299 | return skb; |
296 | } | 300 | } |
297 | 301 | ||
298 | if (unlikely(q->qdisc->ops->requeue(skb, q->qdisc) != NET_XMIT_SUCCESS)) { | ||
299 | qdisc_tree_decrease_qlen(q->qdisc, 1); | ||
300 | sch->qstats.drops++; | ||
301 | printk(KERN_ERR "netem: %s could not requeue\n", | ||
302 | q->qdisc->ops->id); | ||
303 | } | ||
304 | |||
305 | qdisc_watchdog_schedule(&q->watchdog, cb->time_to_send); | 302 | qdisc_watchdog_schedule(&q->watchdog, cb->time_to_send); |
306 | } | 303 | } |
307 | 304 | ||