From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80070.outbound.protection.outlook.com [40.107.8.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.bufferbloat.net (Postfix) with ESMTPS id 02BA83BA8E for ; Mon, 2 Jul 2018 13:50:21 -0400 (EDT) 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:X-MS-Exchange-SenderADCheck; bh=fHR8ETmAQDhDzd8VUnX2o48R02J4N5vylKB113Aycis=; b=XB6qID6Lh/tfHvPELIXvElf8qWuug2tnEjjNrNy9yVOsnVDVoKz5Tm+WZhS2ABaA3eeko+U/ogIfsiNQwIRDEq6rSTiz0sYE+hm9hBMugWJCfwiaSnHsTNNMBhFKX8GnUzf+wz7dp3j6XSwXsqwRY6XoFxkIdL5SKCjTSNE7Wps= Received: from VI1PR07MB4254.eurprd07.prod.outlook.com (20.176.6.147) by VI1PR07MB3472.eurprd07.prod.outlook.com (10.175.244.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.930.11; Mon, 2 Jul 2018 17:50:19 +0000 Received: from VI1PR07MB4254.eurprd07.prod.outlook.com ([fe80::44fe:35ff:4978:fb9d]) by VI1PR07MB4254.eurprd07.prod.outlook.com ([fe80::44fe:35ff:4978:fb9d%2]) with mapi id 15.20.0930.016; Mon, 2 Jul 2018 17:50:18 +0000 From: Kevin Darbyshire-Bryant To: =?utf-8?B?VG9rZSBIw7hpbGFuZC1Kw7hyZ2Vuc2Vu?= CC: Cake List Subject: Re: [Cake] Cake on openwrt - falling behind Thread-Topic: [Cake] Cake on openwrt - falling behind Thread-Index: AQHUEfzAVn4q46L7QUyKsSBc41C9maR8BF0AgAAXDQCAAAy/gIAADiOA Date: Mon, 2 Jul 2018 17:50:18 +0000 Message-ID: References: <6DF9A5E0-EFD5-4519-9889-BC0A7B9BD48E@darbyshire-bryant.me.uk> <1A8BA286-6B31-4581-86C9-6855AC28C245@heistp.net> <673EAD3F-AB09-4B90-88BB-5DCE0BD65534@heistp.net> <6FE8D434-01BE-41A1-BD6B-EFFD67AC8784@heistp.net> <94C9790F-E9BC-4D59-9845-17C305E4B910@darbyshire-bryant.me.uk> <17AF79A0-0213-44E3-95B9-62795A644A47@heistp.net> <87lgatj13k.fsf@toke.dk> <87fu11ipir.fsf@toke.dk> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [90.155.95.206] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR07MB3472; 7:H7uk9UIOiS9CMHk+TJgDNUjOSpQKDOa+LJaDDINq9g6uHcPZnocPdILmqzf9nJV8xYY6Neo6nq4jSuZi9E2DSbtb24EaGh9WlshziVS7V/aLI+I6JPBFQOllLW3rhta+dsnoa1fC8LgfW7OmCyhObM7YmUSLf/GzB8MH8wURi8J2eYiJHihT0Zx8Cmt7HZhmxgU+twmqQdubrVIvilS4DwWBb1IRs6hMRoqqBO8Tj3tavrrwSCLn+woafPtS1sYo x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: a5cd2472-f206-4cab-0a0c-08d5e0444693 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(7021125)(8989117)(5600053)(711020)(4534165)(7022125)(4603075)(4627221)(201702281549075)(8990107)(7048125)(7024125)(7027125)(7028125)(7023125)(2017052603328)(7153060)(49563074)(7193020); SRVR:VI1PR07MB3472; x-ms-traffictypediagnostic: VI1PR07MB3472: authentication-results: spf=none (sender IP is ) smtp.mailfrom=kevin@darbyshire-bryant.me.uk; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(226747003789276)(17755550239193); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(102415395)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231254)(944501410)(52105095)(10201501046)(93006095)(93001095)(149027)(150027)(6041310)(20161123558120)(20161123560045)(20161123562045)(2016111802025)(20161123564045)(6072148)(6043046)(201708071742011)(7699016); SRVR:VI1PR07MB3472; BCL:0; PCL:0; RULEID:; SRVR:VI1PR07MB3472; x-forefront-prvs: 07215D0470 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39830400003)(366004)(396003)(136003)(376002)(346002)(189003)(199004)(316002)(33656002)(4326008)(14454004)(68736007)(93886005)(8936002)(5250100002)(81156014)(81166006)(229853002)(6512007)(8676002)(14444005)(86362001)(2906002)(76176011)(2900100001)(256004)(486006)(25786009)(74482002)(99286004)(6246003)(6116002)(3846002)(6436002)(5660300001)(186003)(66066001)(99936001)(11346002)(6506007)(53546011)(478600001)(82746002)(2616005)(476003)(97736004)(102836004)(105586002)(83716003)(6916009)(7736002)(305945005)(26005)(36756003)(106356001)(53936002)(446003)(6486002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR07MB3472; H:VI1PR07MB4254.eurprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: darbyshire-bryant.me.uk does not designate permitted sender hosts) x-microsoft-antispam-message-info: msb3wbRWPErX+IrNIHvMk/rqOfQkzQE2M9LNjkN8UE6cCu0uUkUipoKaDe4iYPR7U96S+WTZ3Q7zw/B3VI1SVx5NMmBXTPV3qQ7hgu6dURsytorht9n77C0Ix98dAZRlnu9efDEClMQBdTK+a4RFcsceGCvXSo6iL+s94Iiya2xeG5OXVkBb6F5p6mRkSAtTdTwsQ787JFtrhaTHzes1hQ5dC+bJvI7AE54O8TqWRIwV/rzqDFgZXWUryVdh0HNMRjvHUiTqMqOyFtrOrRF73rWK6Lh4AisSLpMrcbWDL8gqWd94kjF0JWvb1XdIwd018njLz/qjIFmnwIC1LNluw+wLSA2ibie3JEd887zaMz0= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: multipart/signed; boundary="Apple-Mail=_AF111EF3-557A-499E-B451-265C774BD34A"; protocol="application/pgp-signature"; micalg=pgp-sha256 MIME-Version: 1.0 X-OriginatorOrg: darbyshire-bryant.me.uk X-MS-Exchange-CrossTenant-Network-Message-Id: a5cd2472-f206-4cab-0a0c-08d5e0444693 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Jul 2018 17:50:18.7670 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 9151708b-c553-406f-8e56-694f435154a4 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB3472 X-List-Received-Date: Mon, 02 Jul 2018 17:50:22 -0000 --Apple-Mail=_AF111EF3-557A-499E-B451-265C774BD34A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 2 Jul 2018, at 17:59, Kevin Darbyshire-Bryant via Cake = wrote: >=20 >=20 > From: Kevin Darbyshire-Bryant > Subject: Re: [Cake] Cake on openwrt - falling behind > Date: 2 July 2018 at 17:59:36 BST > To: Toke H=C3=B8iland-J=C3=B8rgensen > Cc: Pete Heist , Cake List = >=20 >=20 >=20 >=20 >> On 2 Jul 2018, at 17:14, Toke H=C3=B8iland-J=C3=B8rgensen = wrote: >>=20 >> Pete Heist writes: >>=20 >>>> On Jul 2, 2018, at 2:03 PM, Toke H=C3=B8iland-J=C3=B8rgensen = wrote: >>>>=20 >>>> Pete Heist writes: >>>>=20 >>>>> But, um, I find it curious that tb[TCA_PAD] has valid looking = values >>>>> in it, and if I just go: >>>>>=20 >>>>> tb[TCA_STATS2] =3D tb[TCA_PAD] >>>>>=20 >>>>> right after parse_rtattr is called, I start getting tin stats = printed >>>>> that look valid. There should be zeroes or invalid values at >>>>> tb[TCA_PAD], as that=E2=80=99s just supposed to be padding, right? >>>>=20 >>>> Hmm, that's interesting. Sounds like you are on the right track. = What >>>> are the numerical values of TCA_STATS2 and TCA_PAD in the kernel = and >>>> iproute2, respectively? >>>=20 >>> I never would=E2=80=99ve guessed they could be different when = compiled at once >>> :) but true, there are at least five different versions of = rtnetlink.h >>> under build_dir based on their md5sums, and I see one belongs to >>> iproute2-full. In all of those, it looks in the source like >>> TCA_STATS2=3D7 and TCA_PAD=3D9. >>=20 >> Aha! I think I figured out what is going on: >>=20 >> The gen_stats facility will add an nlattr header at the beginning of = the >> qdisc stats, which is the toplevel TLV that contains all stats (and = that >> we put our stats inside). It stores a reference to this header, and = when >> all the per-qdisc callbacks have finished adding their stats, it goes >> back and fixes up the length of the containing header. >>=20 >> The problem is that on architectures that need padding, the padding = TLV >> is added *first*, which means that the nlattr pointer that is stored >> before the callbacks are performed points to the padding TLV and not = the >> stats TLV. And so, when the header is fixed up, the result (from the >> parser's perspective) is just a very big padding TLV. >>=20 >> The options TLV is before the stats TLV, so the bug only occurs if = the >> options happen to have a length that means the stats will need = padding. >> Which is why messing with the number of options "fixes" the bug. >>=20 >> Could you try applying the patch below (to the kernel) and see if = that >> resolves the issue, please? >>=20 >> -Toke >>=20 >>=20 >> @@ -77,8 +77,12 @@ gnet_stats_start_copy_compat(struct sk_buff *skb, = int type, int tc_stats_type, >> d->lock =3D lock; >> spin_lock_bh(lock); >> } >> - if (d->tail) >> - return gnet_stats_copy(d, type, NULL, 0, padattr); >> + if (d->tail) { >> + int ret =3D gnet_stats_copy(d, type, NULL, 0, padattr); >> + if (!ret) >> + d->tail =3D ((struct nlattr = *)skb_tail_pointer(skb)) - 1; >> + return ret; >> + } >>=20 >> return 0; >> } > o/cake Would you like me to bash this into openwrt? Plans for this to go = upstream? Perhaps now take off list or onto IRC? Don=E2=80=99t think premature - TRULY FANTASTIC WORK EVERYONE!!!! Kevin --Apple-Mail=_AF111EF3-557A-499E-B451-265C774BD34A 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----- iQIzBAEBCAAdFiEEASyssijGxT6XdZEjs6I4m53iM0oFAls6ZdkACgkQs6I4m53i M0oWVxAAhFTqLl5qI/2cExB4feTdDL2lqrv5/DpOUJQQn9h51z2c9lWduVFrEI7R JtTWYFzeCrdNhLT671viItldTaUdaMU9Q7sRGfKPZ4jIi3PoZ35z9eC8FD2JAXdG tG14VCx7wBfzERX+JCH/sMZlnhgbMNR2V9cuesBWS+T6yYMQkJVRSThlHhlfANwh gAhjEgM22sXF9nbBm1nzyxRFZzI4RRTXgYSBLkL38UdZsOCeXtwhUrdUCU478jQv rHzR+baqmV0zyFkob6hexrV9MKJMUO8SGCCFG2yEYK00qOzMyZM4e3pb6gCNiELg q5H926O7n9N09m5TUWolRTy1NW8ICG9Kqc4ZGizGP3jF3sSOwstu55lQgXurXGoT lLR8hHpcEZGwAiS7zs72AHQapzF0M8X+BrLZ7uqGEjKafr7yqaDnmECqP6lmKACl UFyHsm4qC6RvEU/shBFhv0co5lD3V4C+qfsZJ9oplV6QH+BDmw//m23ivdCwcLCW Dsjyp/qD+R8nptZFza79K+v+x55wdAiLwJweuTdkncbDAoMJSZZtVQPO0QRScmG3 p85JTdA4OYvx44POFkiZYxVHBBlwbyraiOClqAYzPThlpCGT4vSULIdtl0yW88Fn BieAo68oHscwUIbHORu216ojLaHmVKt7p2uO9Q1oFSUmXxrvsCs= =HNc/ -----END PGP SIGNATURE----- --Apple-Mail=_AF111EF3-557A-499E-B451-265C774BD34A--