From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-x22a.google.com (mail-wr0-x22a.google.com [IPv6:2a00:1450:400c:c0c::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.bufferbloat.net (Postfix) with ESMTPS id A5BB13BA8E for ; Mon, 27 Nov 2017 06:16:16 -0500 (EST) Received: by mail-wr0-x22a.google.com with SMTP id k61so26004704wrc.4 for ; Mon, 27 Nov 2017 03:16:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc:message-id:references :to; bh=BLPnpn1+lJwce3Ko0t1yO8FMFEMRjDXcigPWza5dIDk=; b=FTSU/J9H6zkSwikOC1PV4HCq0Wj8nNcSI4ez9BnpxqLt98827gzGqYTfxMJGQopc/a 0JcCCsT0ao+oCfbgEc+ivOMjT+E6MzSKO2h2wnb0l9rKyAczltlpjFYLTD7P2n4Kuyki NjGmSooFHCnRhcDDKLjmGYvTqc0kA9ZYIC/BPD5jbe1uexsgiVIxoOnpApensUt2ZJQ5 q2kaYKKShtT6tAWoXvFN7g7ZtMEWTpYAXMcdnrfB9dK5yQ35aAe9DdVTzzyESYzRfndN jMn9rGwtgLeanORcjVPxASsSWB8vB9marQuOzLahXuEU4GZHJ2bGhloRdWSlOzz+knpw S0Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=BLPnpn1+lJwce3Ko0t1yO8FMFEMRjDXcigPWza5dIDk=; b=H7lhXXqcgTsoXKytcraO0XGSed5Wi4OhyzciXJb7HV58xE2wO1MI+HxtJzdsxqFpuU 4DVkg4mR+lQVIT2QvWnywdf1lS0zGO45Yws10lxhVXbQQD11DjSElTh/3x9aIUb9UuJJ ZsB0Ba/JZZ82Gf2BTwk2hAanElzQ+O9QyPfS4zeDMyLsYO4ylCeII69Q2qxBeMshtGDV VFlg9V99YERzGHmkpdNm33v5vpn7Q/ytbnaVE8/9oSqmZbZj3C5hwWZZc7YJFFrJSVZI LluTu5E9djx2DH6Fym5pwGySTdWf7gfBGkaVtPVPY1h2PHqb4eaY1+lVhwUjEQMCJHCQ pyBw== X-Gm-Message-State: AJaThX7QIF8KZAk0FsKK3TtGhfFgYgJfQh86KgUiRdsX0rSCnyko2nzR nmwoif0d7wUQA/epOshKBAw= X-Google-Smtp-Source: AGs4zMYbI54eOEW3SyzFRLyHnTRs56Gw+BLuKnashJtxfT8+Ui7LY1fJ3pliZR7PnITHjnmuXLcblQ== X-Received: by 10.223.160.40 with SMTP id k37mr22512951wrk.66.1511781375327; Mon, 27 Nov 2017 03:16:15 -0800 (PST) Received: from [10.72.0.130] (h-1169.lbcfree.net. [185.99.119.68]) by smtp.gmail.com with ESMTPSA id e132sm5163236wmd.40.2017.11.27.03.16.14 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 27 Nov 2017 03:16:14 -0800 (PST) Content-Type: multipart/alternative; boundary="Apple-Mail=_CA452D98-C74F-494D-9567-67BAFE786DC0" Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) From: Pete Heist In-Reply-To: Date: Mon, 27 Nov 2017 12:16:13 +0100 Cc: Cake List Message-Id: References: To: Dave Taht X-Mailer: Apple Mail (2.3124) Subject: Re: [Cake] dealing with multibit DUAL whatevers X-BeenThere: cake@lists.bufferbloat.net X-Mailman-Version: 2.1.20 Precedence: list List-Id: Cake - FQ_codel the next generation List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Nov 2017 11:16:17 -0000 --Apple-Mail=_CA452D98-C74F-494D-9567-67BAFE786DC0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 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=E2=80=99s not a bug = here and it=E2=80=99s 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_dsrc_cake_dd= st_900mbit/index.html = > On Nov 26, 2017, at 8:42 PM, Dave Taht wrote: >=20 > I just committed this >=20 > 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 >=20 > +/* 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) =3D=3D = CAKE_FLOW_DUAL_SRC; > +} > + > +static inline bool cake_ddst(int flow_mode) > +{ > + return (flow_mode & CAKE_FLOW_DUAL_DST) =3D=3D = 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) >=20 > if (!q->flows[outer_hash + k].set) { > /* need to increment host refcnts */ > - allocate_src =3D ((flow_mode & = CAKE_FLOW_DUAL_SRC) > =3D=3D CAKE_FLOW_DUAL_SRC); > - allocate_dst =3D ((flow_mode & = CAKE_FLOW_DUAL_DST) > =3D=3D CAKE_FLOW_DUAL_DST); > + allocate_src =3D cake_dsrc(flow_mode); > + allocate_dst =3D cake_ddst(flow_mode); > } >=20 > goto found; > @@ -787,8 +801,8 @@ cake_hash(struct cake_tin_data *q, const struct > sk_buff *skb, int flow_mode) > i++, k =3D (k + 1) % CAKE_SET_WAYS) { > if (!q->flows[outer_hash + k].set) { > q->way_misses++; > - allocate_src =3D ((flow_mode & CAKE_FLOW_DUAL_SRC) =3D=3D= > CAKE_FLOW_DUAL_SRC); > - allocate_dst =3D ((flow_mode & CAKE_FLOW_DUAL_DST) =3D=3D= > CAKE_FLOW_DUAL_DST); > + allocate_src =3D cake_dsrc(flow_mode); > + allocate_dst =3D 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 =3D ((flow_mode & CAKE_FLOW_DUAL_SRC) =3D=3D > CAKE_FLOW_DUAL_SRC); > - allocate_dst =3D ((flow_mode & CAKE_FLOW_DUAL_DST) =3D=3D > CAKE_FLOW_DUAL_DST); > - > + allocate_src =3D cake_dsrc(flow_mode); > + allocate_dst =3D cake_ddst(flow_mode); > found: > /* reserve queue for future packets in same flow */ > reduced_hash =3D outer_hash + k; > @@ -1595,10 +1608,10 @@ static s32 cake_enqueue(struct sk_buff *skb, > struct Qdisc *sch, > flow->set =3D CAKE_SET_SPARSE; > b->sparse_flow_count++; >=20 > - if ((q->flow_mode & CAKE_FLOW_DUAL_SRC) =3D=3D = CAKE_FLOW_DUAL_SRC) > + if (cake_dsrc(q->flow_mode)) > host_load =3D max(host_load, srchost->srchost_refcnt); >=20 > - if ((q->flow_mode & CAKE_FLOW_DUAL_DST) =3D=3D = CAKE_FLOW_DUAL_DST) > + if (cake_ddst(q->flow_mode)) > host_load =3D max(host_load, dsthost->dsthost_refcnt); >=20 > flow->deficit =3D (b->flow_quantum * quantum_div[host_load]) = >> 16; > @@ -1762,10 +1775,10 @@ retry: > dsthost =3D &b->hosts[flow->dsthost]; > host_load =3D 1; >=20 > - if ((q->flow_mode & CAKE_FLOW_DUAL_SRC) =3D=3D = CAKE_FLOW_DUAL_SRC) > + if (cake_dsrc(q->flow_mode)) > host_load =3D max(host_load, srchost->srchost_refcnt); >=20 > - if ((q->flow_mode & CAKE_FLOW_DUAL_DST) =3D=3D = CAKE_FLOW_DUAL_DST) > + if (cake_ddst(q->flow_mode)) > host_load =3D max(host_load, dsthost->dsthost_refcnt); >=20 > WARN_ON(host_load > CAKE_QUEUES); >=20 >=20 > --=20 >=20 > Dave T=C3=A4ht > 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 --Apple-Mail=_CA452D98-C74F-494D-9567-67BAFE786DC0 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
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=E2=80=99s not a bug here and it=E2=80=99s = explained by some other technicality...


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) =3D=3D CAKE_FLOW_DUAL_SRC;
+}
+
+static inline bool = cake_ddst(int flow_mode)
+{
+ =    return (flow_mode & CAKE_FLOW_DUAL_DST) =3D=3D = 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)

=             &n= bsp;   if (!q->flows[outer_hash + k].set) {
=             &n= bsp;       /* need to increment host = refcnts */
- =             &n= bsp;      allocate_src =3D ((flow_mode = & CAKE_FLOW_DUAL_SRC)
=3D=3D CAKE_FLOW_DUAL_SRC);
- =             &n= bsp;      allocate_dst =3D ((flow_mode = & CAKE_FLOW_DUAL_DST)
=3D=3D CAKE_FLOW_DUAL_DST);
+ =             &n= bsp;      allocate_src =3D = cake_dsrc(flow_mode);
+ =             &n= bsp;      allocate_dst =3D = cake_ddst(flow_mode);
=             &n= bsp;   }

=             &n= bsp;   goto found;
@@ -787,8 +801,8 @@ = cake_hash(struct cake_tin_data *q, const struct
sk_buff = *skb, int flow_mode)
=             &n= bsp;i++, k =3D (k + 1) % CAKE_SET_WAYS) {
=             if= (!q->flows[outer_hash + k].set) {
=             &n= bsp;   q->way_misses++;
- =             &n= bsp;  allocate_src =3D ((flow_mode & CAKE_FLOW_DUAL_SRC) = =3D=3D
CAKE_FLOW_DUAL_SRC);
- =             &n= bsp;  allocate_dst =3D ((flow_mode & CAKE_FLOW_DUAL_DST) = =3D=3D
CAKE_FLOW_DUAL_DST);
+ =             &n= bsp;  allocate_src =3D cake_dsrc(flow_mode);
+ =             &n= bsp;  allocate_dst =3D cake_ddst(flow_mode);
=             &n= bsp;   goto found;
=             }<= br class=3D"">         }
@@ -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[re= duced_hash].srchost].srchost_refcnt--;
=         q->hosts[q->flows[re= duced_hash].dsthost].dsthost_refcnt--;
- =        allocate_src =3D ((flow_mode = & CAKE_FLOW_DUAL_SRC) =3D=3D
CAKE_FLOW_DUAL_SRC);
-        allocate_dst =3D = ((flow_mode & CAKE_FLOW_DUAL_DST) =3D=3D
CAKE_FLOW_DUAL_DST);
-
+ =        allocate_src =3D = cake_dsrc(flow_mode);
+ =        allocate_dst =3D = cake_ddst(flow_mode);
found:
=         /* reserve queue for = future packets in same flow */
=         reduced_hash =3D = outer_hash + k;
@@ -1595,10 +1608,10 @@ static s32 = cake_enqueue(struct sk_buff *skb,
struct Qdisc *sch,
        flow->set = =3D CAKE_SET_SPARSE;
=         b->sparse_flow_count++;=

- =        if ((q->flow_mode & = CAKE_FLOW_DUAL_SRC) =3D=3D CAKE_FLOW_DUAL_SRC)
+ =        if = (cake_dsrc(q->flow_mode))
=             ho= st_load =3D max(host_load, srchost->srchost_refcnt);

-        if = ((q->flow_mode & CAKE_FLOW_DUAL_DST) =3D=3D = CAKE_FLOW_DUAL_DST)
+ =        if = (cake_ddst(q->flow_mode))
=             ho= st_load =3D max(host_load, dsthost->dsthost_refcnt);

=         flow->deficit =3D = (b->flow_quantum * quantum_div[host_load]) >> 16;
@@ -1762,10 +1775,10 @@ retry:
=     dsthost =3D = &b->hosts[flow->dsthost];
=     host_load =3D 1;

- =    if ((q->flow_mode & CAKE_FLOW_DUAL_SRC) =3D=3D = CAKE_FLOW_DUAL_SRC)
+    if = (cake_dsrc(q->flow_mode))
=         host_load =3D = max(host_load, srchost->srchost_refcnt);

-=    if ((q->flow_mode & CAKE_FLOW_DUAL_DST) =3D=3D = CAKE_FLOW_DUAL_DST)
+    if = (cake_ddst(q->flow_mode))
=         host_load =3D = max(host_load, dsthost->dsthost_refcnt);

=     WARN_ON(host_load > CAKE_QUEUES);


--

Dave T=C3=A4ht
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

= --Apple-Mail=_CA452D98-C74F-494D-9567-67BAFE786DC0--