From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [RFC v2 bpf-next 0/9] bpf: Add helper to do FIB lookups Date: Tue, 01 May 2018 10:20:36 -0400 (EDT) Message-ID: <20180501.102036.1322546431945930447.davem@davemloft.net> References: <20180429180752.15428-1-dsahern@gmail.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, borkmann@iogearbox.net, ast@kernel.org, shm@cumulusnetworks.com, roopa@cumulusnetworks.com, brouer@redhat.com, toke@toke.dk, john.fastabend@gmail.com To: dsahern@gmail.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:45268 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754630AbeEAOUk (ORCPT ); Tue, 1 May 2018 10:20:40 -0400 In-Reply-To: <20180429180752.15428-1-dsahern@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: From: David Ahern Date: Sun, 29 Apr 2018 11:07:43 -0700 > Provide a helper for doing a FIB and neighbor lookups in the kernel > tables from an XDP program. The helper provides a fastpath for forwarding > packets. If the packet is a local delivery or for any reason is not a > simple lookup and forward, the packet is expected to continue up the stack > for full processing. > > Patches 1-6 do some more refactoring to IPv6 with the end goal of > extracting a FIB lookup function that aligns with fib_lookup for IPv4, > basically returning a fib6_info without creating a dst based entry. > > Patch 7 adds lookup functions to the ipv6 stub. These are needed since > bpf is built into the kernel and ipv6 may not be built or loaded. > > Patch 8 adds the bpf helper and 9 adds a sample program. > > v2 > - fixed use of foward helper from cls_act as noted by Daniel > - in patch 1 rename fib6_lookup_1 as well for consistency I've reviewed this and generally I agree with the semantic choices wrt. resolution. We really can't do neigh resolution without an SKB, so at least in the xdp case we must push the packet up into the full stack path. I guess we could do the neigh resolve in the cls_bpf case, but I wonder how helpful that would be.