[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aAkW--LAm5L2oNNn@mini-arch>
Date: Wed, 23 Apr 2025 09:36:11 -0700
From: Stanislav Fomichev <stfomichev@...il.com>
To: Arthur Fabre <arthur@...hurfabre.com>
Cc: netdev@...r.kernel.org, bpf@...r.kernel.org, jakub@...udflare.com,
hawk@...nel.org, yan@...udflare.com, jbrandeburg@...udflare.com,
thoiland@...hat.com, lbiancon@...hat.com, ast@...nel.org,
kuba@...nel.org, edumazet@...gle.com
Subject: Re: [PATCH RFC bpf-next v2 10/17] bnxt: Propagate trait presence to
skb
On 04/22, Arthur Fabre wrote:
> Call the common xdp_buff_update_skb() helper.
>
> Signed-off-by: Arthur Fabre <arthur@...hurfabre.com>
> ---
> drivers/net/ethernet/broadcom/bnxt/bnxt.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> index c8e3468eee612ad622bfbecfd7cc1ae3396061fd..0eba3e307a3edbc5fe1abf2fa45e6256d98574c2 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> @@ -2297,6 +2297,10 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
> }
> }
> }
> +
> + if (xdp_active)
> + xdp_buff_update_skb(&xdp, skb);
For me, the preference for reusing existing metadata area was
because of the patches 10-16: we now need to care about two types of
metadata explicitly.
If you insist on placing it into the headroom, can we at least have some
common helper to finish xdp->skb conversion? It can call skb_ext_from_headroom
and/or skb_metadata_set:
xdp_buff_done(*xdp, *skb) {
if (have traits) {
skb_ext_from_headroom
return
}
metasize = xdp->data - xdp->data_meta;
if (metasize)
skb_metadata_set
}
And then we'll have some common rules for the drivers: call xdp_buff_done
when you're done with the xdp_buff to take care of metadata/traits. And
it might be easier to review: you're gonna (mostly) change existing
calls to skb_metadata_set to your new helper. Maybe we can even
eventually fold all xdp_update_skb_shared_info stuff into that as
well...
Powered by blists - more mailing lists