Skip to content
Permalink
Browse files

Restore the tyranny of the minority.

  • Loading branch information...
chromi committed Jan 16, 2016
1 parent b1db937 commit 2add740a79bb50b04e0497400a501df7b1857f48
Showing with 6 additions and 12 deletions.
  1. +6 −12 sch_cake.c
@@ -781,7 +781,7 @@ static struct sk_buff *cake_dequeue(struct Qdisc *sch)
struct cake_flow *flow;
struct list_head *head;
u16 prev_drop_count, prev_ecn_mark;
u16 deferred_hosts, deferred_dst, deferred_src;
u16 deferred_hosts;
u32 len;
codel_time_t now = ktime_get_ns();
s32 i;
@@ -817,7 +817,7 @@ static struct sk_buff *cake_dequeue(struct Qdisc *sch)
}
}

deferred_hosts = deferred_src = deferred_dst = 0;
deferred_hosts = 0;

retry:
/* service this class */
@@ -847,23 +847,17 @@ static struct sk_buff *cake_dequeue(struct Qdisc *sch)
list_move_tail(&flow->flowchain, head);
deferred_hosts++;

if(src_blocked)
deferred_src++;

if(dst_blocked)
deferred_dst++;

if(deferred_hosts >= b->sparse_flow_count + b->bulk_flow_count) {
/* looks like all hosts are exhausted; refresh them */
u32 j;

for(j=0; j < b->flows_cnt; j++) {
if(deferred_src >= deferred_dst && b->hosts[j].srchost_deficit < 0)
if(b->hosts[j].srchost_deficit < 0)
b->hosts[j].srchost_deficit += b->host_quantum;
if(deferred_dst >= deferred_src && b->hosts[j].dsthost_deficit < 0)
if(b->hosts[j].dsthost_deficit < 0)
b->hosts[j].dsthost_deficit += b->host_quantum;
}
deferred_hosts = deferred_src = deferred_dst = 0;
deferred_hosts = 0;
}
goto retry;
}
@@ -876,7 +870,7 @@ static struct sk_buff *cake_dequeue(struct Qdisc *sch)
b->sparse_flow_count--;
b->bulk_flow_count++;
}
deferred_hosts = deferred_src = deferred_dst = 0;
deferred_hosts = 0;
goto retry;
}

0 comments on commit 2add740

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