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: Thu, 5 Apr 2018 20:55:21 -0600 Message-ID: <5d30644d-f5c4-9901-2a7a-65f43343847e@gmail.com> References: <5395c7a0-2c1f-27f1-2490-dd4db68fbdc1@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, David Miller , Stephen Hemminger , Anton Gary Ceph , Pavel Emelyanov , Eric Dumazet , alexei.starovoitov@gmail.com, brouer@redhat.com To: "Md. Islam" Return-path: Received: from mail-pf0-f180.google.com ([209.85.192.180]:44898 "EHLO mail-pf0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751315AbeDFCzY (ORCPT ); Thu, 5 Apr 2018 22:55:24 -0400 Received: by mail-pf0-f180.google.com with SMTP id p15so380686pff.11 for ; Thu, 05 Apr 2018 19:55:24 -0700 (PDT) In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 4/3/18 9:15 PM, Md. Islam wrote: >> Have you looked at what I would consider a more interesting use case of >> packets into a node and delivered to a namespace via veth? >> >> +--------------------------+--------------- >> | Host | container >> | | >> | +-------{ veth1 }-|-{veth2}---- >> | | | >> +----{ eth1 }------------------ >> >> Can xdp / bpf on eth1 be used to speed up delivery to the container? > > I didn't consider that, but it sounds like an important use case. How > do we determine which namespace gets the packet? > FIB lookups of course. Starting with my patch set that handles forwarding on eth1, what is needed for XDP with veth? ie., a program on eth1 does the lookup and redirects the packet to veth1 for Tx. ndo_xdp_xmit for veth knows the packet needs to be forwarded to veth2 internally and there is no skb allocated for the packet yet.