Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4311293ybf; Wed, 4 Mar 2020 01:19:41 -0800 (PST) X-Google-Smtp-Source: ADFU+vuS2x5pkMtMXZGW6MNuZabxbnLfwcasnRY47oRMDuLMZv59n2Kziu7dcqyFx6X1p9sEPFfC X-Received: by 2002:a9d:4c87:: with SMTP id m7mr1541013otf.303.1583313581424; Wed, 04 Mar 2020 01:19:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583313581; cv=none; d=google.com; s=arc-20160816; b=mOqa9R/mBy3Wks1VNl+RRbCJKNApQ4anT2FmNzCKdox6Bt1hfqDOJo4WWRdUOkuGCY 40r/3TsXF99ueEAjqzUcLsZs5nkzPMDjyn7GwpM0gr0Mc7JFC40hc8722Vwlsqes5l2f ZmhpzCssLabzoCD8c6mprlvH5MRjSTZi/Nx2VknsKWI2YQMfN/3N/7jdremA7JmngIiB NKg3W6F43gsiT9acKvfAt1LAIzFeMT+lZmW5a2POwRNfOtwjekZkGY/iNZd0yAKCA019 HiTJjfR9amEV6/MiY9QodqBEZeldPXievQr3gJqzrihPkIMl57mQS5BJtlOuQVF7gI3y 0GRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=FI5hMv/arl4qoCeh1Zs40mfxO3eHqAJDiq6mor5YF9w=; b=uZjR2zcuSwDrv683pyNymS7p9fG7mOJUSLIq40gT+B+K1MM7stHSDFoJPOmd8GperF Pk+MIP/LQPUn3gK6hL8wYuMpt+mJC0t24wg0mdT82zdSPir00mg6pRzLExq3r9zm/Y4W vYYP1qOMVD8dcDKTe00uya+eiluh5euhe2thDWSmKk9cEif7tChxmAhv5TXcR6E38688 0gHJjQiC8zPLPOxIt4tg3iRS4es4HXWiM5RgUVunOKo28dPsLbpcqOu93eAk8qwfc8P+ EiM+hGHgclydA5HBbCO0kkLyZ5UNd8n+RuQdMN+W6cG7wvohhdrKK795BKJ+A+P1aJMy CJdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eS32pJK1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e24si755336otq.14.2020.03.04.01.19.28; Wed, 04 Mar 2020 01:19:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eS32pJK1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387644AbgCDJTO (ORCPT + 99 others); Wed, 4 Mar 2020 04:19:14 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:26621 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728744AbgCDJTN (ORCPT ); Wed, 4 Mar 2020 04:19:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583313552; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FI5hMv/arl4qoCeh1Zs40mfxO3eHqAJDiq6mor5YF9w=; b=eS32pJK1Ef6kM9MYhZVDfjzO5BBI7ijWG/5LFq9jhd6IMKN1Ne7yc4cS7Y3h1eg2jyEb3j IAl+VrBgMm/A7e3Q4nuOFwT1zG51hT5fosdBpiSp8e7hi0mF+o6ivTZ/MF0xZL97VxKHVi 2x+RgSz6l90C3csST5VkIy6Gomts9+g= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-79-g8imVRMWMAy_rwQX3efAQg-1; Wed, 04 Mar 2020 04:19:08 -0500 X-MC-Unique: g8imVRMWMAy_rwQX3efAQg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 650CF1005514; Wed, 4 Mar 2020 09:19:06 +0000 (UTC) Received: from carbon (ovpn-200-19.brq.redhat.com [10.40.200.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 985709CA3; Wed, 4 Mar 2020 09:18:56 +0000 (UTC) Date: Wed, 4 Mar 2020 10:18:53 +0100 From: Jesper Dangaard Brouer To: Willem de Bruijn Cc: brouer@redhat.com, Jakub Kicinski , Daniel Borkmann , Luigi Rizzo , Network Development , Toke =?UTF-8?B?SMO4aWxhbmQtSsO4cmdl?= =?UTF-8?B?bnNlbg==?= , David Miller , Alexander Duyck , "Jubran, Samih" , linux-kernel , Alexei Starovoitov , bpf Subject: Re: [PATCH v4] netdev attribute to control xdpgeneric skb linearization Message-ID: <20200304101853.760034dc@carbon> In-Reply-To: References: <20200228105435.75298-1-lrizzo@google.com> <20200228110043.2771fddb@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <3c27d9c0-eb17-b20f-2d10-01f3bdf8c0d6@iogearbox.net> <20200303125020.2baef01b@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 3 Mar 2020 16:10:14 -0500 Willem de Bruijn wrote: > On Tue, Mar 3, 2020 at 3:50 PM Jakub Kicinski wrote: > > > > On Tue, 3 Mar 2020 20:46:55 +0100 Daniel Borkmann wrote: > > > Thus, when the data/data_end test fails in generic XDP, the user can > > > call e.g. bpf_xdp_pull_data(xdp, 64) to make sure we pull in as much as > > > is needed w/o full linearization and once done the data/data_end can be > > > repeated to proceed. Native XDP will leave xdp->rxq->skb as NULL, but > > > later we could perhaps reuse the same bpf_xdp_pull_data() helper for > > > native with skb-less backing. Thoughts? > > Something akin to pskb_may_pull sounds like a great solution to me. > > Another approach would be a new xdp_action XDP_NEED_LINEARIZED that > causes the program to be restarted after linearization. But that is both > more expensive and less elegant. > > Instead of a sysctl or device option, is this an optimization that > could be taken based on the program? Specifically, would XDP_FLAGS be > a path to pass a SUPPORT_SG flag along with the program? I'm not > entirely familiar with the XDP setup code, so this may be a totally > off. But from a quick read it seems like generic_xdp_install could > transfer such a flag to struct net_device. > > > I'm curious why we consider a xdpgeneric-only addition. Is attaching > > a cls_bpf program noticeably slower than xdpgeneric? > > This just should not be xdp*generic* only, but allow us to use any XDP > with large MTU sizes and without having to disable GRO. This is an important point: "should not be xdp*generic* only". I really want to see this work for XDP-native *first*, and it seems that with Daniel's idea, it can can also work for XDP-generic. As Jakub also hinted, it seems strange that people are trying to implement this for XDP-generic, as I don't think there is any performance advantage over cls_bpf. We really want this to work from XDP-native. > I'd still like a way to be able to drop or modify packets before GRO, > or to signal that a type of packet should skip GRO. That is a use-case, that we should remember to support. Samih (cc'ed) is working on adding multi-frame support[1] to XDP-native. Given the huge interest this thread shows, I think I will dedicate some of my time to help him out on the actual coding. For my idea to work[1], we first have storage space for the multi-buffer references, and I propose we use the skb_shared_info area, that is available anyhow for XDP_PASS that calls build_skb(). Thus, we first need to standardize across all XDP drivers, how and where this memory area is referenced/offset. [1] https://github.com/xdp-project/xdp-project/blob/master/areas/core/xdp-multi-buffer01-design.org [2] https://github.com/xdp-project/xdp-project/blob/master/areas/core/xdp-multi-buffer01-design.org#storage-space-for-multi-buffer-referencessegments -- Best regards, Jesper Dangaard Brouer MSc.CS, Principal Kernel Engineer at Red Hat LinkedIn: http://www.linkedin.com/in/brouer