On Thu, Jun 22, 2023 at 2:11 AM Jesper D. Brouer <netdev@xxxxxxxxxx> wrote: > > > This needs to be reviewed by AF_XDP maintainers Magnus and Bjørn (Cc) > > On 21/06/2023 19.02, Stanislav Fomichev wrote: > > For zerocopy mode, tx_desc->addr can point to the arbitrary offset > > and carry some TX metadata in the headroom. For copy mode, there > > is no way currently to populate skb metadata. > > > > Introduce new XDP_TX_METADATA_LEN that indicates how many bytes > > to treat as metadata. Metadata bytes come prior to tx_desc address > > (same as in RX case). > > From looking at the code, this introduces a socket option for this TX > metadata length (tx_metadata_len). > This implies the same fixed TX metadata size is used for all packets. > Maybe describe this in patch desc. I was planning to do a proper documentation page once we settle on all the details (similar to the one we have for rx). > What is the plan for dealing with cases that doesn't populate same/full > TX metadata size ? Do we need to support that? I was assuming that the TX layout would be fixed between the userspace and BPF. If every packet would have a different metadata length, it seems like a nightmare to parse?