Received: by 10.192.165.148 with SMTP id m20csp948056imm; Wed, 25 Apr 2018 10:04:31 -0700 (PDT) X-Google-Smtp-Source: AIpwx48cyEA2FysWnOy5/SwU7bRP7ZMx0ZiOXxH6BcFt1It/T9aJFM2zGG4A6MWp2JuPOCaic1lf X-Received: by 10.98.13.151 with SMTP id 23mr28924951pfn.231.1524675871237; Wed, 25 Apr 2018 10:04:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524675871; cv=none; d=google.com; s=arc-20160816; b=iGr4OvcHZPykUMH/etAwA30ArhTDwqvBraYAATFfRpfWJCC390FbtXBrAImWww6dXy s21Ls5lm+9UmHxoptlIl3fJEOtFD9ZhrDbWceZMpb6qKr2pmH4GUxNg+wDWDdes+R7Na 3dfVC8WqlFNAce798Mo4MndB0LewcXzy5s7fl0/EAtfjs65vuJ1dIhvNL0NFrd4QJoN2 DqqcsUacjyKEmDKXUhZxCcZKt656XpDj7f8nbncovXuu4kZSfCYXxDuaGNX8HKmjZfxJ k41PCjm0hMeE/5MAMLf/OhGAZIEu+7qTqU7B1EUvLomvRZY6+ykd7awYY0P2UfRpC9YW txLQ== 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:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date :arc-authentication-results; bh=LXxHvwcmoALC1gfbRNglU+MknPP5wx/j4cWN6f99qdU=; b=zI/zveObmoacfbiaLlR24DX/T7X3EuNfASZU3Kc2EipZkldyD9R5egbJVTGttRH6O9 vZpktgnm1uNZtgkaWk/YTDiPj81+XZHKEPpvvAZPJ7tl6cdVGdn1e7HQm2h+0JmdgrhB PLEsW4sCuecTeBJNQk9XaSg+5wd2SYpvox8jiJtttrhqilTLheWd3d8jXGgWUvoMEU4V bMWwOu8SOYJWmtD+ddBXa8fQIj6NdrKwgkwP8n/6HdlekLSNabPC4fmC4IjLheKdggsD lEkmDVSDlwWEGlKvpleIKN9ddkrZvziQhXmsflad+Rwr0LuNcjidqy9wt2FInJVPWzIH bagQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 5-v6si10875085plc.203.2018.04.25.10.04.16; Wed, 25 Apr 2018 10:04:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755530AbeDYRDJ (ORCPT + 99 others); Wed, 25 Apr 2018 13:03:09 -0400 Received: from shards.monkeyblade.net ([184.105.139.130]:52312 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754585AbeDYRDG (ORCPT ); Wed, 25 Apr 2018 13:03:06 -0400 Received: from localhost (67.110.78.66.ptr.us.xo.net [67.110.78.66]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 5DE46133F641A; Wed, 25 Apr 2018 10:03:05 -0700 (PDT) Date: Wed, 25 Apr 2018 13:03:04 -0400 (EDT) Message-Id: <20180425.130304.1605881647944477071.davem@davemloft.net> To: amsalam20@gmail.com Cc: dav.lebrun@gmail.com, kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [net-next v3] ipv6: sr: Compute flowlabel for outer IPv6 header of seg6 encap mode From: David Miller In-Reply-To: <1524594196-12383-1-git-send-email-amsalam20@gmail.com> References: <1524594196-12383-1-git-send-email-amsalam20@gmail.com> X-Mailer: Mew version 6.7 on Emacs 25.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Wed, 25 Apr 2018 10:03:05 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ahmed Abdelsalam Date: Tue, 24 Apr 2018 20:23:16 +0200 > ECMP (equal-cost multipath) hashes are typically computed on the packets' > 5-tuple(src IP, dst IP, src port, dst port, L4 proto). > > For encapsulated packets, the L4 data is not readily available and ECMP > hashing will often revert to (src IP, dst IP). This will lead to traffic > polarization on a single ECMP path, causing congestion and waste of network > capacity. > > In IPv6, the 20-bit flow label field is also used as part of the ECMP hash. > In the lack of L4 data, the hashing will be on (src IP, dst IP, flow > label). Having a non-zero flow label is thus important for proper traffic > load balancing when L4 data is unavailable (i.e., when packets are > encapsulated). > > Currently, the seg6_do_srh_encap() function extracts the original packet's > flow label and set it as the outer IPv6 flow label. There are two issues > with this behaviour: > > a) There is no guarantee that the inner flow label is set by the source. > b) If the original packet is not IPv6, the flow label will be set to > zero (e.g., IPv4 or L2 encap). > > This patch adds a function, named seg6_make_flowlabel(), that computes a > flow label from a given skb. It supports IPv6, IPv4 and L2 payloads, and > leverages the per namespace 'seg6_flowlabel" sysctl value. > > The currently support behaviours are as follows: > -1 set flowlabel to zero. > 0 copy flowlabel from Inner paceket in case of Inner IPv6 > (Set flowlabel to 0 in case IPv4/L2) > 1 Compute the flowlabel using seg6_make_flowlabel() > > This patch has been tested for IPv6, IPv4, and L2 traffic. > > Signed-off-by: Ahmed Abdelsalam Applied. Please submit a patch which adds appropriate documentation for this new sysctl to Documentation/networking/ip-sysctl.txt Thank you.