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=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 B2516C2B9F8 for ; Tue, 25 May 2021 14:20:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 929F6613E1 for ; Tue, 25 May 2021 14:20:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233901AbhEYOWY (ORCPT ); Tue, 25 May 2021 10:22:24 -0400 Received: from mga17.intel.com ([192.55.52.151]:21725 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233401AbhEYOWV (ORCPT ); Tue, 25 May 2021 10:22:21 -0400 IronPort-SDR: KMRGm6+GbOz9S5ud2XrskwDHqHmbn9oAnk7iCFHp3ZFYXXcfLrx3EaNHPDmHQ4b8DOXtUJl3uo yhbJb5+QvF7w== X-IronPort-AV: E=McAfee;i="6200,9189,9995"; a="182526074" X-IronPort-AV: E=Sophos;i="5.82,328,1613462400"; d="scan'208";a="182526074" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 May 2021 07:20:49 -0700 IronPort-SDR: a/ucslzu/pf29G3EpehzGiPIQpcK/YqozMsNAoZ0ndRCxzJiJe0gADLezjcWQj+gflG9z8X2Gr 7RL6+ur7DfeQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,328,1613462400"; d="scan'208";a="546795089" Received: from irvmail001.ir.intel.com ([10.43.11.63]) by orsmga004.jf.intel.com with ESMTP; 25 May 2021 07:20:44 -0700 Received: from alobakin-mobl.ger.corp.intel.com (hskrzypc-MOBL.ger.corp.intel.com [10.213.6.192]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id 14PEKgAb015423; Tue, 25 May 2021 15:20:42 +0100 From: Alexander Lobakin To: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= , Saeed Mahameed Cc: Alexander Lobakin , Jesper Dangaard Brouer , "Raczynski, Piotr" , "Zhang, Jessica" , "Kubiak, Marcin" , "Joseph, Jithu" , "kurt@linutronix.de" , "Maloor, Kishen" , "Gomes, Vinicius" , "Brandeburg, Jesse" , "Swiatkowski, Michal" , "Plantykow, Marta A" , "Ong, Boon Leong" , "Desouza, Ederson" , "Song, Yoong Siang" , "Czapnik, Lukasz" , bpf@vger.kernel.org Subject: Re: AF_XDP metadata/hints Date: Tue, 25 May 2021 16:20:27 +0200 Message-Id: <20210525142027.1432-1-alexandr.lobakin@intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <87lf85zmuw.fsf@toke.dk> References: <20210507131034.5a62ce56@carbon> <20210510185029.1ca6f872@carbon> <20210512102546.5c098483@carbon> <7b347a985e590e2a422f837971b30bd83f9c7ac3.camel@nvidia.com> <20210521153110.207cb231@carbon> <1426b c91c6c6ee3aaf3d85c4291a12968634e521.camel@kernel.org> <87lf85zmuw.fsf@toke.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org From: Toke Høiland-Jørgensen Date: Sun, 23 May 2021 13:54:47 +0200 > Saeed Mahameed writes: > > > On Fri, 2021-05-21 at 15:31 +0200, Jesper Dangaard Brouer wrote: > >> On Fri, 21 May 2021 10:53:40 +0000 > >> "Lobakin, Alexandr" wrote: > >> > >> > I've opened two discussions at https://github.com/alobakin/linux, > >> > feel free to join them and/or create new ones to share your thoughts > >> > and concerns. > >> > >> Thanks Alexandr for keeping the thread/subject alive. > >> > >> I guess this is a new GitHub features "Discussions". I've never used > >> that in a project before, lets see how this goes. The usual approach > >> is discussions over email on netdev (Cc. netdev@vger.kernel.org). > > > > I agree we need full visibility and transparency, i actually recommend: > > bpf@vger.kernel.org > > +1, please keep this on the list :) Sure, let's keep it the classic way. I removed the netdev ML from the CCs and added bpf there. Regarding the comments from GitHub discussions: alobakin: > Since 5.11, it's now possible to obtain a BTF not only for vmlinux, > but also for modules. > This will eliminate a need for manually composing and registering a > BTF inside the driver code, which is 100+ locs for ice for example. > > That's obviously not the most straightforward and trivial way, but > could help a lot. saeedtx: > the point of registering BTF directly from the driver is to allow > "Flex metadata" meaning that meta data format can be constructed on > the fly according to user demand. > BTF for modules is constructed only at compilation time and > registered only on module load. so there is no way to implement flex > metadata with vmlinux BTF. we still need a dynamic registration API > for current and future HW where the HW will provide the BTF > dynamically. > > I am sure we can find mutliple ways to reduce the 100+ LOC, but the > goal is to have the dynamic btf_register/unregister API We initially planned to register just one (or several) predefined BTF(s) per module/netdevice that would provide a full list of supported fields. The flexibility of metadata then is in that BPF core calls for netdevice's ndo_bpf() on BPF program setup and provides a metadata layout requested by that BPF prog to the driver, so it could configure its hotpath (current NICs) or a hardware (future NICs) to build metadata accordingly. Driver can declare several BTFs (e.g. a "generic" one with things like hashes and csums one and a custom one) and it would work either through dynamic registering or through /sys approach. This is all discussable anyways, we're happy to hear different opinions and thoughts to collectively choose the optimal way. > -Toke Thanks, Al