Skip to content

Commit

Permalink
Getting closer - try not to starve the Bulk tin.
Browse files Browse the repository at this point in the history
  • Loading branch information
chromi committed Mar 17, 2017
1 parent 9c3da02 commit 6c341ce
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions sch_cake.c
Expand Up @@ -1277,18 +1277,24 @@ static struct sk_buff *cake_dequeue(struct Qdisc *sch)
b->base_delay = cake_ewma(b->base_delay, delay,
delay < b->base_delay ? 2 : 8);

/* charge packet bandwidth to this tin, and
* to the global shaper.
/* charge packet bandwidth to this tin, lower tins,
* and to the global shaper.
*/
{
if(q->rate_ns) {
s64 tdiff1 = b->tin_time_next_packet - now;
s64 tdiff2 = (len * (u64)b->tin_rate_ns) >> b->tin_rate_shft;
s64 tdiff3 = (len * (u64)q->rate_ns) >> q->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 += tdiff3;
while(q->cur_tin--)
(--b)->tin_time_next_packet += tdiff3;
q->cur_tin = 0;
}
q->time_next_packet += (len * (u64)q->rate_ns) >> q->rate_shft;

if(q->overflow_timeout)
q->overflow_timeout--;
Expand Down

0 comments on commit 6c341ce

Please sign in to comment.