From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: [RFC v2 bpf-next 9/9] samples/bpf: Add examples of ipv4 and ipv6 forwarding in XDP Date: Wed, 2 May 2018 09:40:08 -0600 Message-ID: <73d3a185-2ac2-6f40-1708-f9dd6f0be4e8@gmail.com> References: <20180429180752.15428-1-dsahern@gmail.com> <20180429180752.15428-10-dsahern@gmail.com> <20180502131306.07c3acee@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, borkmann@iogearbox.net, ast@kernel.org, davem@davemloft.net, shm@cumulusnetworks.com, roopa@cumulusnetworks.com, toke@toke.dk, john.fastabend@gmail.com, Tariq Toukan To: Jesper Dangaard Brouer Return-path: Received: from mail-pf0-f179.google.com ([209.85.192.179]:46209 "EHLO mail-pf0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751959AbeEBPkL (ORCPT ); Wed, 2 May 2018 11:40:11 -0400 Received: by mail-pf0-f179.google.com with SMTP id p12so12098314pff.13 for ; Wed, 02 May 2018 08:40:11 -0700 (PDT) In-Reply-To: <20180502131306.07c3acee@redhat.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 5/2/18 5:13 AM, Jesper Dangaard Brouer wrote: > > On Sun, 29 Apr 2018 11:07:52 -0700 David Ahern wrote: > >> + /* verify egress index has xdp support */ >> + // TO-DO bpf_map_lookup_elem(&tx_port, &key) fails with >> + // cannot pass map_type 14 into func bpf_map_lookup_elem#1: > > I just want to point out that I/we are aware of this "usability" > problem with the sample program, but I don't want to block the FIB > helper going upstream, we can fix this problem later. > > The problem is that if you load this bpf/xdp prog, then all incoming > traffic (on that interface), will be forward using XDP, regardless > whether the egress ifindex support XDP or not. And if not supported, > then packets are dropped hard (only detectable via tracepoints). > > If the bpf prog could tell/know that the egress ifindex doesn't > support XDP xmit, then it could simply return XDP_PASS to fallback to > the normal network stack. > That's what the above lookup is intending but DEVMAP type does not handle lookups from xdp programs. Any chance of fixing that?