Re: [PATCH net-next v1 03/11] xdp: Copy buffers with restricted lifetime
From: Björn Töpel
Date: Sun Nov 15 2026 - 14:02:38 EST
netdev-bot+sashiko@xxxxxxxxxx writes:
[...]
> With XDP_FLAGS_EXT the head chunk no longer holds the shared info at
> all. Does anything still keep data_end below xdp_data_hard_end() for
> these buffers? If not, len alone can run past skb->end, since
> __skb_put() does not check.
Yes. fbnic's MAX_HDR leaves the same tailroom, and bpf_xdp_adjust_tail()
stops at xdp_data_hard_end().
> Should the destination size be derived from the copy instead of
> xdp->frame_sz? For example: headroom + LARGEST_ALIGN(len) +
> SKB_DATA_ALIGN(sizeof(struct skb_shared_info)). Or should this path
> copy exactly len bytes?
Yes, but that's pre-existing. XSK buffers without XDP_USE_SG have no
tailroom at all, so it's worse there. It's the head sizing from
Clement's thread [1]. A fix that sizes the head by its contents and
copies exact lengths goes to net, and v2 sits on top of it.
[...]
> Could xdp_build_skb_from_zc() compute the metadata size the way
> xdp_copy_buff_to_frame() does? That means treating unsupported
> metadata as zero length and copying from xdp->data.
Yes. Nothing hits it today, as fbnic marks the metadata valid, but this
patch makes it a generic path. Will fix.
pw-bot: cr
Björn
[1] https://lore.kernel.org/bpf/20260629072300.1664622-1-clecigne@xxxxxxxxxx/