From mboxrd@z Thu Jan 1 00:00:00 1970 From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= Subject: Re: [PATCH net-next v13 3/7] sch_cake: Add optional ACK filter Date: Mon, 21 May 2018 19:35:35 +0200 Message-ID: <87r2m4ykrc.fsf@toke.dk> References: <152691970035.4083.3349902669266371765.stgit@alrua-kau> <152691985736.4083.3416150561524698541.stgit@alrua-kau> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable To: Eric Dumazet , netdev@vger.kernel.org, cake@lists.bufferbloat.net Return-path: Received: from mail.toke.dk ([52.28.52.200]:52507 "EHLO mail.toke.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753235AbeEURfp (ORCPT ); Mon, 21 May 2018 13:35:45 -0400 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: Eric Dumazet writes: > On 05/21/2018 09:24 AM, Toke H=C3=B8iland-J=C3=B8rgensen wrote: > >> + while (oplen_tmp >=3D 8) { >> + u32 right_b =3D get_unaligned_be32(sack_tmp + 4); >> + u32 left_b =3D get_unaligned_be32(sack_tmp); >> + >> + if (left_b >=3D right_b) >> + continue; >> + >> + if (first) >> + bytes_b +=3D right_b - left_b; >> + >> + if (left_b <=3D left_a && right_a <=3D right_b) { >> + found =3D true; >> + if (!first) >> + break; >> + } >> + oplen_tmp -=3D 8; >> + sack_tmp +=3D 8; >> + } >> > > This is obviously incorrect. > > Please take a look at TCP stack, and how it handles sequence wrapping > with following macros : > > after(), before() Ah yes, sequence number wrapping. I was thinking I needed to deal with that, and then got sidetracked and forgot about it. Will fix. Other than that, do you agree that this approach to SACK and header handling can work? > Quite frankly O wonder how this was really tested. Getting it wrong results in a few drop decisions being wrong every 2**32 bytes; easy to miss. If you have a "mis-behaving middle-box test suite" or something I'll be happy to hear about it :) -Toke