From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 844A3C43381 for ; Fri, 22 Feb 2019 09:07:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 440542077B for ; Fri, 22 Feb 2019 09:07:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=cogentembedded-com.20150623.gappssmtp.com header.i=@cogentembedded-com.20150623.gappssmtp.com header.b="OpdvYFAY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726601AbfBVJHM (ORCPT ); Fri, 22 Feb 2019 04:07:12 -0500 Received: from mail-lf1-f67.google.com ([209.85.167.67]:36304 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725855AbfBVJHM (ORCPT ); Fri, 22 Feb 2019 04:07:12 -0500 Received: by mail-lf1-f67.google.com with SMTP id q11so1174459lfd.3 for ; Fri, 22 Feb 2019 01:07:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=j8i6lgkJyYmqyTJ1y0AlwOb65ziDZAs8nH4rSBb7b+k=; b=OpdvYFAYkty+MgnHEZcW/u7IA/M4JrSc3IXuW9cECacSmjFi4Oddh4J1JjqJhJ7HwM LlmkaTWOmDefrX9YUjnqKqahAoyqS+6j9JYZC/V2G/eN6+woRfRViNoe7UresE0o0xC0 shz6XJrRo+8Er7MAnM7ivmGpRD/wcp/x/9+z0ltOgxnfcBUIU9yreyGcmbx3FGOrIfc8 fe2BTHdXFgk4x25dRMpKd7TF0risyf7aM7vgW6aC5Q47/QsZHnEwMLUiCHrlVe7eLOom ywfERPnHYYOAtH7qtBEyGS3GwndZSockMjr46v0B3bgtmx/XbyNgaJHARSwrSwk+lA0P hqiA== 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=j8i6lgkJyYmqyTJ1y0AlwOb65ziDZAs8nH4rSBb7b+k=; b=PY3HxQGTCoq4tU6U1hd6hUDUDY1uEuwvqgy60d8i3LWGPq6gsD096GF9N2n1WorCS/ 8thSj/ZGJln1YUqO8eE7lPu84cd24Q56ZXpCN9xzp9YA8Y4tD3GhN3azJthKn3ELeIGS 6t9t4kFCFqqnNdWQgVkapmzjkxG392ocwHtiGhvf5WaUXn0oeVGD/CAbJtGDcdtJsS4y nLh9G4Q9tgPkrGOpl6rrq3efjm3sfF1a6RRwEr7haQicGhMbWFbaLunv+U+Il0I2JQv0 0GbWYaXTJeBsjKaXTA8BYsahbfH7yLKje7h3qg+lMv2VYktmYZ5abmEQu42MENiQWvjW yeuA== X-Gm-Message-State: AHQUAuaH1EM3oWI8hJ5tG3V8Wgf01bv98JvGvEnAwg6gLX8cxmalrX62 kVjorCJTJus/9L01vY2cHu1owuQ7ED8= X-Google-Smtp-Source: AHgI3IY/VpIWQAsyyGfUBNvNnkVD+4xQRhv8ajtR3SDs84A/6yjTqXSxwwCRHOtk4zNJT8UTfh9dgg== X-Received: by 2002:ac2:4433:: with SMTP id w19mr1677042lfl.67.1550826429470; Fri, 22 Feb 2019 01:07:09 -0800 (PST) Received: from [192.168.0.199] ([31.173.83.188]) by smtp.gmail.com with ESMTPSA id q2sm395297lfa.63.2019.02.22.01.07.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Feb 2019 01:07:08 -0800 (PST) Subject: Re: [PATCH net-next] route: Add a new fib_multipath_hash_policy base on cpu id for tunnel packet To: wenxu@ucloud.cn, davem@davemloft.net Cc: netdev@vger.kernel.org References: <1550807549-22720-1-git-send-email-wenxu@ucloud.cn> From: Sergei Shtylyov Message-ID: <8feb69cd-bc86-a2fc-646d-0349275e1736@cogentembedded.com> Date: Fri, 22 Feb 2019 12:06:57 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <1550807549-22720-1-git-send-email-wenxu@ucloud.cn> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hello! On 22.02.2019 6:52, wenxu@ucloud.cn wrote: > From: wenxu > > Current fib_multipath_hash_policy can make hash based on the L3 or > L4. But it only work on the outer IP. So a specific tunnel always > has the same hash value. But a specific tunnel may contain so many > inner connection. However there is no good ways for tunnel packet. Connections? Way? > A specific tunnel route based on the percpu dst_cache, It will not > lookup route table each packet. For each packet? > This patch provide a based cpu id hash policy. The different > connection run on differnt cpu and There will differnet hash Different. Will be? > value for percpu dst_cache. > > Signed-off-by: wenxu > --- > net/ipv4/route.c | 6 ++++++ > net/ipv4/sysctl_net_ipv4.c | 2 +- > 2 files changed, 7 insertions(+), 1 deletion(-) > > diff --git a/net/ipv4/route.c b/net/ipv4/route.c > index ecc12a7..6cf2fd4 100644 > --- a/net/ipv4/route.c > +++ b/net/ipv4/route.c [...] > @@ -1834,6 +1835,8 @@ int fib_multipath_hash(const struct net *net, const struct flowi4 *fl4, > hash_keys.addrs.v4addrs.dst = fl4->daddr; > } > break; > + case 2: > + cpu = smp_processor_id() + 1; Should be a comment /* fall through */ if this fall thru isn't in error. > case 1: > /* skb is currently provided only when forwarding */ > if (skb) { [...] MBR, Sergei