<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">This looks like a cosmetic change only (much easier to read now), but I was grokking this in case there would be something to explain the fairness differences in my dual-whatever tests, where srchost/dsthost is much fairer at a host level than dual-srchost/dual-dsthost (explained in round 1 results). Want to at least make sure there’s not a bug here and it’s explained by some other technicality...</div><div class=""><br class=""></div><div class=""><div class=""><a href="http://www.drhleny.cz/bufferbloat/cake/round1/hostiso_eg_cake_src_cake_dst_900mbit/index.html" class="">http://www.drhleny.cz/bufferbloat/cake/round1/hostiso_eg_cake_src_cake_dst_900mbit/index.html</a></div><div class=""><a href="http://www.drhleny.cz/bufferbloat/cake/round1/hostiso_eg_cake_dsrc_cake_ddst_900mbit/index.html" class="">http://www.drhleny.cz/bufferbloat/cake/round1/hostiso_eg_cake_dsrc_cake_ddst_900mbit/index.html</a></div></div><div class=""><br class=""></div><div><blockquote type="cite" class=""><div class="">On Nov 26, 2017, at 8:42 PM, Dave Taht <<a href="mailto:dave.taht@gmail.com" class="">dave.taht@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">I just committed this<br class=""><br class="">diff --git a/sch_cake.c b/sch_cake.c<br class="">index 14b32e0..606ec29 100644<br class="">--- a/sch_cake.c<br class="">+++ b/sch_cake.c<br class="">@@ -654,6 +654,20 @@ static inline void cake_update_flowkeys(struct<br class="">flow_keys *keys,<br class=""> }<br class=""> #endif<br class=""><br class="">+/* Cake has several subtle multiple bit settings. In these cases you<br class="">+ * would be matching triple isolate mode as well.<br class="">+ */<br class="">+<br class="">+static inline bool cake_dsrc(int flow_mode)<br class="">+{<br class="">+ return (flow_mode & CAKE_FLOW_DUAL_SRC) == CAKE_FLOW_DUAL_SRC;<br class="">+}<br class="">+<br class="">+static inline bool cake_ddst(int flow_mode)<br class="">+{<br class="">+ return (flow_mode & CAKE_FLOW_DUAL_DST) == CAKE_FLOW_DUAL_DST;<br class="">+}<br class="">+<br class=""> static inline u32<br class=""> cake_hash(struct cake_tin_data *q, const struct sk_buff *skb, int flow_mode)<br class=""> {<br class="">@@ -772,8 +786,8 @@ cake_hash(struct cake_tin_data *q, const struct<br class="">sk_buff *skb, int flow_mode)<br class=""><br class=""> if (!q->flows[outer_hash + k].set) {<br class=""> /* need to increment host refcnts */<br class="">- allocate_src = ((flow_mode & CAKE_FLOW_DUAL_SRC)<br class="">== CAKE_FLOW_DUAL_SRC);<br class="">- allocate_dst = ((flow_mode & CAKE_FLOW_DUAL_DST)<br class="">== CAKE_FLOW_DUAL_DST);<br class="">+ allocate_src = cake_dsrc(flow_mode);<br class="">+ allocate_dst = cake_ddst(flow_mode);<br class=""> }<br class=""><br class=""> goto found;<br class="">@@ -787,8 +801,8 @@ cake_hash(struct cake_tin_data *q, const struct<br class="">sk_buff *skb, int flow_mode)<br class=""> i++, k = (k + 1) % CAKE_SET_WAYS) {<br class=""> if (!q->flows[outer_hash + k].set) {<br class=""> q->way_misses++;<br class="">- allocate_src = ((flow_mode & CAKE_FLOW_DUAL_SRC) ==<br class="">CAKE_FLOW_DUAL_SRC);<br class="">- allocate_dst = ((flow_mode & CAKE_FLOW_DUAL_DST) ==<br class="">CAKE_FLOW_DUAL_DST);<br class="">+ allocate_src = cake_dsrc(flow_mode);<br class="">+ allocate_dst = cake_ddst(flow_mode);<br class=""> goto found;<br class=""> }<br class=""> }<br class="">@@ -799,9 +813,8 @@ cake_hash(struct cake_tin_data *q, const struct<br class="">sk_buff *skb, int flow_mode)<br class=""> q->way_collisions++;<br class=""> q->hosts[q->flows[reduced_hash].srchost].srchost_refcnt--;<br class=""> q->hosts[q->flows[reduced_hash].dsthost].dsthost_refcnt--;<br class="">- allocate_src = ((flow_mode & CAKE_FLOW_DUAL_SRC) ==<br class="">CAKE_FLOW_DUAL_SRC);<br class="">- allocate_dst = ((flow_mode & CAKE_FLOW_DUAL_DST) ==<br class="">CAKE_FLOW_DUAL_DST);<br class="">-<br class="">+ allocate_src = cake_dsrc(flow_mode);<br class="">+ allocate_dst = cake_ddst(flow_mode);<br class=""> found:<br class=""> /* reserve queue for future packets in same flow */<br class=""> reduced_hash = outer_hash + k;<br class="">@@ -1595,10 +1608,10 @@ static s32 cake_enqueue(struct sk_buff *skb,<br class="">struct Qdisc *sch,<br class=""> flow->set = CAKE_SET_SPARSE;<br class=""> b->sparse_flow_count++;<br class=""><br class="">- if ((q->flow_mode & CAKE_FLOW_DUAL_SRC) == CAKE_FLOW_DUAL_SRC)<br class="">+ if (cake_dsrc(q->flow_mode))<br class=""> host_load = max(host_load, srchost->srchost_refcnt);<br class=""><br class="">- if ((q->flow_mode & CAKE_FLOW_DUAL_DST) == CAKE_FLOW_DUAL_DST)<br class="">+ if (cake_ddst(q->flow_mode))<br class=""> host_load = max(host_load, dsthost->dsthost_refcnt);<br class=""><br class=""> flow->deficit = (b->flow_quantum * quantum_div[host_load]) >> 16;<br class="">@@ -1762,10 +1775,10 @@ retry:<br class=""> dsthost = &b->hosts[flow->dsthost];<br class=""> host_load = 1;<br class=""><br class="">- if ((q->flow_mode & CAKE_FLOW_DUAL_SRC) == CAKE_FLOW_DUAL_SRC)<br class="">+ if (cake_dsrc(q->flow_mode))<br class=""> host_load = max(host_load, srchost->srchost_refcnt);<br class=""><br class="">- if ((q->flow_mode & CAKE_FLOW_DUAL_DST) == CAKE_FLOW_DUAL_DST)<br class="">+ if (cake_ddst(q->flow_mode))<br class=""> host_load = max(host_load, dsthost->dsthost_refcnt);<br class=""><br class=""> WARN_ON(host_load > CAKE_QUEUES);<br class=""><br class=""><br class="">-- <br class=""><br class="">Dave Täht<br class="">CEO, TekLibre, LLC<br class=""><a href="http://www.teklibre.com" class="">http://www.teklibre.com</a><br class="">Tel: 1-669-226-2619<br class="">_______________________________________________<br class="">Cake mailing list<br class="">Cake@lists.bufferbloat.net<br class="">https://lists.bufferbloat.net/listinfo/cake<br class=""></div></div></blockquote></div><br class=""></body></html>