From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0060.outbound.protection.outlook.com [104.47.0.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.bufferbloat.net (Postfix) with ESMTPS id 9C1E73BA8E for ; Mon, 2 Jul 2018 12:59:38 -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=tDEfFS937hCRswyXswKeA5WxcDbmjHy+2At4RYN4x8M=; b=bYzgwjjvE1qFA4g42szDu1mdzky0gV4tr2VuujBxT68436UoAKgQ4BMBNXfj+62DaG41ApvUKxpQDUey5EAklcobXowMw8Q43wLzR6oeJPo4eyjStr08CBwQ+Pp8D1oNQ3raW5N/slfkWE/B55q2/mZ1h8Vioqn3SI8VPdeLacw= Received: from VI1PR07MB4254.eurprd07.prod.outlook.com (20.176.6.147) by VI1PR07MB4112.eurprd07.prod.outlook.com (52.134.21.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.930.13; Mon, 2 Jul 2018 16:59:36 +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 16:59:36 +0000 From: Kevin Darbyshire-Bryant To: =?utf-8?B?VG9rZSBIw7hpbGFuZC1Kw7hyZ2Vuc2Vu?= CC: Pete Heist , Cake List Subject: Re: [Cake] Cake on openwrt - falling behind Thread-Topic: [Cake] Cake on openwrt - falling behind Thread-Index: AQHUEfzAVn4q46L7QUyKsSBc41C9maR8BF0AgAAXDQCAAAy4gA== Date: Mon, 2 Jul 2018 16:59:36 +0000 Message-ID: <33E764EB-8BB5-4ADA-B598-E6ECD4A7FFCD@darbyshire-bryant.me.uk> 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: <87fu11ipir.fsf@toke.dk> 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; VI1PR07MB4112; 7:X9aGLLrnlu9YgBjah9PnKNxtzsm6sgTFhgo8PW4JZ+i4y7L+YYKAjoKbP9pe1+O5vzK/WGUty7fgUMvGa3c6vq9AfApV57jj/GzdjIDX5m2MUM0kaKg4w/MAKz1hiuYv4tSKVQcnkEIKcqq+9GeaRYoCPhH52TgasQIpcbfQyYNGfrodxWEWFWH3QSOnaSLDGzvDs23zQIPtBfO9pw+v4b/DFJOYEXfY1U9YgbMxrMa1xXZ6nPRb7uW6jnx3/1rI x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: be0ccfdb-ab74-4d63-a610-08d5e03d30fa 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:VI1PR07MB4112; x-ms-traffictypediagnostic: VI1PR07MB4112: authentication-results: spf=none (sender IP is ) smtp.mailfrom=kevin@darbyshire-bryant.me.uk; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(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)(93006095)(93001095)(10201501046)(149027)(150027)(6041310)(20161123558120)(2016111802025)(20161123564045)(20161123560045)(20161123562045)(6072148)(6043046)(201708071742011)(7699016); SRVR:VI1PR07MB4112; BCL:0; PCL:0; RULEID:; SRVR:VI1PR07MB4112; x-forefront-prvs: 07215D0470 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(366004)(396003)(39830400003)(136003)(376002)(199004)(189003)(36756003)(25786009)(6116002)(3846002)(105586002)(229853002)(33656002)(114624004)(6436002)(6512007)(106356001)(93886005)(5250100002)(2900100001)(66066001)(82746002)(5660300001)(6486002)(6246003)(53936002)(4326008)(74482002)(14454004)(97736004)(446003)(7736002)(8676002)(305945005)(8936002)(6916009)(81156014)(81166006)(14444005)(68736007)(316002)(2616005)(186003)(256004)(11346002)(476003)(76176011)(54906003)(6506007)(83716003)(26005)(99936001)(486006)(102836004)(53546011)(99286004)(478600001)(86362001)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR07MB4112; H:VI1PR07MB4254.eurprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: darbyshire-bryant.me.uk does not designate permitted sender hosts) x-microsoft-antispam-message-info: YqWBmq0Zdzy8B1HamkilPkH/uRwWR8XoodmbKb6ahHDXUGZxwpdVStDOJUBgZZQe8BW9P/R0H3+dyOwVGAlSN5ZjXMs4ySmuAVGAKVV5epwH2gRhDjHzWMv4wln02sbpD8gaFPN7XOZrKtzHtUihvAUWaiTknU2ga3e5ATzYXuxmsLX42Srf61ceGAdz3Ud/YFV6He7EFUzRp0LOGSRPrfzTJcrJLrrg4g6dmC2hxz3SOgCSout8aSSEnJuj5lWRXYTVGXQXp65/VghbBTPxdhrvnUUa6cklGNi7SBBQYH70NEAOEmcc/4OZIqYcNdD0fa2W0vxJXekKhBcgP/dNg8YfQvZfvgGBVMrZ36zC0y4= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: multipart/signed; boundary="Apple-Mail=_2D3B864D-B0DB-490E-9A4D-4C15A7E3810A"; protocol="application/pgp-signature"; micalg=pgp-sha256 MIME-Version: 1.0 X-OriginatorOrg: darbyshire-bryant.me.uk X-MS-Exchange-CrossTenant-Network-Message-Id: be0ccfdb-ab74-4d63-a610-08d5e03d30fa X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Jul 2018 16:59:36.0746 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 9151708b-c553-406f-8e56-694f435154a4 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB4112 X-List-Received-Date: Mon, 02 Jul 2018 16:59:39 -0000 --Apple-Mail=_2D3B864D-B0DB-490E-9A4D-4C15A7E3810A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > 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; > } I do believe Sir you have cracked it. Without my u32 hack on a = MIPS34kc arch that previously required my hack=E2=80=A6.. tc -s qdisc show dev ifb4pppoa-wan qdisc cake 800b: root refcnt 2 bandwidth 2027Kbit diffserv3 dual-dsthost = nat ingress split-gso rtt 100.0ms raw overhead 0 tca_stats 2011972452 tca_stats2 2011971788 tca_xstats 0 calling print_tcstats_attr() print_tcstats_attr() got stats2 Sent 144 bytes 3 pkt (dropped 0, overlimits 0 requeues 0) xstats 2145834940 tca_stats_app 2011971792 backlog 0b 0p requeues 0 got xstats 2011971792 tca_stats 2011972452 tca_stats2 2011971788 = tca_xstats 0 memory used: 2464b of 4Mb capacity estimate: 2027Kbit min/max network layer size: 48 / 48 min/max overhead-adjusted size: 48 / 48 average network hdr offset: 0 Bulk Best Effort Voice thresh 126680bit 2027Kbit 506744bit target 143.4ms 9.0ms 35.9ms interval 286.8ms 104.0ms 130.9ms pk_delay 0us 17us 0us av_delay 0us 0us 0us sp_delay 0us 0us 0us backlog 0b 0b 0b pkts 0 3 0 bytes 0 144 0 way_inds 0 0 0 way_miss 0 1 0 way_cols 0 0 0 drops 0 0 0 marks 0 0 0 ack_drop 0 0 0 sp_flows 0 1 0 bk_flows 0 0 0 un_flows 0 0 0 max_len 0 48 0 quantum 300 300 300 Cheers, Kevin D-B 012C ACB2 28C6 C53E 9775 9123 B3A2 389B 9DE2 334A --Apple-Mail=_2D3B864D-B0DB-490E-9A4D-4C15A7E3810A 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----- iQIzBAEBCAAdFiEEASyssijGxT6XdZEjs6I4m53iM0oFAls6WfcACgkQs6I4m53i M0ra2Q//WyzVaHSDE2cVbCWPzehzUbr3pzxJWhq0XdKwgY1ait6rLBcK7KUHiUPD SEd3OV/+POzcl9IuxkEB8vsI/BMIO82hqMsUapSGuX6eBrUYF+acAqJsjduHdLcV 4y2VDcaVvhe+quHhARZ8nI+HJjBCiFaJmK9G42q7ly0nbpszXHC3j/gVMmnEkKwS 2Hn4jFcZhn+2Z+NKvUupP8q1ww3cLFDl6YmCqm3jjRvnvDAYRTFjcQOysBw8godu cNL5mVYfKg+2Jh3xplIMqLx4DT5yVZLwYeoVCPebmQ5UZZrRMbfRuVYnqtWNrOu+ VacWSDQjHvy10s3+ianCMLAa3MAFhttu0iuhP6QRFOpR8ZiGjWku0c2HSf5AzVR6 BKT6YzgAvAlL1VxpFQH2fw0DhU92Y4xPV1h0peukULdGJPYqE3t4Y/Mj9MWUgPx2 ZKu/kvRYFXUcP0+GalDZ1mtqAixxMdmC1bVenwKVnl5h1U023ra3RBcAjTvMGlEu 66zcye36NzM67H+LwDmTg+KYwU0Lh92nb5JHyJ5rPFk5iTo0aYUuFEyNppgFOesE 461v64aIRy9RWCtAIYjiwksIawMxfGkEWzNeegmM5sotxar30hQbi3TtMvpyRIii uLXsGrYnsEaqP/uRuDFJuReO/ZWQZ9wXK4MyxqSzJQBMRQQPOdY= =BHjU -----END PGP SIGNATURE----- --Apple-Mail=_2D3B864D-B0DB-490E-9A4D-4C15A7E3810A--