On Wed, 7 May 2025 22:58:33 +0200 Jesper Dangaard Brouer wrote: > > There is a neat hint from Lorenzo’s change in bpf.h for bpf_xdp_get_buff_len() > > that talks about both linear and paged length. Also, xdp_buff_flags’s > > XDP_FLAGS_HAS_FRAGS says non-linear xdp buff. > > > > Taking those hints, what about: > > xdp_linear_len() == xdp->data_end - xdp->data > > xdp_paged_len() == sinfo->xdp_frags_size > > xdp_get_buff_len() == xdp_linear_len() + xdp_paged_len() > > I like xdp_linear_len() as it is descriptive/clear. FWIW I don't feel strongly but my very weak preference would be not to merge this. I already know I'll be looking at the definitions every time. Is it obvious to everyone in this thread whether "headroom" includes the metadata length? It's not obvious to me. But the patch seems quite popular so 🤷️