diff options
Diffstat (limited to 'net/sched/sch_tbf.c')
-rw-r--r-- | net/sched/sch_tbf.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c index 94c61598b86a..61fdc77a48d2 100644 --- a/net/sched/sch_tbf.c +++ b/net/sched/sch_tbf.c | |||
@@ -169,7 +169,7 @@ static struct sk_buff *tbf_dequeue(struct Qdisc* sch) | |||
169 | struct tbf_sched_data *q = qdisc_priv(sch); | 169 | struct tbf_sched_data *q = qdisc_priv(sch); |
170 | struct sk_buff *skb; | 170 | struct sk_buff *skb; |
171 | 171 | ||
172 | skb = q->qdisc->dequeue(q->qdisc); | 172 | skb = q->qdisc->ops->peek(q->qdisc); |
173 | 173 | ||
174 | if (skb) { | 174 | if (skb) { |
175 | psched_time_t now; | 175 | psched_time_t now; |
@@ -192,6 +192,10 @@ static struct sk_buff *tbf_dequeue(struct Qdisc* sch) | |||
192 | toks -= L2T(q, len); | 192 | toks -= L2T(q, len); |
193 | 193 | ||
194 | if ((toks|ptoks) >= 0) { | 194 | if ((toks|ptoks) >= 0) { |
195 | skb = q->qdisc->dequeue(q->qdisc); | ||
196 | if (unlikely(!skb)) | ||
197 | return NULL; | ||
198 | |||
195 | q->t_c = now; | 199 | q->t_c = now; |
196 | q->tokens = toks; | 200 | q->tokens = toks; |
197 | q->ptokens = ptoks; | 201 | q->ptokens = ptoks; |
@@ -214,12 +218,6 @@ static struct sk_buff *tbf_dequeue(struct Qdisc* sch) | |||
214 | (cf. CSZ, HPFQ, HFSC) | 218 | (cf. CSZ, HPFQ, HFSC) |
215 | */ | 219 | */ |
216 | 220 | ||
217 | if (q->qdisc->ops->requeue(skb, q->qdisc) != NET_XMIT_SUCCESS) { | ||
218 | /* When requeue fails skb is dropped */ | ||
219 | qdisc_tree_decrease_qlen(q->qdisc, 1); | ||
220 | sch->qstats.drops++; | ||
221 | } | ||
222 | |||
223 | sch->qstats.overlimits++; | 221 | sch->qstats.overlimits++; |
224 | } | 222 | } |
225 | return NULL; | 223 | return NULL; |