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=-3.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS, URIBL_BLOCKED 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 65F32C43381 for ; Sat, 23 Feb 2019 03:19:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 34425206B7 for ; Sat, 23 Feb 2019 03:19:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="W0IxKl3u" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727661AbfBWDTp (ORCPT ); Fri, 22 Feb 2019 22:19:45 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:35686 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726693AbfBWDTp (ORCPT ); Fri, 22 Feb 2019 22:19:45 -0500 Received: by mail-pf1-f194.google.com with SMTP id j5so1959726pfa.2 for ; Fri, 22 Feb 2019 19:19:44 -0800 (PST) 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=RI0YRSQYYOgo5AFbblztI0Mpx+2qJ1QZoCq6IHVdYHI=; b=W0IxKl3uxEcr3LKTBpS/P21FxHnzJWNklZ6lERf89mwchOMCqgwx9sZxZFlA2h5sRx bQ+haiVmuUk5dWUf7gjMYn+qwMEy+QtgAL59thMx1EDe+7z9Gj/Eh53fZdyVrRgQgNpU o2AoCtDZXtlV2BHUuTvw5offeRoBh05AcaOijk3QMo8St9Hywktu59UoJmCJvDaIRukj uEM6sCal+o3OzFqJVKKIfGY9O+hDTPzxcxZ+7DTNwu7kc5OZG7MmCT0jbQ6SmVU+N2Tg ENtxYAdkfC6Rgd6ri6bw2bzSfrXDE2K3uqO6OmNFqAzcl00+fNRpDhVE52o/C/kFJm6J Hw/g== 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=RI0YRSQYYOgo5AFbblztI0Mpx+2qJ1QZoCq6IHVdYHI=; b=ufQKNlIFJd3dPZrD0jgZFbeJ49jMD4W+qYjcEPbo7dR4L2QSo4c7J1LN5W8IPc0brT 3hniQI4+9lzG7Rtw7wCqm9veLwLde8veuRJn79NseTtzuMRFNTMgDVIXyFmBUyqw5V8A 3EuTPf/3vLBPXD+lKEBJVn3z4HRak3HJ45NjgYp3MNwhL7009x739NfJvFWnZ8+aAYY/ BtW/6kF3F6OP89M1RS6pZa47bT2myg6opWxsdH0BSQelR+97vY4ObcfwN5PtxkRkXBb7 cTeFDvcAK1DC+8VzJJPNrkywKnAb2DM4aV4U7cWezraku/29aLlNZdv3kBO8rnJ6I4eB OKCQ== X-Gm-Message-State: AHQUAuaGEy1IauiADUipxoh/Ab/79m91OfHAEaQrNuR9b+qiY2hsGiwh Blky3H9eEOvU1iIXLBmDkM4= X-Google-Smtp-Source: AHgI3IZg1QvaRSKUKM8NJ9/6PFCndYpFrW5b5rmA37HwRPpEuKgJttbytKWwrG4C54hWFUq6gJUkmA== X-Received: by 2002:a63:5b43:: with SMTP id l3mr7034448pgm.298.1550891984535; Fri, 22 Feb 2019 19:19:44 -0800 (PST) Received: from [172.27.227.138] ([216.129.126.118]) by smtp.googlemail.com with ESMTPSA id g80sm5437311pfd.72.2019.02.22.19.19.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Feb 2019 19:19:43 -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, Ido Schimmel References: <1550807549-22720-1-git-send-email-wenxu@ucloud.cn> From: David Ahern Message-ID: <593cc423-c510-b67b-de43-be6cac662bc1@gmail.com> Date: Fri, 22 Feb 2019 22:19:41 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1550807549-22720-1-git-send-email-wenxu@ucloud.cn> Content-Type: text/plain; charset=utf-8 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 On 2/21/19 10:52 PM, 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. > A specific tunnel route based on the percpu dst_cache, It will not > lookup route table each packet. > > This patch provide a based cpu id hash policy. The different > connection run on differnt cpu and There will differnet hash > 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(-) > This multipath hash policy is global - for all fib lookups, not just tunnels. The suggestion by Nik is worth exploring - an option to add the mark to the hash (e.g., L3 header + mark) which makes this more generic. If the policy options are changed, the call to call_netevent_notifiers needs to be updated to handle a failure. For example, the mlxsw handler needs to be able to veto an option it does not support.