From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (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 778973CB35 for ; Tue, 2 Apr 2019 13:45:10 -0400 (EDT) Received: by mail-ed1-f53.google.com with SMTP id p20so12443991eds.6 for ; Tue, 02 Apr 2019 10:45:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=xieKrQ07sbB5NXJtqACFqaWT9/tpz+u5bUJUXNOVE/E=; b=PwjoWzV6SJGj/j89VWZHUZsqoM/mGRxLoU4In2TvySNtO9cPo5XY++qNZTrmgGyQTD 1W1v3/QQMeA5sKSV3R5PoFwDgsRiA7F0YAxMJlfhPtCXKUdlq18l2geXC1rgFCO6VSG6 y0i7UQNxxtCXSI/f33cDr/4pDY2kHbnHL0nnVRXhjsM5w750ipH56GlIOk5KaFsmsvb3 a4sII7uRNLmhngqClXZHZ8XFeGTFytbIFZ52Zs3mVwDFNlwcqduo5jTa8cwUSJYlMeGu pqUdcljaeTQCO1UjMnEFsX2v9Qo55GQnSiG7MI9hTHWV83s5tjFg3b5ds133OVxcnPM4 tFvA== X-Gm-Message-State: APjAAAX2VvJLG4rFd6k9EaU9fGek/HRNZlKfyPD5pxOwQUEAjR0R2YqQ Z/kpiSflggtkEnSRDFvpPXcPP9N85vQ= X-Google-Smtp-Source: APXvYqySFbQHWRzhjmctqAGd/EY/5i9FmvRRX4sybFktdUOfmMifvUxaPx0QIITRHOAgoNyyasI2bA== X-Received: by 2002:a17:906:7010:: with SMTP id n16mr820138ejj.271.1554227109643; Tue, 02 Apr 2019 10:45:09 -0700 (PDT) Received: from alrua-x1.borgediget.toke.dk (borgediget.toke.dk. [85.204.121.218]) by smtp.gmail.com with ESMTPSA id h26sm115859ejx.88.2019.04.02.10.45.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 02 Apr 2019 10:45:08 -0700 (PDT) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id 301071800B9; Tue, 2 Apr 2019 19:45:08 +0200 (CEST) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= To: Kevin Darbyshire-Bryant , Cake List In-Reply-To: <57C0B5D4-C76E-4EA8-B1B7-7B8BC33B2BDE@darbyshire-bryant.me.uk> References: <57C0B5D4-C76E-4EA8-B1B7-7B8BC33B2BDE@darbyshire-bryant.me.uk> X-Clacks-Overhead: GNU Terry Pratchett Date: Tue, 02 Apr 2019 19:45:08 +0200 Message-ID: <87h8bgnvx7.fsf@toke.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Cake] SCE/CAKE coding curiosities 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: Tue, 02 Apr 2019 17:45:10 -0000 Kevin Darbyshire-Bryant writes: > Ahoy there team Bufferboat :-) > > I=E2=80=99ve been looking at the new SCE related code and a few questions= have fallen out of the brain cell. > > 1) > https://github.com/dtaht/sch_cake/blob/47d821f89f39c1b2216d6f65b014f609e4= 6fc57c/sce.h#L50 > Curious as to why htons isn=E2=80=99t used here as per other instances in > CAKE? No idea about this. > 2) Immediately below that line we have a skb length guard before > trying to set ECT ultimately via ipv?_change_dsfield - we have other > places in CAKE where we play with dsfield bits that don=E2=80=99t have an > (obvious) guard - should they? > > 3) And saving the most curious for last, in cake_update_flowkeys we check= the protocol again (we want IPv4 packets only) but we use tc_skb_protocol(= skb) https://github.com/dtaht/sch_cake/blob/47d821f89f39c1b2216d6f65b014f60= 9e46fc57c/sch_cake.c#L628 > > tc_skb_protocol says "/* We need to take extra care in case the skb came = via > * vlan accelerated path. In that case, use skb->vlan_proto > * as the original vlan header was already stripped. > */ > if (skb_vlan_tag_present(skb)) > return skb->vlan_proto; > return skb->protocol; > " > > What??? Should cake_handle_diffserv use tc_skb_protocol too? and > INET_ECN_set_sce ?? Yup, I believe you are right about both of these; nice catch! I pushed fixes for cake_handle_diffserv(); keeping my hands off the sce bits for now ;) -Toke