From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Borkmann Subject: Re: [PATCH bpf-next v2 1/1] bpf, lpm: make longest_prefix_match() faster Date: Thu, 22 Nov 2018 11:10:06 +0100 Message-ID: References: <20181122053952.18244-1-edumazet@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: netdev , Eric Dumazet , Vlad Dumitrescu To: Eric Dumazet , Alexei Starovoitov Return-path: Received: from www62.your-server.de ([213.133.104.62]:57554 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393869AbeKVUs5 (ORCPT ); Thu, 22 Nov 2018 15:48:57 -0500 In-Reply-To: <20181122053952.18244-1-edumazet@google.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 11/22/2018 06:39 AM, Eric Dumazet wrote: > At LPC 2018 in Vancouver, Vlad Dumitrescu mentioned that longest_prefix_match() > has a high cost [1]. > > One reason for that cost is a loop handling one byte at a time. > > We can handle more bytes at a time, if enough attention is paid > to endianness. > > I was able to remove ~55 % of longest_prefix_match() cpu costs. > > [1] https://linuxplumbersconf.org/event/2/contributions/88/attachments/76/87/lpc-bpf-2018-shaping.pdf > > Signed-off-by: Eric Dumazet > Cc: Vlad Dumitrescu > Cc: Alexei Starovoitov > Cc: Daniel Borkmann Looks good, applied to bpf-next, thanks!