Re: [PATCH net] virtio-net: calculate header alignment mask based on features

From: Paolo Abeni

Date: Wed Oct 29 2025 - 04:18:52 EST


On 10/28/25 3:38 PM, Michael S. Tsirkin wrote:
> So how about just fixing the root cause then?
> Like this (untested, if you agree pls take over this):
>
> ---
>
> virtio_net: fix alignment for virtio_net_hdr_v1_hash
>
>
> changing alignment of header would mean it's no longer safe to cast a 2
> byte aligned pointer between formats. Use two 16 bit fields to make it 2
> byte aligned as previously.
>
> Signed-off-by: Michael S. Tsirkin <mst@xxxxxxxxxx>

FWIW, I like this solution. With the u16/u32 change, feel free to add:

Acked-by: Paolo Abeni <pabeni@xxxxxxxxxx>