On Wed, 12 Jul 2023 12:42:35 -0700 Alexei Starovoitov wrote: > > Basically, add to AF_XDP what we already have for its predecessor > > AF_PACKET: setsockopt PACKET_VNET_HDR? > > > > Possibly with a separate new struct, rather than virtio_net_hdr. As > > that has dependencies on other drivers, notably virtio and its > > specification process. > > yeah. Forgot about this one. > That's a perfect fit. I would reuse virtio_net_hdr as-is. > Why reinvent the wheel? > It would force uapi, but some might argue it's a good thing. I was gonna reply on the other leg of the thread but it sounds like we're in agreement now? 👏️ virtio_net_hdr is the kind of generic descriptor I had in mind. I'd suggest breaking hdr_len into L2len, L3len and L4len, tho. How does virtio do IP length updates during TSO if it doesn't know where L3 starts? HW will want to know, and it's easy to add them together in cases where it doesn't. Which is why I kept saying "packet geometry" rather than pointing at virtio_net_hdr.