> On May 7, 2025, at 8:18 PM, Jakub Kicinski <kuba@xxxxxxxxxx> wrote: > > 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 🤷️ Jespers suggestion to have a DOC: on this hopefully will be helpful. I’ll try my hand that that and see what sort of trouble I can get into