Stanislav Fomichev <sdf@xxxxxxxxxx> writes: > On Wed, Dec 14, 2022 at 2:34 AM Toke Høiland-Jørgensen <toke@xxxxxxxxxx> wrote: >> >> Stanislav Fomichev <sdf@xxxxxxxxxx> writes: >> >> > On Tue, Dec 13, 2022 at 8:37 AM David Vernet <void@xxxxxxxxxxxxx> wrote: >> >> >> >> On Mon, Dec 12, 2022 at 06:35:51PM -0800, Stanislav Fomichev wrote: >> >> > Document all current use-cases and assumptions. >> >> > >> >> > Cc: John Fastabend <john.fastabend@xxxxxxxxx> >> >> > Cc: David Ahern <dsahern@xxxxxxxxx> >> >> > Cc: Martin KaFai Lau <martin.lau@xxxxxxxxx> >> >> > Cc: Jakub Kicinski <kuba@xxxxxxxxxx> >> >> > Cc: Willem de Bruijn <willemb@xxxxxxxxxx> >> >> > Cc: Jesper Dangaard Brouer <brouer@xxxxxxxxxx> >> >> > Cc: Anatoly Burakov <anatoly.burakov@xxxxxxxxx> >> >> > Cc: Alexander Lobakin <alexandr.lobakin@xxxxxxxxx> >> >> > Cc: Magnus Karlsson <magnus.karlsson@xxxxxxxxx> >> >> > Cc: Maryam Tahhan <mtahhan@xxxxxxxxxx> >> >> > Cc: xdp-hints@xxxxxxxxxxxxxxx >> >> > Cc: netdev@xxxxxxxxxxxxxxx >> >> > Signed-off-by: Stanislav Fomichev <sdf@xxxxxxxxxx> >> >> > --- >> >> > 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/Documentation/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 even >> >> better, maybe it's time to add an xdp/ subdirectory and put all docs >> >> 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.rst >> > and reference form Documentation/networking/index.rst? Since it's more >> > relevant to networking than the core bpf? >> > >> >> > @@ -0,0 +1,90 @@ >> >> > +=============== >> >> > +XDP RX Metadata >> >> > +=============== >> >> > + >> >> > +XDP programs support creating and passing custom metadata via >> >> > +``bpf_xdp_adjust_meta``. This metadata can be consumed by the following >> >> > +entities: >> >> >> >> Can you add a couple of sentences to this intro section that explains >> >> what metadata is at a high level? >> > >> > I'm gonna copy-paste here what I'm adding, feel free to reply back if >> > 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 information >> > 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 general >> 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 :) -Toke