Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1440528imm; Sun, 2 Sep 2018 23:58:09 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYXsiLJtc5MFBx++hNTJ812oQLSHz6kWsw01HnYqS5+qJRjWV072uSZGZF6dC/pbMgxVoxg X-Received: by 2002:a62:c9:: with SMTP id 192-v6mr27564654pfa.99.1535957889859; Sun, 02 Sep 2018 23:58:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535957889; cv=none; d=google.com; s=arc-20160816; b=lvHfPHcCS59F9FPlqUCiRGeW4Ot2SOL4mZmfCyrNH3RUSEty0UmaH+KLo+UrWCOnul qEpjRPb6j+uwqhAEVNBdHUjX3m87T4kz1jiu8fbpEdY6CMQkpS5CzSQ/CQeWjZN2zPo2 fbSgXRA+6dvpMv+orGZWQR6wumgwaypufQyZx1JpLgWHWfq+8nr5NMC1t2Vq+G1BDraK Rcs9v7hDuLTCW2bT30T5reELblC5k7vnE5rsh0Pr4wN78y6t557OQmOHpE9m7R8KmPLo JrqqeYaNB7d1HKA9JinAZLGD8JVuusHHhod6HVV8kxll5LNrUwSlX3uUAUJHSI0NfWxm sTaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=6W4k7TFfMFlq5cxf0OE77rB4xEo27ihDIyZhLyu7Cps=; b=tgZsv9smvCUW1xv+Mnn5R2gLwlq0wCEQ/1CFQo/TQnvjXAkcS0dbrFxmEHRCCY6wNs IShOFIwNIQq7YRbjYn+kWgSkszFfJElicDZQndB8DJrzdDjFKy7a0w6WiWlU2w3Gck0x J0frJ/64FgJ6Ss2YAhnH5u1Ieo5FlIQDnzSXx3UJbptBMbaHwGxgQCOd8MiJVeucDq/T KK7sgBADxo1Q6r+EPsFbeslQPg6XMQ6efALLBUazkdl6vV+E2DRwDCmfeKGZenyy545a 2xTisHf1yR2Sj9H51E84TPffmUAfMt9K2Vy4FWb+U+M1SG0nqmraacji79jGcjph9Au2 pGdQ== 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 t80-v6si18958307pfk.228.2018.09.02.23.57.55; Sun, 02 Sep 2018 23:58:09 -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 S1726205AbeICLPi (ORCPT + 99 others); Mon, 3 Sep 2018 07:15:38 -0400 Received: from a.mx.secunet.com ([62.96.220.36]:56870 "EHLO a.mx.secunet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725927AbeICLPi (ORCPT ); Mon, 3 Sep 2018 07:15:38 -0400 Received: from localhost (localhost [127.0.0.1]) by a.mx.secunet.com (Postfix) with ESMTP id D4FB5201D1; Mon, 3 Sep 2018 10:56:33 +0200 (CEST) X-Virus-Scanned: by secunet Received: from a.mx.secunet.com ([127.0.0.1]) by localhost (a.mx.secunet.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iIZfhvaKbaaW; Mon, 3 Sep 2018 10:56:33 +0200 (CEST) Received: from mail-essen-02.secunet.de (mail-essen-02.secunet.de [10.53.40.205]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a.mx.secunet.com (Postfix) with ESMTPS id 86B272008A; Mon, 3 Sep 2018 10:56:33 +0200 (CEST) Received: from gauss2.secunet.de (10.182.7.193) by mail-essen-02.secunet.de (10.53.40.205) with Microsoft SMTP Server id 14.3.408.0; Mon, 3 Sep 2018 08:56:50 +0200 Received: by gauss2.secunet.de (Postfix, from userid 1000) id 8852D31817E3; Mon, 3 Sep 2018 08:56:50 +0200 (CEST) Date: Mon, 3 Sep 2018 08:56:50 +0200 From: Steffen Klassert To: Yannick Brosseau CC: , , , , Subject: Re: [PATCH v2] Optimize lookup of /0 xfrm policies Message-ID: <20180903065650.GL23674@gauss3.secunet.de> References: <20180831221838.25597-1-scientist@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20180831221838.25597-1-scientist@fb.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-G-Data-MailSecurity-for-Exchange-State: 0 X-G-Data-MailSecurity-for-Exchange-Error: 0 X-G-Data-MailSecurity-for-Exchange-Sender: 23 X-G-Data-MailSecurity-for-Exchange-Server: cbe3d3f7-b9e3-4256-b890-f24c4306a01c X-EXCLAIMER-MD-CONFIG: 2c86f778-e09b-4440-8b15-867914633a10 X-G-Data-MailSecurity-for-Exchange-Guid: 38DEC598-276C-407F-AD67-B0C3F01165CF Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 31, 2018 at 06:18:38PM -0400, Yannick Brosseau wrote: > Currently, all the xfrm policies that are not /32 end up in > the inexact policies linked list which take a long time to lookup. It is possible to configure which policies are going to the hashtable and the inexact list. You can do: ip x p set hthresh4 0 0 This sets the hash threshold to local /0 and remote /0 netmasks. With this configuration, all policies should go to the hashtable. To view the configuration: ip -s -s x p count Can you please do your tests with this too? I'd really like to avoid to add new code to the policy lookup if we can get similar results with this configuration option.