From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by mail.toke.dk (Postfix) with ESMTPS id 4BC309CFE87 for ; Thu, 15 Dec 2022 04:48:50 +0100 (CET) Authentication-Results: mail.toke.dk; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20210112 header.b=eRBFc6BB Received: by mail-pj1-x1033.google.com with SMTP id q17-20020a17090aa01100b002194cba32e9so1444057pjp.1 for ; Wed, 14 Dec 2022 19:48:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=gnul5VTYkXHwvriv1EmZ2nafdK1nNjiRNk+R2S7uLwM=; b=eRBFc6BBcLOCzgCHzVu9OnZWJ8XlA0RAc5MeDxVw72AKGn5a16GakmCaJ4Z0Wnqq8a +J8p7I7DDhBSOayHF6WvoIzx3GurPq0kB9VFhSZHEdKo0AA9nqqFwEij+f7Rc1vFkTPU hW5JOd6WlWmEZejNbhLJJYkTqrTzDx3YNiZTC3w6/UrPzVXmTQ0L9LcEpF2qU6paTDh6 carWK0clTbd3JokToT7vlT3BxuJbV4k/euuBCxL1VUcmdcFBQK/7o252c2u4PPPf5LZE PWYD5DNWRur+y5ANlELfWTgM/OBDS59D5iTV0bLIISebcTLnYTu4LYaNWEQVeuxfzaKB UPYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gnul5VTYkXHwvriv1EmZ2nafdK1nNjiRNk+R2S7uLwM=; b=xw2kZyiSuJfEkjQk2qhwSZiLnm1m8h/tBXBV5oXAXGMfF9c3kOKKlub4iEjJBjCq/f YwhQO5rpF3Kr4hDoGyhNXydNNC/g/2qwhbYH3AlD/vmdJa2qXpCfh8WI9VBhfBSVeY9F UYaeMulIBraL9gPXDZjAMPLZ5681cYda6UO4g3YZ31HsuoOJGQzhqAUcqrcKNHImFT5P oZJKFDeOcJ+ZghMEw4JqkAfURSFRbwqiPGg0rSKYFBP8Gn+Jyre/B8+yqQilVqOfb/wP CUKzbt+LkYBN1rhUBwDkvGDfrmE2L4CjZXXtsgHtcYYcTNtdtRXIBj3+8YCfSR+mop2C H7yQ== X-Gm-Message-State: AFqh2kqUmrQ7Xo0NrSHUSS0DNr+JQO5rV+uFFj0/KchIyrbRXWz4xlC9 /s2PhDXjjfFa1uAyoXWIb+RjKsbMMRPwu+L/zvlTTA== X-Google-Smtp-Source: AMrXdXuYpZipRrMYFz4Y87dPivngY2R/EOxE9yCQKMxVPVGXMKJA8g/l4JIZYdBVRK0yh2vY2wfFmmGLx69pgAeECcs= X-Received: by 2002:a17:90a:6090:b0:218:9107:381b with SMTP id z16-20020a17090a609000b002189107381bmr62020pji.75.1671076128610; Wed, 14 Dec 2022 19:48:48 -0800 (PST) MIME-Version: 1.0 References: <20221213023605.737383-1-sdf@google.com> <20221213023605.737383-2-sdf@google.com> <87fsdigtow.fsf@toke.dk> <87r0x1eegg.fsf@toke.dk> In-Reply-To: <87r0x1eegg.fsf@toke.dk> From: Stanislav Fomichev Date: Wed, 14 Dec 2022 19:48:36 -0800 Message-ID: To: =?UTF-8?B?VG9rZSBIw7hpbGFuZC1Kw7hyZ2Vuc2Vu?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: WQH5UE62FTZLT6UKNMNHRM3OONL7RXWC X-Message-ID-Hash: WQH5UE62FTZLT6UKNMNHRM3OONL7RXWC X-MailFrom: sdf@google.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: David Vernet , bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, martin.lau@linux.dev, song@kernel.org, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, haoluo@google.com, jolsa@kernel.org, David Ahern , Jakub Kicinski , Willem de Bruijn , Jesper Dangaard Brouer , Anatoly Burakov , Alexander Lobakin , Magnus Karlsson , Maryam Tahhan , xdp-hints@xdp-project.net, netdev@vger.kernel.org X-Mailman-Version: 3.3.7 Precedence: list Subject: [xdp-hints] Re: [PATCH bpf-next v4 01/15] bpf: Document XDP RX metadata List-Id: XDP hardware hints design discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Wed, Dec 14, 2022 at 3:46 PM Toke H=C3=B8iland-J=C3=B8rgensen wrote: > > Stanislav Fomichev writes: > > > On Wed, Dec 14, 2022 at 2:34 AM Toke H=C3=B8iland-J=C3=B8rgensen wrote: > >> > >> Stanislav Fomichev writes: > >> > >> > On Tue, Dec 13, 2022 at 8:37 AM David Vernet wr= ote: > >> >> > >> >> On Mon, Dec 12, 2022 at 06:35:51PM -0800, Stanislav Fomichev wrote: > >> >> > Document all current use-cases and assumptions. > >> >> > > >> >> > Cc: John Fastabend > >> >> > Cc: David Ahern > >> >> > Cc: Martin KaFai Lau > >> >> > Cc: Jakub Kicinski > >> >> > Cc: Willem de Bruijn > >> >> > Cc: Jesper Dangaard Brouer > >> >> > Cc: Anatoly Burakov > >> >> > Cc: Alexander Lobakin > >> >> > Cc: Magnus Karlsson > >> >> > Cc: Maryam Tahhan > >> >> > Cc: xdp-hints@xdp-project.net > >> >> > Cc: netdev@vger.kernel.org > >> >> > Signed-off-by: Stanislav Fomichev > >> >> > --- > >> >> > Documentation/bpf/xdp-rx-metadata.rst | 90 +++++++++++++++++++++= ++++++ > >> >> > 1 file changed, 90 insertions(+) > >> >> > create mode 100644 Documentation/bpf/xdp-rx-metadata.rst > >> >> > > >> >> > diff --git a/Documentation/bpf/xdp-rx-metadata.rst b/Documentatio= n/bpf/xdp-rx-metadata.rst > >> >> > new file mode 100644 > >> >> > index 000000000000..498eae718275 > >> >> > --- /dev/null > >> >> > +++ b/Documentation/bpf/xdp-rx-metadata.rst > >> >> > >> >> I think you need to add this to Documentation/bpf/index.rst. Or eve= n > >> >> better, maybe it's time to add an xdp/ subdirectory and put all doc= s > >> >> there? Don't want to block your patchset from bikeshedding on this > >> >> point, so for now it's fine to just put it in > >> >> Documentation/bpf/index.rst until we figure that out. > >> > > >> > Maybe let's put it under Documentation/networking/xdp-rx-metadata.rs= t > >> > and reference form Documentation/networking/index.rst? Since it's mo= re > >> > relevant to networking than the core bpf? > >> > > >> >> > @@ -0,0 +1,90 @@ > >> >> > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > >> >> > +XDP RX Metadata > >> >> > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > >> >> > + > >> >> > +XDP programs support creating and passing custom metadata via > >> >> > +``bpf_xdp_adjust_meta``. This metadata can be consumed by the fo= llowing > >> >> > +entities: > >> >> > >> >> Can you add a couple of sentences to this intro section that explai= ns > >> >> what metadata is at a high level? > >> > > >> > I'm gonna copy-paste here what I'm adding, feel free to reply back i= f > >> > still unclear. (so we don't have to wait another week to discuss the > >> > changes) > >> > > >> > XDP programs support creating and passing custom metadata via > >> > ``bpf_xdp_adjust_meta``. The metadata can contain some extra informa= tion > >> > about the packet: timestamps, hash, vlan and tunneling information, = etc. > >> > This metadata can be consumed by the following entities: > >> > >> This is not really accurate, though? The metadata area itself can > >> contain whatever the XDP program wants it to, and I think you're > >> conflating the "old" usage for arbitrary storage with the driver-kfunc > >> metadata support. > >> > >> I think we should clear separate the two: the metadata area is just a > >> place to store data (and is not consumed by the stack, except that > >> TC-BPF programs can access it), and the driver kfuncs are just a gener= al > >> way to get data out of the drivers (and has nothing to do with the > >> metadata area, you can just get the data into stack variables). > >> > >> While it would be good to have a documentation of the general metadata > >> area stuff somewhere, I don't think it necessarily have to be part of > >> this series, so maybe just stick to documenting the kfuncs? > > > > Maybe I can reword to something like below? > > > > The metadata can be used to store some extra information about the > > packet timestamps, hash, vlan and tunneling information, etc. > > > > This way we are not actually defining what it is, but hinting about > > how it's commonly used? > > Sent another reply to the original patch with some comments that are > hopefully a bit more constructive :) Thanks, everything makes sense, will incorporate. I'll also try to share the patches privately with you sometime tomorrow maybe; not super comfortable sending them out with a bunch of changes on top of your authorship without some kind of ack from you :-) > -Toke >