From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: [PATCH v15 ] net/veth/XDP: Line-rate packet forwarding in kernel Date: Tue, 3 Apr 2018 09:07:14 -0600 Message-ID: <9cb8a162-3b6a-abfa-4f6e-524995bbfb8d@gmail.com> References: <7cfca503-3e17-6287-8888-92d43ce7a2e7@gmail.com> <2ac3c590-8f13-b983-7efb-021f82ee3295@gmail.com> <20180402181602.jpdb25ytmffg2gei@ast-mbp.dhcp.thefacebook.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: John Fastabend , "Md. Islam" , netdev@vger.kernel.org, David Miller , stephen@networkplumber.org, agaceph@gmail.com, Pavel Emelyanov , Eric Dumazet , brouer@redhat.com To: Alexei Starovoitov Return-path: Received: from mail-pl0-f52.google.com ([209.85.160.52]:38285 "EHLO mail-pl0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751432AbeDCPHR (ORCPT ); Tue, 3 Apr 2018 11:07:17 -0400 Received: by mail-pl0-f52.google.com with SMTP id k6-v6so4081821pls.5 for ; Tue, 03 Apr 2018 08:07:17 -0700 (PDT) In-Reply-To: <20180402181602.jpdb25ytmffg2gei@ast-mbp.dhcp.thefacebook.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 4/2/18 12:16 PM, Alexei Starovoitov wrote: > On Mon, Apr 02, 2018 at 12:09:44PM -0600, David Ahern wrote: >> On 4/2/18 12:03 PM, John Fastabend wrote: >>> >>> Can the above be a normal BPF helper that returns an >>> ifindex? Then something roughly like this patter would >>> work for all drivers with redirect support, >>> >>> >>> route_ifindex = ip_route_lookup(__daddr, ....) >>> if (!route_ifindex) >>> return do_foo() >>> return xdp_redirect(route_ifindex); >>> >>> So my suggestion is, >>> >>> 1. enable veth xdp (including redirect support) >>> 2. add a helper to lookup route from routing table >>> >>> Alternatively you can skip step (2) and encode the routing >>> table in BPF directly. Maybe we need a more efficient data >>> structure but that should also work. >>> >> >> That's what I have here: >> >> https://github.com/dsahern/linux/commit/bab42f158c0925339f7519df7fb2cde8eac33aa8 > > was wondering what's up with the delay and when are you going to > submit them officially... > The use case came up several times. > I need to find time to come back to that set. As I recall there a number of outstanding issues: 1. you and Daniel had comments about the bpf_func_proto declarations 2. Jesper had concerns about xdp redirect to any netdev. e.g., How does the lookup know the egress netdev supports xdp? Right now you can try and the packet is dropped if it is not supported. 3. VLAN devices. I suspect these will affect the final bpf function prototype. It would awkward to have 1 forwarding API for non-vlan devices and a second for vlan devices, hence the need to resolve this before it goes in. 4. What about other stacked devices - bonds and bridges - will those just work with the bpf helper? VRF is already handled of course. ;-)