From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BFA17C3A59C for ; Fri, 16 Aug 2019 16:20:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8C0E22133F for ; Fri, 16 Aug 2019 16:20:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=fomichev-me.20150623.gappssmtp.com header.i=@fomichev-me.20150623.gappssmtp.com header.b="dq+JJrDD" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726345AbfHPQUc (ORCPT ); Fri, 16 Aug 2019 12:20:32 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:34461 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726265AbfHPQUc (ORCPT ); Fri, 16 Aug 2019 12:20:32 -0400 Received: by mail-pg1-f194.google.com with SMTP id n9so3190539pgc.1 for ; Fri, 16 Aug 2019 09:20:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fomichev-me.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=Z+jwXCn4Nrf4ggKgpv88PtHdT/59MEwcFoA29WZ+sWM=; b=dq+JJrDDK/vTTtdT4WHD4v4RDL9h/yIunZwnbmuOuqunmGJdQyUzUsTj/lD/mZhylI 0Uqult2Bt5JSQ8EaQEl0bQaQsm2t2f/WXie0vLHISDR3AS696sifXQxIkqsPiOYfxt6T R7LMe8Wz5CRbsbcLqB09MGC3Bi1GbY6i6g9iDntWdhEKUpfdL2tZTKo+Nwyl2SCpBcCY ds7JZsTVICFO8Y1Yx6+Ejm3Q9uxVPZqKGRQJ91KQBaXnvn6wf11r8I02A/7piKe2KSPo iOLLHtC1eRnT/kKxXk2rViALmSR+4cCShj8sBO+lOeL2+U1JSLSCTVfsGqVEBaB88rNu xtNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=Z+jwXCn4Nrf4ggKgpv88PtHdT/59MEwcFoA29WZ+sWM=; b=pb0Gh98nLs897wSDW3AZZNelJenDUh2Q1lqD8AY4oVuDpi4aDy9WljU1T3J9aXgmZZ kii/4+qwD3R6fcbOqlwaDh7GDIABV2khOPmVvh1D8gWorwYpozH00UjpKeEZV3DSJXqX jpR+Keq9tW+rQA0D9brZcZZM/M2JAl8iRt+HoQwPCozI6wb6rGlaoOR/Fob+Z2bK0TNp V/c4Wi7Q3gCixPnS5zSwnQwzus6PP+la0HxEzmtAMdbWHsikU5jIqeYC9ITp6U5WRrJP 8FZdEi9FH8YdsiElukrT800x6rzmwAhofpKTFU9KEUclKMl42ikaCKZXaSAD/XVSJeeO kvdg== X-Gm-Message-State: APjAAAUVft8WtZGuHWNqjHfaOBRaE0qTN+z8NYetNMgZ6nfe7P0oT3eM HP6/eAGQYinMyUsXSl7aIZy7NQ== X-Google-Smtp-Source: APXvYqy7xbf0oeZMLxRIKCMpxiZxJiFL+gKjY3snNZxR195IKv4ZDKrh4MMrMH5ydsuFGEAgnd3WNA== X-Received: by 2002:a63:ff0c:: with SMTP id k12mr8156108pgi.186.1565972431208; Fri, 16 Aug 2019 09:20:31 -0700 (PDT) Received: from localhost ([2601:646:8f00:18d9:d0fa:7a4b:764f:de48]) by smtp.gmail.com with ESMTPSA id o11sm7318906pfh.114.2019.08.16.09.20.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Aug 2019 09:20:30 -0700 (PDT) Date: Fri, 16 Aug 2019 09:20:29 -0700 From: Stanislav Fomichev To: Jakub Kicinski Cc: Toshiaki Makita , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , "David S. Miller" , Jesper Dangaard Brouer , John Fastabend , Jamal Hadi Salim , Cong Wang , Jiri Pirko , netdev@vger.kernel.org, bpf@vger.kernel.org, William Tu Subject: Re: [RFC PATCH bpf-next 00/14] xdp_flow: Flow offload to XDP Message-ID: <20190816162029.GR2820@mini-arch> References: <20190813120558.6151-1-toshiaki.makita1@gmail.com> <20190814170715.GJ2820@mini-arch> <14c4a876-6f5d-4750-cbe4-19622f64975b@gmail.com> <20190815152100.GN2820@mini-arch> <20190815122232.4b1fa01c@cakuba.netronome.com> <20190816155911.GP2820@mini-arch> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190816155911.GP2820@mini-arch> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On 08/16, Stanislav Fomichev wrote: > On 08/15, Jakub Kicinski wrote: > > On Thu, 15 Aug 2019 08:21:00 -0700, Stanislav Fomichev wrote: > > > On 08/15, Toshiaki Makita wrote: > > > > On 2019/08/15 2:07, Stanislav Fomichev wrote: > > > > > On 08/13, Toshiaki Makita wrote: > > > > > > * Implementation > > > > > > > > > > > > xdp_flow makes use of UMH to load an eBPF program for XDP, similar to > > > > > > bpfilter. The difference is that xdp_flow does not generate the eBPF > > > > > > program dynamically but a prebuilt program is embedded in UMH. This is > > > > > > mainly because flow insertion is considerably frequent. If we generate > > > > > > and load an eBPF program on each insertion of a flow, the latency of the > > > > > > first packet of ping in above test will incease, which I want to avoid. > > > > > Can this be instead implemented with a new hook that will be called > > > > > for TC events? This hook can write to perf event buffer and control > > > > > plane will insert/remove/modify flow tables in the BPF maps (contol > > > > > plane will also install xdp program). > > > > > > > > > > Why do we need UMH? What am I missing? > > > > > > > > So you suggest doing everything in xdp_flow kmod? > > > You probably don't even need xdp_flow kmod. Add new tc "offload" mode > > > (bypass) that dumps every command via netlink (or calls the BPF hook > > > where you can dump it into perf event buffer) and then read that info > > > from userspace and install xdp programs and modify flow tables. > > > I don't think you need any kernel changes besides that stream > > > of data from the kernel about qdisc/tc flow creation/removal/etc. > > > > There's a certain allure in bringing the in-kernel BPF translation > > infrastructure forward. OTOH from system architecture perspective IMHO > > it does seem like a task best handed in user space. bpfilter can replace > > iptables completely, here we're looking at an acceleration relatively > > loosely coupled with flower. > Even for bpfilter I would've solved it using something similar: > iptables bypass + redirect iptables netlink requests to some > userspace helper that was registered to be iptables compatibility > manager. And then, again, it becomes a purely userspace problem. Oh, wait, isn't iptables kernel api is setsockopt/getsockopt? With the new cgroup hooks you can now try to do bpfilter completely in BPF 🤯 > The issue with UMH is that the helper has to be statically compiled > from the kernel tree, which means we can't bring in any dependencies > (stuff like libkefir you mentioned below). > > But I digress :-) > > > FWIW Quentin spent some time working on a universal flow rule to BPF > > translation library: > > > > https://github.com/Netronome/libkefir > > > > A lot remains to be done there, but flower front end is one of the > > targets. A library can be tuned for any application, without a > > dependency on flower uAPI. > > > > > But, I haven't looked at the series deeply, so I might be missing > > > something :-) > > > > I don't think you are :)