Skip to content
Permalink
Browse files

Did I get *any* of this right first time?

  • Loading branch information
chromi committed Mar 17, 2017
1 parent e89caa6 commit 9c3da02a6d08f123f43111c2f294ff499ba558d0
Showing with 8 additions and 2 deletions.
  1. +8 −2 sch_cake.c
@@ -1280,8 +1280,14 @@ static struct sk_buff *cake_dequeue(struct Qdisc *sch)
/* charge packet bandwidth to this tin, and
* to the global shaper.
*/
b->tin_time_next_packet = now + max(b->tin_time_next_packet - now,
(len * (u64)b->tin_rate_ns) >> b->tin_rate_shft);
{
s64 tdiff1 = b->tin_time_next_packet - now;
s64 tdiff2 = (len * (u64)b->tin_rate_ns) >> b->tin_rate_shft;
if(tdiff1 < 0)
b->tin_time_next_packet += tdiff2;
else if(tdiff1 < tdiff2)
b->tin_time_next_packet = now + tdiff2;
}
q->time_next_packet += (len * (u64)q->rate_ns) >> q->rate_shft;

if(q->overflow_timeout)

0 comments on commit 9c3da02

Please sign in to comment.
You can’t perform that action at this time.