Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1010858imm; Thu, 4 Oct 2018 06:58:26 -0700 (PDT) X-Google-Smtp-Source: ACcGV62zXYTRT4otot22WEculLyPCZMz1+AkB/j1dMNMwOZ9K+ne1/3BTH9dofOeveRlZNSO2I7A X-Received: by 2002:a63:5ec5:: with SMTP id s188-v6mr5905623pgb.126.1538661506177; Thu, 04 Oct 2018 06:58:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538661506; cv=none; d=google.com; s=arc-20160816; b=kDpsyLO8uyTggu4eOx1A6fYi7Dt1QZlNlUTW8TQaZDU11H5A+YQhRNFDZr7uncFz2G /FPtLhpp/6SIon9NkSMt4Jlw/1Fwo64gABiJYrcOWYTCdFttYqQjKcImTXfDKABl+XbN tmzmWyoM4kD2zna+/sADYOMF4Me3eOPWxCVLFxZ+OritrjOtWNBOIgBBODk9rVgih+gj OI4VlaMEdut7uQtO/7v7buK+vrjuklnBr20Reag3BhLS8dukWKDHF05MXj8YRrMyplO+ 5fS/v4jtMHj7Y3U/RhtnLSCNyqwfo5hL8wXXB8kaXXv5+puscfj9iZu2D1XOF3IAZJ/i y2CA== 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:user-agent:message-id:date:subject:cc:to :from; bh=4tkNhC6JSxpw2pJf2O21VQk6bf6k6uMgHEfBdgPGqd8=; b=tLx4R/9nMslt9suq9SG+T8jnzhrErEKurY7vzx29GLVrpmNeTnDSr721n3OLzNXe7o vutF5uCsceevIrLFNxdCnqjwYLQJjjx0RgFs6+ZkszZ2vmhromEdaMhhqg4cMhN//3+S ID3AW59XQB+rOjDFPhIOS9hTAARvN1+YsGxpis/wCTnFpk1h23sDmUHfqKv67yPXlpS3 ePXVqrzq/it1GyJnXs0IsA8JnjduwZPHQ49FSVf/CzepyYx3qah3YJwRvgMEIIk/4fHs e+ffcBgBW04961lWPE0R2XbWjpbqB+IgdXpFRfWm0yn3q2vncGryfCXXKW0okB/F+a1I Qz/A== 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 y67-v6si5166939pfa.47.2018.10.04.06.58.10; Thu, 04 Oct 2018 06:58:26 -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 S1727535AbeJDUvT convert rfc822-to-8bit (ORCPT + 99 others); Thu, 4 Oct 2018 16:51:19 -0400 Received: from mailin.studentenwerk.mhn.de ([141.84.225.229]:43500 "EHLO email.studentenwerk.mhn.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727354AbeJDUvT (ORCPT ); Thu, 4 Oct 2018 16:51:19 -0400 Received: from mailhub.studentenwerk.mhn.de (mailhub.studentenwerk.mhn.de [127.0.0.1]) by email.studentenwerk.mhn.de (Postfix) with ESMTP id 42Qvbh5BgdzMkyt; Thu, 4 Oct 2018 15:57:52 +0200 (CEST) From: Wolfgang Walter To: Florian Westphal Cc: Steffen Klassert , David Miller , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, christophe.gouault@6wind.com Subject: Re: Regression: kernel 4.14 an later very slow with many ipsec tunnels Date: Thu, 04 Oct 2018 15:57:52 +0200 Message-ID: <1729915.dWWxddREcQ@stwm.de> User-Agent: KMail/4.14.3 (Linux/4.14.61-debian64.all+1.1; KDE/4.14.13; x86_64; ; ) In-Reply-To: <20181002213536.sgjansduqenps2md@breakpoint.cc> References: <20180913135844.3ut6fxgx67t6ndtu@breakpoint.cc> <4327972.7bla238zOs@stwm.de> <20181002213536.sgjansduqenps2md@breakpoint.cc> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="iso-8859-1" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Dienstag, 2. Oktober 2018, 23:35:36 schrieb Florian Westphal: > Wolfgang Walter wrote: > > Am Dienstag, 2. Oktober 2018, 16:56:16 schrieb Florian Westphal: > > > I'm experimenting with per-dst inexact lists in an rbtree but > > > this will take time. > > > > Hmm, I doubt that this is worth the effort. And certainly not that easy > > Well, I'm not going to send a revert of the flowcache removal. > > I'm willing to experiment with alternatives to a full iteration of the > inexact list but thats it. If this brings performance back to pre-removal, I'm fine with that. I'm even fine if it is slower by a factor of 2. I think it is a serious regression, and there is no workaround, and therefor it cannot stay like that. So I still hope that reverting is an option if no acceptable solution can be found. > > > correctly done, as it still would have to obey the original order of the > > rules (their priority). > > Except that neither the priority or the order in which it was added > matters in case the selector doesn't match. To match a packet one has to find all matching rules and chose that one with the lowest priority. "indexing" by dst will not help much if you have a ruleset where a lot of rules sharing a dst. You also have to replicate rules with dsts that have a prefix oft another dst as they may habe a higher priority even if they are less specific. Every such entry may again have such an "indexing" by dst. Only then this would be efficient. > > I see no reason why we can't have inexact lists done per dst<->src pairs. > > > You may have a lot of rules of the form say > > > > 10.0.0.0/16 <=> 10.1.0.0/29 encrypt .... > > 10.0.0.0/16 <=> 10.1.0.8/29 encrypt .... > <=> means (in the forwarding case) that the rule set contains the inverted rule (at least if you use it in usually ways). So 10.0.0.0/16 <=> 10.1.0.0/29 encrypt .... means 10.0.0.0/16 => 10.1.0.0/29 10.1.0.0/29 => 10.0.0.0/16 > Sure. > > > Also, you get something like that > > > > 10.0.1.0/24 <=> 10.0.2.0/29 allow > > 10.0.0.0/16 <=> 10.0.2.0/24 encrypt > > 0.0.0.0 <=> 10.0.2.0/16 block > > > > And people may use source port and/or destination port or protocol > > (tcp/udp/imcp) to further tailor there ruleset. > > Yes. 0.0.0.0/0 handling will require some extra consideration. > There may also be rulesets like 10.0.1.0/24 => 10.1.0.0/29 encrypt X 10.0.0.0/16 => 10.1.0.0/29 encrypt Y Or 10.0.0.0/16 * => 10.1.0.0/24 80 encrypt Y 10.0.1.0/24 * => 10.1.0.0/17 * encrypt X 10.0.0.0/16 * => 10.1.0.0/20 * encrypt Z > So far I have not seen a show-stopper however. I wonder why there is no such thing for netfilter or the rules list in routing. nf does not have such a thing, either. This is the reason why I think that this is not that easy and for longterm kernel 4.14 the best solution will be a revert anyway. Regards, -- Wolfgang Walter Studentenwerk M?nchen Anstalt des ?ffentlichen Rechts