From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-x242.google.com (mail-wr0-x242.google.com [IPv6:2a00:1450:400c:c0c::242]) (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 297B33BA8E for ; Mon, 2 Jul 2018 15:31:42 -0400 (EDT) Received: by mail-wr0-x242.google.com with SMTP id u7-v6so16611687wrn.12 for ; Mon, 02 Jul 2018 12:31:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heistp.net; s=google; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=eAbi4zv+c5XMprMxs10VndWMFYB7i9HEg3Thur0KrKc=; b=OlzzeP7uobXuahXwsE3MhgCPTJe5e8U0DOIQ8R53YFUIGlqK5D1mvaqWESI7rQNaKo uPoeF8XgGwKUGJrZZ4q4ZE9WzRixsfuJVftflh+CFWbfFOkkGYYqwTPxNJAQ7HzbnWXZ CU/5nkaY4c89U2FCPEnS5bSgECp6W1uaEhlmsHb+X07+VKL7OBeeBtXDuUuEnuB52a/I uQJJ1dsTUpzKeEiyzQl5+1qokSvuEtNXJtHeem5aHI9MWgCQ3U3jNvCpfFsc+hMMA72p Bn9pB54CvHUdKknzvoN9392YMKaOxgknZg4vn4vgqzkBHHCU3e1iuBHC935ZRMpAPED2 wynQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=eAbi4zv+c5XMprMxs10VndWMFYB7i9HEg3Thur0KrKc=; b=GJTNEbEnrWBDqszjMAOp/MeW1kll7elxHbfgEDYuN2/4E49k6EDV48LzE9eZqoEUeG X6nD3Yyr3WpFda+nQ+BH9tzhJjZgrbbbh9s7+uiUbnJMEDxN0+IG/QSr8MwcTgUNeb5P EpdiQNfH7WV2pSziCwYikXV1PtIaZ8XyYUGKqqXI3jXh/j5z4Qdc9nxVjSoHeWISjEOq 9hGQBlliHdq6YdSvOT0Sx8XXhEUhusw5nA1FyELNdvnnaAK8VZjWap743NjLuernm1hr c+E4l9i8YEmB7ONpIz5Qnxtvco6kWATowSwLWYMA4ZToHAQITl4SozwJ7EswUrJHiobG AyPA== X-Gm-Message-State: APt69E1MLVH8alpxW1xsSS+iIaMcqizoD15fsOPoKP/OWqU/GBmTolxm HTv8cdrwyV46CVQQ4BLDLq6mlQ== X-Google-Smtp-Source: AAOMgpcoOYQlK71RDSkDmplWSarp3F1c280Na85E0as8TwwsbYuR7UHq9W7nn70+CUfJX7D7eTn55Q== X-Received: by 2002:adf:e0cc:: with SMTP id e12-v6mr12629645wri.199.1530559901338; Mon, 02 Jul 2018 12:31:41 -0700 (PDT) Received: from tron.luk.heistp.net (h-1169.lbcfree.net. [185.193.85.130]) by smtp.gmail.com with ESMTPSA id 4-v6sm18059651wmh.14.2018.07.02.12.31.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jul 2018 12:31:40 -0700 (PDT) From: Pete Heist Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_3F899F17-5F27-40EA-982A-F17AF550F9F4" Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Date: Mon, 2 Jul 2018 21:31:39 +0200 In-Reply-To: Cc: =?utf-8?Q?Toke_H=C3=B8iland-J=C3=B8rgensen?= , Cake List To: Dave Taht 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> X-Mailer: Apple Mail (2.3445.8.2) Subject: Re: [Cake] Cake on openwrt - falling behind 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, 02 Jul 2018 19:31:42 -0000 --Apple-Mail=_3F899F17-5F27-40EA-982A-F17AF550F9F4 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jul 2, 2018, at 8:39 PM, Dave Taht wrote: >=20 > On Mon, Jul 2, 2018 at 12:13 PM Toke H=C3=B8iland-J=C3=B8rgensen = > wrote: >>=20 >> Could you try applying the patch below (to the kernel) and see if = that >> resolves the issue, please? >=20 > This seems like it will introduce problems with stuff that isn't or is > legitimately broken in the first place, pointing to potentially random > data in the wrong place. >=20 > would a workaround be adding more padding to the cake stats output so > it's always even? >=20 > why does it work as written on arm? I doubt this, but what if someone else conditionally padded their custom = stats in response? Personally I=E2=80=99d say get it right in the kernel = and =E2=80=9Cmake them fix their stuff=E2=80=9D, but does anyone have = visibility on that? After re-reading Toke=E2=80=99s explanation I see now why tb[TCA_PAD] = points to right before TCA_STATS2. That=E2=80=99s where the padding is. = :) I was only generally wondering if a padding pointer should point to = anything. >>=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; >> } --Apple-Mail=_3F899F17-5F27-40EA-982A-F17AF550F9F4 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On Jul 2, 2018, at 8:39 PM, Dave Taht <dave.taht@gmail.com>= wrote:

On Mon, Jul 2, 2018 at 12:13 PM = Toke H=C3=B8iland-J=C3=B8rgensen <toke@toke.dk> wrote:

Could you try applying the patch below (to the kernel) and = see if that
resolves the issue, please?

This seems like it will introduce problems with stuff that = isn't or is
legitimately = broken in the first place, pointing to potentially random
data in the wrong = place.

would a = workaround be adding more padding to the cake stats output so
it's always even?

why does it work as written on = arm?

I = doubt this, but what if someone else conditionally padded their custom = stats in response? Personally I=E2=80=99d say get it right in the kernel = and =E2=80=9Cmake them fix their stuff=E2=80=9D, but does anyone have = visibility on that?

After re-reading = Toke=E2=80=99s explanation I see now why tb[TCA_PAD] points to right = before TCA_STATS2. That=E2=80=99s where the padding is. :) I was only = generally wondering if a padding pointer should point to = anything.


-Toke


@@ -77,8 = +77,12 @@ gnet_stats_start_copy_compat(struct sk_buff *skb, int type, = int tc_stats_type,
          &nb= sp;    d->lock =3D lock;
          &nb= sp;    spin_lock_bh(lock);
       }
- =       if (d->tail)
- =             &n= bsp; return gnet_stats_copy(d, type, NULL, 0, padattr);
+       if (d->tail) {
+ =             &n= bsp; int ret =3D gnet_stats_copy(d, type, NULL, 0, padattr);
+ =             &n= bsp; if (!ret)
+ =             &n= bsp;         d->tail =3D = ((struct nlattr *)skb_tail_pointer(skb)) - 1;
+ =             &n= bsp; return ret;
+ =       }

       return 0;
}

= --Apple-Mail=_3F899F17-5F27-40EA-982A-F17AF550F9F4--