[Cake] cake_heap* could use some comments

Dave Taht dave.taht at gmail.com
Fri Dec 1 23:36:36 EST 2017

1) Cake_heap* functions could use a set of explanatory comments.

In cake_heapify especially:

1a) m, mb, l are really not self explanatory. "major". "major byte". "lost"?
r is right? l is left? a is CAKE_MAX_HEAP.

2) What's the operating principle of the overflow_timeout?

3) Why the divide by 2 here:

static unsigned int cake_drop(struct Qdisc *sch, struct sk_buff **to_free)
struct cake_sched_data *q = qdisc_priv(sch);
struct sk_buff *skb;
u32 idx = 0, tin = 0, len;
struct cake_tin_data *b;
struct cake_flow *flow;
struct cake_heap_entry qq;
u64 now = cobalt_get_time();

if (!q->overflow_timeout) {
int i;
/* Build fresh max-heap */
for (i = CAKE_MAX_TINS * CAKE_QUEUES / 2; i >= 0; i--)
cake_heapify(q, i);


Dave Täht
CEO, TekLibre, LLC
Tel: 1-669-226-2619

More information about the Cake mailing list