From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.bufferbloat.net (Postfix) with ESMTPS id ED2553B29D for ; Thu, 25 Jun 2020 15:53:59 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593114839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4RcGLpg3u5qLcX1VpWke4rfqFK2+icMpY3Tee102yDY=; b=IUK3fugYxcxbageFWzsjTr+yjg2Tw6sLDAVeV7hSLJA2z/M1HVAg6VucesS2il/gm4119B YetHVAGgPFOcVMPAVXsCLFvbS3+cdPASbRwWU7CeD0PXR1taCBNOOcnF3zEdKnIHRtf5Nj +fIQwQhbKq5+lT1OsjVQGgipbO598Gc= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-299-n3xx70rvPgyfNkazzyGUog-1; Thu, 25 Jun 2020 15:53:57 -0400 X-MC-Unique: n3xx70rvPgyfNkazzyGUog-1 Received: by mail-ed1-f71.google.com with SMTP id i11so5962604edx.4 for ; Thu, 25 Jun 2020 12:53:56 -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:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=cS7ZRqCXaXGLEgCdmvMXOz2AM+S+PTeNcCJzZKUNa0M=; b=TYn0dRFNhG/6+WiLXmxZJI2mXCmr5ZchjYpZADwdWDs88UoTDzJw9xfKHTP7PgH4Ee gv9AlNpmhqi6iVhOmgJwcBHdPsVf9jF0gvrN2Ya50qS+TNJVifm4+1KB58tFNi1Ce/OB GCHGjbOrAj0bd+KNPK+IBr3dUPYImNBJrdri4b5QKTW5Uu4NMYD2+VFjln6EVq65lnCb utRFtnDCY7iHcK2SbDNwiRA+sSdVqPJGk01Xe20AZtxFxhBzbk3tDTcJyEWzWL+2UnTs FQv5xDFOjgaopo5d6a94xchS7t3j4igJWtaqGR4VMIiGfWZ2db6f3Qsqw09DVqWGK1dA u2Eg== X-Gm-Message-State: AOAM532/oiaA/B2THqb7OVl501n/2DAdc03p+opTlnkwW46aQ22MDwcC fqTU8aZ7cfXyIMOEMmiuYkaDF/dKMkcRZz4ivdTrRZnMmsMXxmX2dt5G9bFkEqYhtgJwUggGQpt S/VCl3H4ry3z7YDyZsHc3RA== X-Received: by 2002:aa7:c24d:: with SMTP id y13mr24219490edo.123.1593114835833; Thu, 25 Jun 2020 12:53:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPpNmKIUZ03MOVPY6kzP3vRwyXHdLLFbQ9anv7+nD1LWLxtb1zeMHS+rbhu0pCCB+67BZMtg== X-Received: by 2002:aa7:c24d:: with SMTP id y13mr24219479edo.123.1593114835649; Thu, 25 Jun 2020 12:53:55 -0700 (PDT) Received: from alrua-x1.borgediget.toke.dk ([2a0c:4d80:42:443::2]) by smtp.gmail.com with ESMTPSA id m13sm7655147ejc.1.2020.06.25.12.53.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jun 2020 12:53:55 -0700 (PDT) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id 92A201814F9; Thu, 25 Jun 2020 21:53:53 +0200 (CEST) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= To: David Miller Cc: netdev@vger.kernel.org, cake@lists.bufferbloat.net In-Reply-To: <20200625.122945.321093402617646704.davem@davemloft.net> References: <159308610282.190211.9431406149182757758.stgit@toke.dk> <159308610390.190211.17831843954243284203.stgit@toke.dk> <20200625.122945.321093402617646704.davem@davemloft.net> X-Clacks-Overhead: GNU Terry Pratchett Date: Thu, 25 Jun 2020 21:53:53 +0200 Message-ID: <87k0zuj50u.fsf@toke.dk> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Cake] [PATCH net-next 1/5] sch_cake: fix IP protocol handling in the presence of VLAN tags 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: Thu, 25 Jun 2020 19:54:00 -0000 David Miller writes: > From: Toke H=C3=B8iland-J=C3=B8rgensen > Date: Thu, 25 Jun 2020 13:55:03 +0200 > >> From: Ilya Ponetayev >>=20 >> CAKE was using the return value of tc_skb_protocol() and expecting it to= be >> the IP protocol type. This can fail in the presence of QinQ VLAN tags, >> making CAKE unable to handle ECN marking and diffserv parsing in this ca= se. >> Fix this by implementing our own version of tc_skb_protocol(), which wil= l >> use skb->protocol directly, but also parse and skip over any VLAN tags a= nd >> return the inner protocol number instead. >>=20 >> Also fix CE marking by implementing a version of INET_ECN_set_ce() that >> uses the same parsing routine. >>=20 >> Fixes: ea82511518f4 ("sch_cake: Add NAT awareness to packet classifier") >> Fixes: b2100cc56fca ("sch_cake: Use tc_skb_protocol() helper for getting= packet protocol") >> Fixes: 046f6fd5daef ("sched: Add Common Applications Kept Enhanced (cake= ) qdisc") >> Signed-off-by: Ilya Ponetayev >> [ squash original two patches, rewrite commit message ] >> Signed-off-by: Toke H=C3=B8iland-J=C3=B8rgensen > > First, this is a bug fix and should probably be steered to 'net'. > > Also, other users of tc_skb_protocol() are almost certainly hitting a > similar problem aren't they? Maybe fix this generically. I think it depends a little on the use case; some callers actually care about the VLAN tags themselves and handle that specially (e.g., act_csum). Whereas others (e.g., sch_dsmark) probably will have the same issue. I guess I can trying going through them all and figuring out if there's a more generic solution. I'll split out the diffserv parsing fixes and send those for your net tree straight away, then circle back to this one... -Toke