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=-4.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 4D769C43381 for ; Sat, 23 Feb 2019 09:15:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EB6BD206BA for ; Sat, 23 Feb 2019 09:15:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="PmIJHU3p" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725900AbfBWJO6 (ORCPT ); Sat, 23 Feb 2019 04:14:58 -0500 Received: from mail-eopbgr00043.outbound.protection.outlook.com ([40.107.0.43]:25104 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725859AbfBWJO5 (ORCPT ); Sat, 23 Feb 2019 04:14:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JDOBAStT2fpAwfNEMjUFWiNWL33i9yD2pM+2As2tADk=; b=PmIJHU3p1R35LAs6m1TU1YkDQZVXhoCmwW8uiKaizkMQCLuePd6q9+KYBNsj2k/paMctBOtLxv6CSqtsGZ3TZlqbGdU8vZQtgSKfflbfmznYCmu3suOB59TjAe0nOh5kNSOpeESA46dgiV85XOcF4pFTe5yOfc2xZgoPySDCYRI= Received: from AM6PR05MB5240.eurprd05.prod.outlook.com (20.177.196.214) by AM6PR05MB6325.eurprd05.prod.outlook.com (20.179.5.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1622.19; Sat, 23 Feb 2019 09:14:52 +0000 Received: from AM6PR05MB5240.eurprd05.prod.outlook.com ([fe80::3542:889c:3a85:3866]) by AM6PR05MB5240.eurprd05.prod.outlook.com ([fe80::3542:889c:3a85:3866%5]) with mapi id 15.20.1643.014; Sat, 23 Feb 2019 09:14:52 +0000 From: Ido Schimmel To: David Ahern CC: "wenxu@ucloud.cn" , "davem@davemloft.net" , "netdev@vger.kernel.org" Subject: Re: [PATCH net-next] route: Add a new fib_multipath_hash_policy base on cpu id for tunnel packet Thread-Topic: [PATCH net-next] route: Add a new fib_multipath_hash_policy base on cpu id for tunnel packet Thread-Index: AQHUyyahfFVCw82nKkS446HkaWdENqXtGiGA Date: Sat, 23 Feb 2019 09:14:52 +0000 Message-ID: <20190223091445.GA6394@splinter> References: <1550807549-22720-1-git-send-email-wenxu@ucloud.cn> <593cc423-c510-b67b-de43-be6cac662bc1@gmail.com> In-Reply-To: <593cc423-c510-b67b-de43-be6cac662bc1@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6PR0202CA0003.eurprd02.prod.outlook.com (2603:10a6:209:15::16) To AM6PR05MB5240.eurprd05.prod.outlook.com (2603:10a6:20b:64::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=idosch@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [79.176.7.115] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 794ffb4f-3ae1-43e7-a09f-08d6996f5e54 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020);SRVR:AM6PR05MB6325; x-ms-traffictypediagnostic: AM6PR05MB6325: x-ms-exchange-purlcount: 2 x-microsoft-exchange-diagnostics: =?us-ascii?Q?1;AM6PR05MB6325;23:RltAzfK3y2sFYUlNbfRuRXwhjdHk3vJBuY0m2i4Dy?= =?us-ascii?Q?bpFDrFmlGyli78+PP8nkrESL4+6tnvtAqBwIMa5zeUMqukixXnkL+VCWslZt?= =?us-ascii?Q?9Us2KsKjv2/MYec4XvHuxQTm4uhK+PQ2tccZ+hl2vEe1aVxPBexaZCxJUUk8?= =?us-ascii?Q?+sPQBHn5JCoEIg+9W3iD4ekPcz4kbe9Rvu/RUPdNEic943kQiX2ZJpEta0rg?= =?us-ascii?Q?ffJMlTeaFgAXSUjXQkJ49BCGcV9bLyuVzzUDsfC2iRgzacayfx2IXua/xGzp?= =?us-ascii?Q?64kI08VhVMoUV4DP5OVuJqqHr72+ANsTSE0+OZ+vHEGoGvU1opiAg+EpT74l?= =?us-ascii?Q?Lco6ySRzlyYDQEMXy8MBiW0ye1hxYtBRh/WubYMUVyEk+5QV4zHe9ASr025h?= =?us-ascii?Q?3GX28cn4BENdWXpesvBF39c6cRBUipT+Ty5DTgTP7F4o82pRX/I+3//kt8hU?= =?us-ascii?Q?vUCzfwsIFX8L4jT5hOZyQLgo+kiP9T9hiLC4B9IV2SHZYGnbVRl2xakkPNlB?= =?us-ascii?Q?aGn7LRvMBw9W5tE4nZlcSnNo9ZiiD4yOisFJW0U5NjX73dH9/lBmkJ48vhI5?= =?us-ascii?Q?RFXlE2hnluBto4AU+z+VZh4GEJFD2mgKKTIuEW0QKeUCzksNQzi3+bUcibOy?= =?us-ascii?Q?dfQBRz7mMhhSlxXTZAbN0nq22IJdEDg+CdoWqUXdFi9mvzG4MmTAQvCPZ6Qt?= =?us-ascii?Q?pHIg2eTLayKVi5lYL0XEn3cvGpc4OBTq233BdIGO/dHFmk3xxof/hA0Kv2YL?= =?us-ascii?Q?IxgWHq+o41OgWZ0h8BQBILLMkdaTnOE653X9J1pR8b/mNWbH1gB/ss03YI6X?= =?us-ascii?Q?3UxM97iYcTU8BXcb3YkrZxW/2j+48euXfJ0f/UReTNHeshgQlQtEGL1yUguF?= =?us-ascii?Q?Pw/mKBnfujg0suhyH3EMe3UwMNIwuDKXooVfYRHaGjkNcDrJWbNZdeEK79/Z?= =?us-ascii?Q?G8ewSw/wtj0eGSqH6d4alCKRDyS/ecJDbsP7sAnSUzaTqkueszhyWL9NjznY?= =?us-ascii?Q?R+OcOHSaZ+k0qolJN3vrLjA/GOPDpBNNXc9v3cKB7TsZKzSa6XoVXpVJL7cZ?= =?us-ascii?Q?b94JuhHvmdtYZbGANC/PZ5VkCnVH+nO2QgQB+ui//vZeF53VTwH2a1swUy5O?= =?us-ascii?Q?QMnUybwSCoWB5Kk3J1W64kq66SuPDgg91a/huwP1TZQn7GhqKH+rLHAQJ3nS?= =?us-ascii?Q?a8QFJmY92rRK0lOQVWqCUQUpGKy80AmoHuF4TcuFBOzPekw20VyZKCUkT9j5?= =?us-ascii?Q?BozT2hFsWN2kCGSWF3CQTytVHPZkWzjl9/wwXu/zgBY4rOaoATlKH91Z8ep5?= =?us-ascii?Q?jtSvz99OnxVQmA28gvXA7SHeQa5IzD8H9KwtnzgGHQa3P1U24Xzjog8J3PcT?= =?us-ascii?Q?hC1mQ=3D=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 0957AD37A0 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(7916004)(39860400002)(136003)(346002)(376002)(396003)(366004)(189003)(199004)(229853002)(486006)(8936002)(102836004)(14454004)(386003)(446003)(5660300002)(11346002)(478600001)(26005)(6486002)(1076003)(2906002)(966005)(6436002)(8676002)(81166006)(476003)(14444005)(256004)(53936002)(4326008)(81156014)(305945005)(186003)(25786009)(7736002)(68736007)(97736004)(6916009)(71200400001)(66066001)(86362001)(33656002)(6512007)(99286004)(9686003)(54906003)(6306002)(3846002)(106356001)(71190400001)(316002)(53546011)(6506007)(76176011)(33716001)(105586002)(1411001)(6246003)(52116002)(6116002);DIR:OUT;SFP:1101;SCL:1;SRVR:AM6PR05MB6325;H:AM6PR05MB5240.eurprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: hbsvOCyy+N9J66TmkkKEqi2DXCbldC9ydx5QjlLzC8qlpZJGxKmUxxx2yPUOj1j1n6J8iFzPdWCzyBL0KSum8k+VYEu7XZ20HbAwV1sCFQ2HWv495xIqQAsp9LdcIOMp/i4RUstv4nXQ2L3qrItt4XWGJBph2GiJBHslhiZSeSKvDArw6NknpiOYQf3DVQOox6tmSknSTRxlfiB6Wr89q5pIjpUFm7mMGJxeDPHAS+DBsg/E4SqAT3nrMMA88R3sCSPYFrs+ARY/TEXXKQbbWl9D4fd0RR4Mqyo+ENT9p8dtWvaDX5Rae2bw/FMBVCfIBwB/wAuTfTo6BmvfF0QXGphXv2zQ9VGTH05YpKghCKQPulroITOMNfzUmm6M1PVMEDDNnMVCm3b9NabramJthhGqFsoU2aUYVx37gZvzMFM= Content-Type: text/plain; charset="us-ascii" Content-ID: <5A4144AF95079546B6241FE566A5ECD1@eurprd05.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 794ffb4f-3ae1-43e7-a09f-08d6996f5e54 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Feb 2019 09:14:51.9936 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB6325 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, Feb 22, 2019 at 10:19:41PM -0500, David Ahern wrote: > On 2/21/19 10:52 PM, wenxu@ucloud.cn wrote: > > From: wenxu > >=20 > > 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. > >=20 > > 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. > >=20 > > Signed-off-by: wenxu > > --- > > net/ipv4/route.c | 6 ++++++ > > net/ipv4/sysctl_net_ipv4.c | 2 +- > > 2 files changed, 7 insertions(+), 1 deletion(-) > >=20 >=20 > This multipath hash policy is global - for all fib lookups, not just > tunnels. >=20 > 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. >=20 > 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. Did the author consider using a UDP-based tunnel like FOU? Then L4 mode should work just fine. I believe most hardware routers do not take inner headers into account either. https://lwn.net/Articles/614348/ https://people.netfilter.org/pablo/netdev0.1/papers/UDP-Encapsulation-in-Li= nux.pdf