From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-d.ads.isi.edu ([128.9.180.199]:62502 "EHLO mail-d.ads.isi.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728512AbgAMPZd (ORCPT ); Mon, 13 Jan 2020 10:25:33 -0500 Date: Mon, 13 Jan 2020 10:25:30 -0500 From: Ryan Goodfellow Subject: Re: zero-copy between interfaces Message-ID: <20200113152530.GC68570@smtp.ads.isi.edu> References: <14f9e1bf5c3a41dbaec53f83cb5f0564@isi.edu> <87k15vwsax.fsf@toke.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87k15vwsax.fsf@toke.dk> Sender: xdp-newbies-owner@vger.kernel.org List-ID: To: Toke =?iso-8859-1?Q?H=F8iland-J=F8rgensen?= Cc: Magnus Karlsson , "xdp-newbies@vger.kernel.org" On Mon, Jan 13, 2020 at 11:43:02AM +0100, Toke Høiland-Jørgensen wrote: >> Magnus Karlsson writes: >>> On Mon, Jan 13, 2020 at 1:28 AM Ryan Goodfellow wrote: >>> The reason for wanting large memory maps is that our use case for XDP is network >>> emulation - and sometimes that means introducing delay factors that can require >>> a rather large in-memory packet buffers. >>> >>> If there is interest in including this program in the official BPF samples I'm happy to >>> submit a patch. Any comments on the program are also much appreciated. >> >> More examples are always useful, but the question is if it should >> reside in samples or outside the kernel in some other repo? Is there >> some good place in xdp-project github that could be used for this >> purpose? > > We could certainly create something; either a new xdp-samples > repository, or an example-programs/ subdir of the xdp-tutorial? Which of > those makes the most sense depends on the size of the program I think... > > -Toke > I'm happy to provide patches or pull-requests in either case. The userspace program is 1 file with 555 lines and the BPF program is 28 lines. I've tested the userspace program with the 5.5 kernel. The BPF program requires clang-9 to work properly (due to BTF features IIRC). - https://gitlab.com/mergetb/tech/network-emulation/kernel/blob/v5.5-moa/samples/bpf/xdpsock_multidev.c - https://gitlab.com/mergetb/tech/network-emulation/kernel/blob/v5.5-moa/samples/bpf/xdpsock_multidev_kern.c The primary usefulness of this program relative to what's out there is that it pushes packets between interfaces using a common memory map. -- ~ ry