[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87zfe7lxa4.fsf@toke.dk>
Date: Mon, 16 Jun 2025 13:51:31 +0200
From: Toke Høiland-Jørgensen <toke@...hat.com>
To: Daniel Borkmann <daniel@...earbox.net>, Stanislav Fomichev
<stfomichev@...il.com>, Jesper Dangaard Brouer <hawk@...nel.org>
Cc: bpf@...r.kernel.org, netdev@...r.kernel.org, Jakub Kicinski
<kuba@...nel.org>, lorenzo@...nel.org, Alexei Starovoitov
<ast@...nel.org>, Daniel Borkmann <borkmann@...earbox.net>, Eric Dumazet
<eric.dumazet@...il.com>, "David S. Miller" <davem@...emloft.net>, Paolo
Abeni <pabeni@...hat.com>, sdf@...ichev.me, kernel-team@...udflare.com,
arthur@...hurfabre.com, jakub@...udflare.com, Magnus Karlsson
<magnus.karlsson@...el.com>, Maciej Fijalkowski
<maciej.fijalkowski@...el.com>
Subject: Re: [PATCH bpf-next V1 7/7] net: xdp: update documentation for
xdp-rx-metadata.rst
Daniel Borkmann <daniel@...earbox.net> writes:
> On 6/10/25 10:12 PM, Toke Høiland-Jørgensen wrote:
>> Daniel Borkmann <daniel@...earbox.net> writes:
> [...]
>>> Also, have you thought about taking the opportunity to generalize the existing
>>> struct xsk_tx_metadata? It would be nice to actually use the same/similar struct
>>> for RX and TX, similarly as done in struct virtio_net_hdr. Such that we have
>>> XDP_{RX,TX}_METADATA and XDP_{RX,TX}MD_FLAGS_* to describe what meta data we
>>> have and from a developer PoV this will be a nicely consistent API in XDP. Then
>>> you could store at the right location in the meta data region just with
>>> bpf_xdp_metadata_* kfuncs (and/or plain BPF code) and finally set XDP_RX_METADATA
>>> indicator bit.
>>
>> Wouldn't this make the whole thing (effectively) UAPI?
>
> I'm not sure I follow, we already have this in place for the meta data
> region in AF_XDP, this would extend the scope to RX as well, so there
> would be a similar 'look and feel' in that sense it is already a
> developer API which is used.
Right, but with this series, the format of struct xdp_rx_meta is
internal kernel API that we can change whenever we want. Whereas
exposing it to AF_XDP would make it an UAPI contract, no? IIRC, the
whole point of using kfuncs to extract the metadata from the drivers was
to avoid defining a UAPI format. This does make things a bit more
cumbersome for AF_XDP, but if we are going to expose a struct format for
this we might as well get rid of the whole kfunc machinery just have the
drivers populate the struct before executing XDP?
Or am I misunderstanding what you're proposing?
-Toke
Powered by blists - more mailing lists