[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFgPn1DyBxXscwtaL3gmFmEzrMmhJHkMHcYEoNVCiFUZxDm5vQ@mail.gmail.com>
Date: Mon, 27 Aug 2018 18:29:31 -0400
From: "Md. Islam" <mislam4@...t.edu>
To: Stephen Hemminger <stephen@...workplumber.org>
Cc: Netdev <netdev@...r.kernel.org>,
David Miller <davem@...emloft.net>,
David Ahern <dsahern@...il.com>,
Eric Dumazet <edumazet@...gle.com>,
Alexey Kuznetsov <kuznet@....inr.ac.ru>,
makita.toshiaki@....ntt.co.jp, panda@...go.wide.ad.jp,
yasuhiro.ohara@....com, john fastabend <john.fastabend@...il.com>,
alexei.starovoitov@...il.com
Subject: Re: [PATCH RFC net-next] net/fib: Poptrie based FIB lookup
On Mon, Aug 27, 2018 at 12:24 PM, Stephen Hemminger
<stephen@...workplumber.org> wrote:
> On Sun, 26 Aug 2018 22:28:48 -0400
> "Md. Islam" <mislam4@...t.edu> wrote:
>
>> This patch implements Poptrie [1] based FIB lookup. It exhibits pretty
>> impressive lookup performance compared to LC-trie. This poptrie
>> implementation however somewhat deviates from the original
>> implementation [2]. I tested this patch very rigorously with several
>> FIB tables containing half a million routes. I got same result as
>> LC-trie based fib_lookup().
>>
>> Poptrie is intended to work in conjunction with LC-trie (not replace
>> it). It is primarily designed to overcome many issues of TCAM based
>> router [1]. It [1] shows that the Poptrie can achieve very impressive
>> lookup performance on CPU. This patch will mainly be used by XDP
>> forwarding.
>>
>> 1. Asai, Hirochika, and Yasuhiro Ohara. "Poptrie: A compressed trie
>> with population count for fast and scalable software IP routing table
>> lookup." ACM SIGCOMM Computer Communication Review. 2015.
>>
>> 2. https://github.com/pixos/poptrie
>
>
> I am glad to see more research in to lookup speed. Here are some non-technical
> feedback. Looking deeper takes longer.
>
> The license in github version is not compatiable with GPL. If you based your
> code off that, you need to get approval from original copyright holder.
No, I developed it from scratch. It was not developed off the original
code. To make it consistent with the paper, I name few variables as in
the paper. But nothing has been taken from the copyrighted code.
Poptrie formation and lookup is also very different from the paper.
>
> The code is not formatted according to current kernel coding style.
> Please use checkpatch to see what the issues are.
>
> It is preferred that a function return a value, rather than being void
> and returing result by reference. Example:
I will fix those in next patches. I will also add a CONFIG option so
that it can be disable/enabled.
>
>> +
>> +/*We assume that pt->root is not NULL*/
>> +void poptrie_lookup(struct poptrie *pt, __be32 dest, struct net_device **dev)
>> +{
> ...
>
>> + *dev = get_fib(&pt->nhs, fib_index);
>> + return;
>> + }
>
> Why not?
pt->root will not be NULL when we call it XDP forwarding. Checking
this for every packet in a high speed router is redundant, I think.
Currently this function is being called during system startup, and
pt->root was NULL at that time. That's why I checked it before the
function is being called.
> static struct net_device *poptrie_lookup(struct poptrie *pt, __be32 dest)
>
> Also, as Dave mentioned any implementation needs to handle multiple namespaces
> and routing tables.
>
Currently it supports multiple routing tables. poptrie is an instance
of fib_table, Each fib_table has its poptrie. Supporting multiple
namespace wouldn't be difficult. Once the core functionality is
accepted added, those can be implemented incrementally.
> Could this alternative lookup be enabled via sysctl at runtime rather than kernel config?
Powered by blists - more mailing lists