From: Pete Heist <peteheist@gmail.com>
To: Dave Taht <dave.taht@gmail.com>
Cc: Cake List <cake@lists.bufferbloat.net>
Subject: Re: [Cake] dealing with multibit DUAL whatevers
Date: Mon, 27 Nov 2017 12:16:13 +0100 [thread overview]
Message-ID: <E6C0331D-80D4-4EB4-86CF-E881C7772B03@gmail.com> (raw)
In-Reply-To: <CAA93jw5AP0UfZvDzpoN+6RLSNX-1AVgQOMivYSG-HP8nEmVfgw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 4900 bytes --]
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...
http://www.drhleny.cz/bufferbloat/cake/round1/hostiso_eg_cake_src_cake_dst_900mbit/index.html <http://www.drhleny.cz/bufferbloat/cake/round1/hostiso_eg_cake_src_cake_dst_900mbit/index.html>
http://www.drhleny.cz/bufferbloat/cake/round1/hostiso_eg_cake_dsrc_cake_ddst_900mbit/index.html <http://www.drhleny.cz/bufferbloat/cake/round1/hostiso_eg_cake_dsrc_cake_ddst_900mbit/index.html>
> On Nov 26, 2017, at 8:42 PM, Dave Taht <dave.taht@gmail.com> wrote:
>
> I just committed this
>
> diff --git a/sch_cake.c b/sch_cake.c
> index 14b32e0..606ec29 100644
> --- a/sch_cake.c
> +++ b/sch_cake.c
> @@ -654,6 +654,20 @@ static inline void cake_update_flowkeys(struct
> flow_keys *keys,
> }
> #endif
>
> +/* Cake has several subtle multiple bit settings. In these cases you
> + * would be matching triple isolate mode as well.
> + */
> +
> +static inline bool cake_dsrc(int flow_mode)
> +{
> + return (flow_mode & CAKE_FLOW_DUAL_SRC) == CAKE_FLOW_DUAL_SRC;
> +}
> +
> +static inline bool cake_ddst(int flow_mode)
> +{
> + return (flow_mode & CAKE_FLOW_DUAL_DST) == CAKE_FLOW_DUAL_DST;
> +}
> +
> static inline u32
> cake_hash(struct cake_tin_data *q, const struct sk_buff *skb, int flow_mode)
> {
> @@ -772,8 +786,8 @@ cake_hash(struct cake_tin_data *q, const struct
> sk_buff *skb, int flow_mode)
>
> if (!q->flows[outer_hash + k].set) {
> /* need to increment host refcnts */
> - allocate_src = ((flow_mode & CAKE_FLOW_DUAL_SRC)
> == CAKE_FLOW_DUAL_SRC);
> - allocate_dst = ((flow_mode & CAKE_FLOW_DUAL_DST)
> == CAKE_FLOW_DUAL_DST);
> + allocate_src = cake_dsrc(flow_mode);
> + allocate_dst = cake_ddst(flow_mode);
> }
>
> goto found;
> @@ -787,8 +801,8 @@ cake_hash(struct cake_tin_data *q, const struct
> sk_buff *skb, int flow_mode)
> i++, k = (k + 1) % CAKE_SET_WAYS) {
> if (!q->flows[outer_hash + k].set) {
> q->way_misses++;
> - allocate_src = ((flow_mode & CAKE_FLOW_DUAL_SRC) ==
> CAKE_FLOW_DUAL_SRC);
> - allocate_dst = ((flow_mode & CAKE_FLOW_DUAL_DST) ==
> CAKE_FLOW_DUAL_DST);
> + allocate_src = cake_dsrc(flow_mode);
> + allocate_dst = cake_ddst(flow_mode);
> goto found;
> }
> }
> @@ -799,9 +813,8 @@ cake_hash(struct cake_tin_data *q, const struct
> sk_buff *skb, int flow_mode)
> q->way_collisions++;
> q->hosts[q->flows[reduced_hash].srchost].srchost_refcnt--;
> q->hosts[q->flows[reduced_hash].dsthost].dsthost_refcnt--;
> - allocate_src = ((flow_mode & CAKE_FLOW_DUAL_SRC) ==
> CAKE_FLOW_DUAL_SRC);
> - allocate_dst = ((flow_mode & CAKE_FLOW_DUAL_DST) ==
> CAKE_FLOW_DUAL_DST);
> -
> + allocate_src = cake_dsrc(flow_mode);
> + allocate_dst = cake_ddst(flow_mode);
> found:
> /* reserve queue for future packets in same flow */
> reduced_hash = outer_hash + k;
> @@ -1595,10 +1608,10 @@ static s32 cake_enqueue(struct sk_buff *skb,
> struct Qdisc *sch,
> flow->set = CAKE_SET_SPARSE;
> b->sparse_flow_count++;
>
> - if ((q->flow_mode & CAKE_FLOW_DUAL_SRC) == CAKE_FLOW_DUAL_SRC)
> + if (cake_dsrc(q->flow_mode))
> host_load = max(host_load, srchost->srchost_refcnt);
>
> - if ((q->flow_mode & CAKE_FLOW_DUAL_DST) == CAKE_FLOW_DUAL_DST)
> + if (cake_ddst(q->flow_mode))
> host_load = max(host_load, dsthost->dsthost_refcnt);
>
> flow->deficit = (b->flow_quantum * quantum_div[host_load]) >> 16;
> @@ -1762,10 +1775,10 @@ retry:
> dsthost = &b->hosts[flow->dsthost];
> host_load = 1;
>
> - if ((q->flow_mode & CAKE_FLOW_DUAL_SRC) == CAKE_FLOW_DUAL_SRC)
> + if (cake_dsrc(q->flow_mode))
> host_load = max(host_load, srchost->srchost_refcnt);
>
> - if ((q->flow_mode & CAKE_FLOW_DUAL_DST) == CAKE_FLOW_DUAL_DST)
> + if (cake_ddst(q->flow_mode))
> host_load = max(host_load, dsthost->dsthost_refcnt);
>
> WARN_ON(host_load > CAKE_QUEUES);
>
>
> --
>
> Dave Täht
> CEO, TekLibre, LLC
> http://www.teklibre.com
> Tel: 1-669-226-2619
> _______________________________________________
> Cake mailing list
> Cake@lists.bufferbloat.net
> https://lists.bufferbloat.net/listinfo/cake
[-- Attachment #2: Type: text/html, Size: 9069 bytes --]
prev parent reply other threads:[~2017-11-27 11:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-26 19:42 Dave Taht
2017-11-27 11:16 ` Pete Heist [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://lists.bufferbloat.net/postorius/lists/cake.lists.bufferbloat.net/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E6C0331D-80D4-4EB4-86CF-E881C7772B03@gmail.com \
--to=peteheist@gmail.com \
--cc=cake@lists.bufferbloat.net \
--cc=dave.taht@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox