Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2905110pxa; Tue, 25 Aug 2020 06:37:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYOqRVnFdThDBsW8US/62NJNLJz67dlo9nKR0lj4AF7SjclIiz9bSC58ns/447cpwm9WRu X-Received: by 2002:aa7:c251:: with SMTP id y17mr10602884edo.13.1598362672074; Tue, 25 Aug 2020 06:37:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598362672; cv=none; d=google.com; s=arc-20160816; b=z9nsB2p9sjUb5ki68rnwixgQ1Wg0+WxVOcVQytUOUadmqGaktHFMYp82xTe02j1z1G 7m1mA+IQ4zDh0n8W68S86o/qaLZGvQlckBQT0JhqwUrp9IP3ZRB3o4Aoh9K571Lyb2WG 8pXx4RkNgPJBZBBp6xnbvHFGYLTeMdC6zpJDfbMUS//Lnbjmyo8yqc39Ta259awLrJ3Y dFFmUvgMNtJ00uIv/H1yQrFPeF8TO5aepGcTFYGhg87VzGaIXdkJ/PSF2Dl5Jmsw+obq endsQ06G7glRooajiEZ+vjoergLBpTqrKemM3IHC21I2jXijNstBFRBm1297XCCFJYMs d/Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=snf7xzSq1+7sAAY1FkgIm/Dy4E/puXZF38YMoitWgY8=; b=NuHzVYRWkHvUeHoeiffSM/Eke6WFapaDUgwQJbprP305ldBWa1v4Ohw4AhnR/BJT/W LJYPzyhC51bsdwZHSJTJN0qFMhKRUfcdOxSRjtxrT849Wz9iUz2nyf90J7jozpSwpDoB rKxIViR9Yrr3125p/hUJdMMG9fDYqg8vijWEsfbXlKlMf5PKXBB37n7ydgGdaSTEapks LcjeCDF8gLUPsHFjqFwXwF4clyF9Qw9W1cOCTOat9pbl/BV8FhnSF1681ruU/BEdrNUb rO3yCMEfMzMMTDdcaxHOWSIAfvhhl5coElaO46JJGrWyopqazB2P2nGmhsMzHEbzkym+ ZvLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MiECm9oC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cq22si8218371edb.609.2020.08.25.06.37.27; Tue, 25 Aug 2020 06:37:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MiECm9oC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730050AbgHYMD2 (ORCPT + 99 others); Tue, 25 Aug 2020 08:03:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726619AbgHYMDD (ORCPT ); Tue, 25 Aug 2020 08:03:03 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEA8EC061757; Tue, 25 Aug 2020 05:01:35 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id x7so6387569wro.3; Tue, 25 Aug 2020 05:01:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=snf7xzSq1+7sAAY1FkgIm/Dy4E/puXZF38YMoitWgY8=; b=MiECm9oCSRH6Ovco3ytlPbF5/Ah9Naz9NpWeCHEx2YOlcObioWB0Cy9pCn9OMGnU/I HsxslivSndSqAdkJ6MXiSJQ7SZHh9F6thsA/ZQ7uYUFDm1uW24tUS7dbmP+iPBV28eGh ie7XWy52niJA55qKPLrNeORO3b+cO+vWABmrOv3eU8voiU01rEUVjjwKhloCNnOED4Io eSh+lO3cktym0nT+EHbmU9wKzQR9n/GdkvqGRWnS67GeDOx/aVARmYmidmSKuzJmGY7h mDgYApq6IzEfNYuLvyluNrn83UYgxyJrU3M08EGvm1VTMbNmdQAkJkZyNU7El0cSw/t4 Y6sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=snf7xzSq1+7sAAY1FkgIm/Dy4E/puXZF38YMoitWgY8=; b=VA5OBJH9mAhGrpnswVh/NoqOGegwMh0it7K0Ctb+kOTQj1ZNSu65Osru4LTfkvbaLy Rcv2EXxHHpXRO7eQ4j4xsBZgNb93Qg9vGDavvhBTxhCDk+qdhBwNZQzD/EZbvcge/IdK 8lQBIetRdKno098wLurOtUqrMkaJiGpWi4BTXAcYhF0eDsGXWe8Tg4lgF15SvH5YEpVS PtfleRbP4VhcqN1Qxt+ZoYelxwJV6VGPXDMZZiP2n5fgAcOyXykBemQgyC1M93HMUigB v/tGHtwejHECEhaGCj47ZXTrACWZTBTkL/sr+eqW5/iBaZN0VcQg97CzRgYJ/CGCt49S 4jMA== X-Gm-Message-State: AOAM532br1Ppw6Wqkcoj5M8eqLMwWOdFrjrOhlhVvj9h2XLdismC8xgf rMF9RUPDSIYd3Y4TOjEu8Z8= X-Received: by 2002:a5d:684b:: with SMTP id o11mr10905113wrw.101.1598356893527; Tue, 25 Aug 2020 05:01:33 -0700 (PDT) Received: from [192.168.1.125] (dynamic-adsl-84-220-30-184.clienti.tiscali.it. [84.220.30.184]) by smtp.gmail.com with ESMTPSA id d10sm18469936wrg.3.2020.08.25.05.01.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 25 Aug 2020 05:01:32 -0700 (PDT) Subject: Re: [net-next v4] seg6: using DSCP of inner IPv4 packets To: David Miller Cc: kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, andrea.mayer@uniroma2.it References: <20200824085124.2488-1-ahabdels@gmail.com> <20200824.181109.421299456838417383.davem@davemloft.net> From: Ahmed Abdelsalam Message-ID: Date: Tue, 25 Aug 2020 14:01:27 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200824.181109.421299456838417383.davem@davemloft.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25/08/2020 03:11, David Miller wrote: > From: Ahmed Abdelsalam > Date: Mon, 24 Aug 2020 08:51:24 +0000 > >> This patch allows copying the DSCP from inner IPv4 header to the >> outer IPv6 header, when doing SRv6 Encapsulation. >> >> This allows forwarding packet across the SRv6 fabric based on their >> original traffic class. >> >> Signed-off-by: Ahmed Abdelsalam > > "Allows" sounds like the behavior is optional, but that is not what > is happening here. You are making this DSCP inheritance behavior > unconditional. > > I've stated that the current behavior matches what other ipv6 > tunneling devices do, and therefore we should keep it that way. > > Furthermore, this behavior has been in place for several releases > so you cannot change it by default. People may be depending upon > how things work right now. > Ok. I added a new sysctl (seg6_inherit_inner_ipv4_dscp) to enable/disable the new behavior. The sysctl will be checked in case of IPv4 traffic. In the IPv6 case, there is no change as the code is already copying the DSCP from the inner IPv6 packet. I'm sending a new patch. > Also: > >> @@ -130,6 +129,7 @@ int seg6_do_srh_encap(struct sk_buff *skb, struct ipv6_sr_hdr *osrh, int proto) >> struct ipv6_sr_hdr *isrh; >> int hdrlen, tot_len, err; >> __be32 flowlabel; >> + u8 tos = 0, hop_limit; > > Need to preserve reverse christmas tree here. > Fixed in the new patch.