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: Mon, 2 Apr 2018 12:09:44 -0600 Message-ID: <2ac3c590-8f13-b983-7efb-021f82ee3295@gmail.com> References: <7cfca503-3e17-6287-8888-92d43ce7a2e7@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit To: John Fastabend , "Md. Islam" , netdev@vger.kernel.org, David Miller , stephen@networkplumber.org, agaceph@gmail.com, Pavel Emelyanov , Eric Dumazet , alexei.starovoitov@gmail.com, brouer@redhat.com Return-path: Received: from mail-pl0-f42.google.com ([209.85.160.42]:38127 "EHLO mail-pl0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753177AbeDBSJr (ORCPT ); Mon, 2 Apr 2018 14:09:47 -0400 Received: by mail-pl0-f42.google.com with SMTP id k6-v6so5163pls.5 for ; Mon, 02 Apr 2018 11:09:46 -0700 (PDT) In-Reply-To: <7cfca503-3e17-6287-8888-92d43ce7a2e7@gmail.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: 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 And Jesper has done some measurements showing a 400% improvement in throughput. I have not had time to come back to the xdp forwarding set. It needs to handle vlan devices at a minimum before I send an RFC.