All of lore.kernel.org
 help / color / mirror / Atom feed
* AF_XDP finding descriptor room for XDP-hints metadata size
@ 2021-08-18 11:54 Jesper Dangaard Brouer
  2021-08-18 12:50 ` Magnus Karlsson
  0 siblings, 1 reply; 2+ messages in thread
From: Jesper Dangaard Brouer @ 2021-08-18 11:54 UTC (permalink / raw)
  To: Karlsson, Magnus, Björn Töpel, Kishen Maloor, Desouza,
	Ederson, Alexander Lobakin
  Cc: brouer, xdp-hints, bpf, Netdev


In previous discussions with AF_XDP maintainers (Magnus+Bjørn), I 
understood we have two challenges with metadata and BTF id.

  (1) AF_XDP doesn't know size of metadata area.
  (2) No room in xdp_desc to store the BTF-id.

Below I propose new idea to solve (1) metadata size.

To follow the discussion this is struct xdp_desc:

  /* Rx/Tx descriptor */
  struct xdp_desc {
	__u64 addr;
	__u32 len;
	__u32 options;
  };

One option (that was rejected) was to store the BTF-id in 'options' and
deduct the metadata size from BTF-id, but it was rejected as it blocks
future usages of 'options'.

The proposal by Magnus was to use a single bit in 'options' to say this
descriptor contains metadata described via BTF info. And Bjørn proposed
to store the BTF-id as the last member in metadata, as it would be
accessible via minus-4 byte offset from packet start 'addr'. And again
via BTF-id code can know the size of metadata area.

My idea is that we could store the metadata size in top-bits of 'len'
member when we have set the 'options' bit for BTF-metadata.

-Jesper


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: AF_XDP finding descriptor room for XDP-hints metadata size
  2021-08-18 11:54 AF_XDP finding descriptor room for XDP-hints metadata size Jesper Dangaard Brouer
@ 2021-08-18 12:50 ` Magnus Karlsson
  0 siblings, 0 replies; 2+ messages in thread
From: Magnus Karlsson @ 2021-08-18 12:50 UTC (permalink / raw)
  To: Jesper Dangaard Brouer
  Cc: Karlsson, Magnus, Björn Töpel, Kishen Maloor, Desouza,
	Ederson, Alexander Lobakin, Jesper Dangaard Brouer, xdp-hints,
	bpf, Netdev

On Wed, Aug 18, 2021 at 1:55 PM Jesper Dangaard Brouer
<jbrouer@redhat.com> wrote:
>
>
> In previous discussions with AF_XDP maintainers (Magnus+Bjørn), I
> understood we have two challenges with metadata and BTF id.
>
>   (1) AF_XDP doesn't know size of metadata area.
>   (2) No room in xdp_desc to store the BTF-id.
>
> Below I propose new idea to solve (1) metadata size.
>
> To follow the discussion this is struct xdp_desc:
>
>   /* Rx/Tx descriptor */
>   struct xdp_desc {
>         __u64 addr;
>         __u32 len;
>         __u32 options;
>   };
>
> One option (that was rejected) was to store the BTF-id in 'options' and
> deduct the metadata size from BTF-id, but it was rejected as it blocks
> future usages of 'options'.
>
> The proposal by Magnus was to use a single bit in 'options' to say this
> descriptor contains metadata described via BTF info. And Bjørn proposed
> to store the BTF-id as the last member in metadata, as it would be
> accessible via minus-4 byte offset from packet start 'addr'. And again
> via BTF-id code can know the size of metadata area.

This is basically what Kishen had in his RFC.

> My idea is that we could store the metadata size in top-bits of 'len'
> member when we have set the 'options' bit for BTF-metadata.

What are the main advantages with this proposal compared to the former
one when we can get the length of the metadata section from the
BTF-id? When do we actually want to use the length of the metadata
section for something in user-space instead of just accessing the
members directly? Just trying to understand.

Thanks: Magnus

> -Jesper
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-18 12:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-18 11:54 AF_XDP finding descriptor room for XDP-hints metadata size Jesper Dangaard Brouer
2021-08-18 12:50 ` Magnus Karlsson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.