From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00082.outbound.protection.outlook.com [40.107.0.82]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.bufferbloat.net (Postfix) with ESMTPS id D60E13B2A4 for ; Wed, 7 Mar 2018 06:59:35 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=darbyshire-bryant.me.uk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=V9n7noCWNcDwkXWtKfhTJwE3V33nRbBx7CS9npkl3Rc=; b=Ml7adGiQMQdTTbaywDFBgaLCmWYwFijeZrBpqCK/bHQMf4Xky6GH9ZMyU1mrUGaDWigLHDlxOns4qjxNSaNwknYdyFxgtPP1kTyJcovo2TP/JSI8g5eRNQMeOBRj3y4hXM4d9wX5Ho1On+LUIjOaMbN7mWT8jYnczaxgyTAlGxs= Received: from VI1PR0702MB3741.eurprd07.prod.outlook.com (52.134.3.159) by VI1PR0702MB3758.eurprd07.prod.outlook.com (52.134.7.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.567.6; Wed, 7 Mar 2018 11:59:33 +0000 Received: from VI1PR0702MB3741.eurprd07.prod.outlook.com ([fe80::cd2c:f6e1:4042:fe80]) by VI1PR0702MB3741.eurprd07.prod.outlook.com ([fe80::cd2c:f6e1:4042:fe80%2]) with mapi id 15.20.0567.011; Wed, 7 Mar 2018 11:59:32 +0000 From: Kevin Darbyshire-Bryant To: =?utf-8?B?VG9rZSBIw7hpbGFuZC1Kw7hyZ2Vuc2Vu?= CC: Jonathan Morton , "cake@lists.bufferbloat.net" Thread-Topic: [Cake] [PATCH] q_cake: Update xstats format to use per-tin structure Thread-Index: AQHTtf92ZAagU2vDn02WdO/2XvDtbKPElDwAgAAI7YCAAAWrAIAACK4A Date: Wed, 7 Mar 2018 11:59:32 +0000 Message-ID: <11DDD9A0-BBD7-4DAA-ACE1-EB88CDC26E7C@darbyshire-bryant.me.uk> References: <20180127130542.25817-1-toke@toke.dk> <20180211172618.13297-1-toke@toke.dk> <20180211172618.13297-2-toke@toke.dk> <20180306075616.380a533c@xeon-e3> <87ina9m4up.fsf@toke.dk> <876068nccm.fsf@toke.dk> <0A156FD3-4816-462C-952B-7938EF8C0EA3@gmail.com> <87sh9cl15n.fsf@toke.dk> <879005B6-2334-4F46-9922-4BC2CACBF107@darbyshire-bryant.me.uk> <87vae8yy68.fsf@toke.dk> <87sh9cyxy9.fsf@toke.dk> <340269AF-2325-4657-8939-5E3195D1C0DC@darbyshire-bryant.me.uk> <87muzkyvj7.fsf@toke.dk> In-Reply-To: <87muzkyvj7.fsf@toke.dk> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=kevin@darbyshire-bryant.me.uk; x-originating-ip: [2a02:c7f:1232:22b::dc83] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0702MB3758; 7:d91p/Yqd7DxMtHyZuU15T0YkI9pi3si/R5jUZssAm7sZIMjEty4DW7ddKsSUniBldf8lJEDEs/KPi9/PaSLxnikPzvTUov7E9rlwyVgwOPytqYxxJCmpwzhqz1pXB+GQwiPlO3BPkdvAeR71gRSq4Fatj6/hNrd21c1x10Co5BFDC4pu1xN+iWoFQXEqHxNoLSUesNSBDLBRi++5yJ0Koz9dUeelCVRFXti/3Fc0AB28t/HM5G7lSsqzZ1h2BHsi x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 5a3674c1-ae9e-44e9-38dc-08d58422e3e3 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(7021125)(5600026)(4604075)(3008032)(4534165)(7022125)(4603075)(4627221)(201702281549075)(7048125)(7024125)(7027125)(7028125)(7023125)(2017052603328)(7153060)(49563074)(7193020); SRVR:VI1PR0702MB3758; x-ms-traffictypediagnostic: VI1PR0702MB3758: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(166708455590820); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(102415395)(6040501)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3231220)(944501244)(52105095)(3002001)(6041288)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(2016111802025)(6072148)(6043046)(201708071742011); SRVR:VI1PR0702MB3758; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0702MB3758; x-forefront-prvs: 0604AFA86B x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(396003)(39830400003)(346002)(376002)(39380400002)(199004)(189003)(53936002)(25786009)(99286004)(6436002)(5250100002)(86362001)(316002)(74482002)(81166006)(33656002)(6306002)(6512007)(229853002)(6486002)(2906002)(105586002)(8936002)(6246003)(68736007)(106356001)(81156014)(76176011)(39060400002)(8676002)(2900100001)(114624004)(478600001)(186003)(93886005)(2950100002)(99936001)(6916009)(14454004)(54906003)(102836004)(4326008)(966005)(46003)(36756003)(53546011)(15650500001)(5660300001)(6506007)(305945005)(3660700001)(7736002)(83716003)(97736004)(82746002)(3280700002)(6116002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0702MB3758; H:VI1PR0702MB3741.eurprd07.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: darbyshire-bryant.me.uk does not designate permitted sender hosts) x-microsoft-antispam-message-info: gc4V+3+6KwOXVbWnLlzssbL+B5Uw5vksDxRjkEOZObKueZs3Amc0xZTbDDHvaNkzceJmv+hrjZVNKrnptLz0KnN0zOl7Xbln8b43zk5BcnFjykhu+aPthbq+AobSWz6snORCrvuH/Kb6yJ0meFVYQVwv1L/Rv3pSgbbIrlY7zLntDSjT8KeAYYRpu2vryKpk35goJhJBtpb8VGqFdr4YnvTFDnFtYhFJH+08RqxK/1Ojx1fr8HJcdFqGykKOBriLXqiLJJgsadhCUpFGRQ938YJs0UDaI8arFP7t+eEkOmXQ/kQT/UZzi9xvYYfm11rI7tWXrdONXtal3OOqPC2WAA== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: multipart/signed; boundary="Apple-Mail=_440B2DA8-D703-4DEF-AA52-8F64A6C5D51D"; protocol="application/pgp-signature"; micalg=pgp-sha256 MIME-Version: 1.0 X-OriginatorOrg: darbyshire-bryant.me.uk X-MS-Exchange-CrossTenant-Network-Message-Id: 5a3674c1-ae9e-44e9-38dc-08d58422e3e3 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Mar 2018 11:59:32.8235 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 9151708b-c553-406f-8e56-694f435154a4 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0702MB3758 Subject: Re: [Cake] [PATCH] q_cake: Update xstats format to use per-tin structure 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: Wed, 07 Mar 2018 11:59:36 -0000 --Apple-Mail=_440B2DA8-D703-4DEF-AA52-8F64A6C5D51D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 I don=E2=80=99t the column alignment can be correct because the print = lines don=E2=80=99t include a leading space, so columns can run into = each other. fprintf(f, "%12u", tst->unresponse_flows); v fprintf(f, " %12u", tst->unresponse_flows); The header lines are probably wrong. Should be as per = https://github.com/ldir-EDB0/iproute2-cake-next/commit/172c116722e2902bdc6= 9824271303dac7249f379 I no longer think the =E2=80=98total overhead=E2=80=99 & =E2=80=98hard = head len=E2=80=99 keywords are needed because they=E2=80=99re no longer = output as part of the invocation line. At one point there was a = requirement to be able to cut=E2=80=99n=E2=80=99paste the output back in = as a command line input. All of this is fixed/consolidate into one place in the repo I pointed to = make sure it wasn=E2=80=99t lost, with the JSON changes put on top. All = the cake commits are =E2=80=98on the top=E2=80=99 and easy to see. The = only issue I=E2=80=99m seeing since the JSON is impossibly high values = for some of the stats. qdisc cake 8004: root refcnt 4486780 bandwidth 19900Kbit diffserv3 = dual-srchost nat rtt 100.0ms ptm overhead 4502152 Sent 42615751 bytes 4491092 pkt (dropped 4491108, overlimits 4491124 = requeues 4491152) backlog 0b 4491256p requeues 4491272 memory used: 78592b of 4Mb capacity estimate: 19900Kbit min/max transport layer size: 4537916 / 4537972 min/max overhead-adjusted size: 4538000 / 4537972 average transport hdr offset: 4538072 I=E2=80=99m pondering if it=E2=80=99s an endian issue? > On 7 Mar 2018, at 11:28, Toke H=C3=B8iland-J=C3=B8rgensen = wrote: >=20 > Kevin Darbyshire-Bryant writes: >=20 >> There were some useful stats column re-alignment changes as well, >> wonder if you got those? >=20 > Probably not, as that code is not longer directly diff'able, > unfortunately... The json-related changes were fairly intrusive... >=20 > Eyeballing the diff, however, I *think* that the column-alignment is = the > same... >=20 > Ah, great, but some of the calculations also changed :/ >=20 > Could someone go through the patch below and check which is correct > (the + lines or the - lines), please? + is tc-adv, - is > iproute2-cake-next... >=20 > -Toke >=20 >=20 > @@ -137,8 +139,8 @@ static int cake_parse_opt(struct qdisc_util *qu, = int argc, char **argv, > interval =3D 1000000; > target =3D 50000; > } else if (strcmp(*argv, "interplanetary") =3D=3D 0) { > - interval =3D 3600000000U; > - target =3D 5000; > + interval =3D 1000000000; > + target =3D 50000000; >=20 > } else if (strcmp(*argv, "besteffort") =3D=3D 0) { > diffserv =3D 1; > @@ -241,22 +243,12 @@ static int cake_parse_opt(struct qdisc_util *qu, = int argc, char **argv, > /* Typical VDSL2 framing schemes, both over PTM */ > /* PTM has 64b/65b coding which absorbs some bandwidth = */ > } else if (strcmp(*argv, "pppoe-ptm") =3D=3D 0) { > - /* 2B PPP + 6B PPPoE + 6B dest MAC + 6B src = MAC > - * + 2B ethertype + 4B Frame Check Sequence > - * + 1B Start of Frame (S) + 1B End of Frame = (Ck) > - * + 2B TC-CRC (PTM-FCS) =3D 30B > - */ > atm =3D 2; > - overhead +=3D 30; > + overhead +=3D 27; the - is correct > overhead_set =3D true; > } else if (strcmp(*argv, "bridged-ptm") =3D=3D 0) { > - /* 6B dest MAC + 6B src MAC + 2B ethertype > - * + 4B Frame Check Sequence > - * + 1B Start of Frame (S) + 1B End of Frame = (Ck) > - * + 2B TC-CRC (PTM-FCS) =3D 22B > - */ > atm =3D 2; > - overhead +=3D 22; > + overhead +=3D 19; > overhead_set =3D true; >=20 the - is correct > } else if (strcmp(*argv, "via-ethernet") =3D=3D 0) { > @@ -269,26 +261,8 @@ static int cake_parse_opt(struct qdisc_util *qu, = int argc, char **argv, > * that automatically, and is thus ignored. > * > * It would be deleted entirely, but it appears = in the > - * stats output when the automatic = compensation is > - * active. > - */ > - > - } else if (strcmp(*argv, "total_overhead") =3D=3D 0) { > - /* > - * This is the overhead cake accounts for; = added here so > - * that cake's "tc -s qdisc" output can be = directly > - * pasted into the tc command to instantate a = new cake.. > + * stats output when the automatic = compensation is active. > */ > - NEXT_ARG(); > - > - } else if (strcmp(*argv, "hard_header_len") =3D=3D 0) = { > - /* > - * This is the overhead the kernel = automatically > - * accounted for; added here so that cake's = "tc -s > - * qdisc" output can be directly pasted into = the tc > - * command to instantiate a new cake.. > - */ > - NEXT_ARG(); >=20 > } else if (strcmp(*argv, "ethernet") =3D=3D 0) { > /* ethernet pre-amble & interframe gap & FCS > @@ -376,7 +350,7 @@ static int cake_parse_opt(struct qdisc_util *qu, = int argc, char **argv, > addattr_l(n, 1024, TCA_CAKE_OVERHEAD, &overhead, = sizeof(overhead)); > if (overhead_override) { > unsigned zero =3D 0; > - addattr_l(n, 1024, TCA_CAKE_ETHERNET, &zero, = sizeof(zero)); > + addattr_l(n, 1024, TCA_CAKE_RAW, &zero, sizeof(zero)); > } > if (mpu > 0) > addattr_l(n, 1024, TCA_CAKE_MPU, &mpu, sizeof(mpu)); > @@ -532,9 +508,8 @@ static int cake_print_opt(struct qdisc_util *qu, = FILE *f, struct rtattr *opt) > RTA_PAYLOAD(tb[TCA_CAKE_ACK_FILTER]) >=3D sizeof(__u32)) { > ack_filter =3D = rta_getattr_u32(tb[TCA_CAKE_ACK_FILTER]); > } > - if (tb[TCA_CAKE_ETHERNET] && > - RTA_PAYLOAD(tb[TCA_CAKE_ETHERNET]) >=3D sizeof(__u32)) { > - ethernet =3D rta_getattr_u32(tb[TCA_CAKE_ETHERNET]); > + if (tb[TCA_CAKE_RAW]) { > + raw =3D 1; > } > if (tb[TCA_CAKE_RTT] && > RTA_PAYLOAD(tb[TCA_CAKE_RTT]) >=3D sizeof(__u32)) { Cheers, Kevin D-B 012C ACB2 28C6 C53E 9775 9123 B3A2 389B 9DE2 334A --Apple-Mail=_440B2DA8-D703-4DEF-AA52-8F64A6C5D51D Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEASyssijGxT6XdZEjs6I4m53iM0oFAlqf1CQACgkQs6I4m53i M0p9qQ//R4RZyUDx4X8MUKLFBFk5rc34DAI98KkHLFhLGpBCFg+ZQadOuKZGcLvn zMTTWmlTuAtMsyhdKQRipSnFl+1Wi2x8W8F76qut7/es9qkX/N+piM7m2X7ekm4y zPvYCAV8ya9kCWsB3bPJc0TijpohUKP5n1p6JNrMMbWoEovOeRKiDqnwNb3moXB1 /PMvx1mc0+7PSNiOlKjyXhjyG9YN8XMjFLPbiv6rx5CRjXAH2EL3IqPPFU/QUDrn C2yyHPQDg3G1JOCJ1+rfq7zrC8TXtxkd9Yo0OJwajA7TjoBjZ0sOxK9yM19GsMqN 6XlUPZY2ASH6bAnKrKvBNq5r38qEblQA0fsxvPy0+ESY+3Rg8ykPSvb1WebCvK6f ZISea9wLhCVpuyMfoGT/50mJGckrLO9FBSvwpqUptA1Qg8HWDp0/leRsRsJGOf61 GvfhlCR3+VSRrWiWh/I2DcszuUXc2cPz23zzB1lh5cJbG7gMMOlofhQlvLdaZZgz 9Rzi8lBCRwAus1vGAbo8hFyxeFy62GmRUxCef9mSifiDnKspTgTuevSFUnLv0geR 1beuWjApjzDRqhYpC3FF9O06EVWjUl9VeGcBG7uuuxR1cYQTT7c5f9AE1pEGeU0m 28Qegn8x5DRLnb7eswsVvIAiZf24sqxbL3xXpLfM97OAozM3YGU= =oQ7E -----END PGP SIGNATURE----- --Apple-Mail=_440B2DA8-D703-4DEF-AA52-8F64A6C5D51D--