From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jesper Dangaard Brouer Subject: Re: [RFC v2 bpf-next 9/9] samples/bpf: Add examples of ipv4 and ipv6 forwarding in XDP Date: Wed, 2 May 2018 13:13:06 +0200 Message-ID: <20180502131306.07c3acee@redhat.com> References: <20180429180752.15428-1-dsahern@gmail.com> <20180429180752.15428-10-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, davem@davemloft.net, shm@cumulusnetworks.com, roopa@cumulusnetworks.com, toke@toke.dk, john.fastabend@gmail.com, brouer@redhat.com, Tariq Toukan To: David Ahern Return-path: Received: from mx3-rdu2.redhat.com ([66.187.233.73]:60414 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751181AbeEBLNN (ORCPT ); Wed, 2 May 2018 07:13:13 -0400 In-Reply-To: <20180429180752.15428-10-dsahern@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: 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. -- Best regards, Jesper Dangaard Brouer MSc.CS, Principal Kernel Engineer at Red Hat LinkedIn: http://www.linkedin.com/in/brouer