From: David Miller Subject: Re: [PATCH RFC net-next 1/4] ipv4: fib_rules: support match on sport, dport and ip proto Date: Tue, 13 Feb 2018 11:34:57 -0500 (EST) Message-ID: <20180213.113457.83852311966054935.davem@davemloft.net> References: <1518472499.3715.165.camel@gmail.com> <20180212.190328.237718184085028920.davem@davemloft.net> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: eric.dumazet@gmail.com, netdev@vger.kernel.org, dsa@cumulusnetworks.com, nikolay@cumulusnetworks.com To: roopa@cumulusnetworks.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:41506 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965078AbeBMQe7 (ORCPT ); Tue, 13 Feb 2018 11:34:59 -0500 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: From: Roopa Prabhu Date: Tue, 13 Feb 2018 08:19:35 -0800 > - Regardless of this series, I think we should optimize ip rules or > have a new implementation of policy based routing. happy to hear about > possible options here: > - optimize the existing implementation (have there been > previous discussions on possible options ?) > - @netdev2.2, I did outline a possible option for tc to > provide an l3 hook for policy based routing (people were ok with this > and I was told more tc hooks were in the works). > tc was a choice mainly because of all its existing match > options (flower for example). Will that help ? > - We should have an ebpf accelerated implementation > regardless for people to use it if they want to scale rules The problem is that arbitrary prefixing in the rules. That prevents O(1) algorithms from being used to maintain the table. If they were all just non-prefixed keys we could do a hash table or similar. I guess we could do a trie (on saddr) to a (on daddr) trie (like the ipv6 subtrees do), but that's a lot of complexity just for fib rules.