On 05/10/2018 05:34 AM, David Ahern wrote: > Provide a helper for doing a FIB and neighbor lookup 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. > > The response from a FIB and neighbor lookup is either the egress index > with the bpf_fib_lookup struct filled in with dmac and gateway or > 0 meaning the packet should continue up the stack. In time we can > revisit this to return the FIB lookup result errno if it is one of the > special RTN_'s such as RTN_BLACKHOLE (-EINVAL) so that the XDP > programs can do an early drop if desired. > > 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. > > v3 > - remove ETH_ALEN and in6_addr from uapi header
Applied to bpf-next, thanks David!