From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: Paolo Abeni <pabeni@redhat.com>,
xuanzhuo@linux.alibaba.com, eperezma@redhat.com,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, virtualization@lists.linux.dev,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH net] virtio_net: fix alignment for virtio_net_hdr_v1_hash
Date: Thu, 30 Oct 2025 04:17:42 -0400 [thread overview]
Message-ID: <20251030041636-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <CACGkMEsTd6uCOCre8HK=5G14zu+xVOPOORZ2xcV_n9Kg6w8F5Q@mail.gmail.com>
On Thu, Oct 30, 2025 at 10:40:13AM +0800, Jason Wang wrote:
> On Wed, Oct 29, 2025 at 4:20 PM Paolo Abeni <pabeni@redhat.com> wrote:
> >
> > On 10/29/25 2:24 AM, Jason Wang wrote:
> > > From: "Michael S. Tsirkin" <mst@redhat.com>
> > >
> > > 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.
> > >
> > > This fixes the performance regression since
> > > commit ("virtio_net: enable gso over UDP tunnel support.") as it uses
> > > virtio_net_hdr_v1_hash_tunnel which embeds
> > > virtio_net_hdr_v1_hash. Pktgen in guest + XDP_DROP on TAP + vhost_net
> > > shows the TX PPS is recovered from 2.4Mpps to 4.45Mpps.
> > >
> > > Fixes: 56a06bd40fab ("virtio_net: enable gso over UDP tunnel support.")
> > > Cc: stable@vger.kernel.org
> > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > > Signed-off-by: Jason Wang <jasowang@redhat.com>
> >
> > Whoops, I replied to the older thread before reading this one.
> >
> > Acked-by: Paolo Abeni <pabeni@redhat.com>
>
> I apologize, build will be broken since
>
> commit b2284768c6b32aa224ca7d0ef0741beb434f03aa
> Author: Jason Wang <jasowang@redhat.com>
> Date: Wed Oct 22 11:44:21 2025 +0800
>
> virtio-net: zero unused hash fields
>
> I will prepare a new version.
>
> Btw, it looks like there's an uAPI change that may break builds of the
> userspace:
No, I think this has not been out long enough to matter.
QEMU imports linux headers extremely quickly but it can adapt.
> diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virtio_net.h
> index 8bf27ab8bcb4..1db45b01532b 100644
> --- a/include/uapi/linux/virtio_net.h
> +++ b/include/uapi/linux/virtio_net.h
> @@ -193,7 +193,8 @@ struct virtio_net_hdr_v1 {
>
> struct virtio_net_hdr_v1_hash {
> struct virtio_net_hdr_v1 hdr;
> - __le32 hash_value;
> + __le16 hash_value_lo;
> + __le16 hash_value_hi;
>
> We can have a kernel only version for this but it probably means we
> need a kernel only version for all the future extension of vnet
> header?
>
> Thanks
>
Let's not complicate things too much please.
--
MST
next prev parent reply other threads:[~2025-10-30 8:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-29 1:24 [PATCH net] virtio_net: fix alignment for virtio_net_hdr_v1_hash Jason Wang
2025-10-29 8:19 ` Paolo Abeni
2025-10-30 2:40 ` Jason Wang
2025-10-30 8:17 ` Michael S. Tsirkin [this message]
2025-10-29 12:49 ` kernel test robot
2025-10-29 15:35 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251030041636-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eperezma@redhat.com \
--cc=jasowang@redhat.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stable@vger.kernel.org \
--cc=virtualization@lists.linux.dev \
--cc=xuanzhuo@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.