From: Jason Wang <jasowang@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: "Xuan Zhuo" <xuanzhuo@linux.alibaba.com>,
netdev@vger.kernel.org, "Eugenio Pérez" <eperezma@redhat.com>,
"Andrew Lunn" <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Heng Qi" <hengqi@linux.alibaba.com>,
"Willem de Bruijn" <willemb@google.com>,
"Jiri Pirko" <jiri@resnulli.us>,
"Alvaro Karsz" <alvaro.karsz@solid-run.com>,
virtualization@lists.linux.dev
Subject: Re: [PATCH net v4 3/4] virtio-net: correct hdr_len handling for VIRTIO_NET_F_GUEST_HDRLEN
Date: Tue, 11 Nov 2025 08:45:34 +0800 [thread overview]
Message-ID: <CACGkMEs9qwGfnmTR2zCS09QZpKG5OnpCJ19BUtL6AkAW3L-9eg@mail.gmail.com> (raw)
In-Reply-To: <20251110110751-mutt-send-email-mst@kernel.org>
On Tue, Nov 11, 2025 at 12:10 AM Michael S. Tsirkin <mst@redhat.com> wrote:
>
> On Mon, Nov 10, 2025 at 03:39:50PM +0800, Jason Wang wrote:
> > On Mon, Nov 10, 2025 at 3:27 PM Michael S. Tsirkin <mst@redhat.com> wrote:
> > >
> > > On Mon, Nov 10, 2025 at 03:16:08PM +0800, Jason Wang wrote:
> > > > On Mon, Nov 10, 2025 at 5:41 AM Michael S. Tsirkin <mst@redhat.com> wrote:
> > > > >
> > > > > On Thu, Oct 30, 2025 at 10:53:01AM +0800, Jason Wang wrote:
> > > > > > On Wed, Oct 29, 2025 at 11:09 AM Xuan Zhuo <xuanzhuo@linux.alibaba.com> wrote:
> > > > > > >
> > > > > > > The commit be50da3e9d4a ("net: virtio_net: implement exact header length
> > > > > > > guest feature") introduces support for the VIRTIO_NET_F_GUEST_HDRLEN
> > > > > > > feature in virtio-net.
> > > > > > >
> > > > > > > This feature requires virtio-net to set hdr_len to the actual header
> > > > > > > length of the packet when transmitting, the number of
> > > > > > > bytes from the start of the packet to the beginning of the
> > > > > > > transport-layer payload.
> > > > > > >
> > > > > > > However, in practice, hdr_len was being set using skb_headlen(skb),
> > > > > > > which is clearly incorrect. This commit fixes that issue.
> > > > > >
> > > > > > I still think it would be more safe to check the feature
> > > > >
> > > > > which feature VIRTIO_NET_F_GUEST_HDRLEN ?
> > > > >
> > > >
> > > > Yes.
> > > >
> > > > Thanks
> > >
> > > Seems more conservative for sure, though an extra mode to maintain isn't
> > > great. Hmm?
> >
> > Considering it's not a lot of code, it might be worth it to reduce the risk.
> >
> > But I'm fine if you think we can go with this patch.
> >
> > Thanks
>
> hard to say what does "not a lot of code" mean here.
> but generally if VIRTIO_NET_F_GUEST_HDRLEN is not set
> just doing a quick skb_headlen and not poking at
> the transport things sounds like a win.
Yes, this is exactly what I meant.
>
> I'd like to at least see the patch along the lines you propose,
> and we will judge if it's too much mess to support.
+1.
Thanks
>
>
> > >
> > > --
> > > MST
> > >
>
next prev parent reply other threads:[~2025-11-11 0:45 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-29 3:09 [PATCH net v4 0/4] fixes two virtio-net related bugs Xuan Zhuo
2025-10-29 3:09 ` [PATCH net v4 1/4] virtio-net: fix incorrect flags recording in big mode Xuan Zhuo
2025-11-09 17:04 ` Alyssa Ross
2025-11-09 21:34 ` Michael S. Tsirkin
2025-10-29 3:09 ` [PATCH net v4 2/4] virtio-net: Ensure hdr_len is not set unless the header is forwarded to the device Xuan Zhuo
2025-10-30 2:42 ` Jason Wang
2025-11-09 21:37 ` Michael S. Tsirkin
2025-10-29 3:09 ` [PATCH net v4 3/4] virtio-net: correct hdr_len handling for VIRTIO_NET_F_GUEST_HDRLEN Xuan Zhuo
2025-10-30 2:53 ` Jason Wang
2025-11-09 21:41 ` Michael S. Tsirkin
2025-11-10 7:16 ` Jason Wang
2025-11-10 7:26 ` Michael S. Tsirkin
2025-11-10 7:39 ` Jason Wang
2025-11-10 16:10 ` Michael S. Tsirkin
2025-11-11 0:45 ` Jason Wang [this message]
2025-11-09 21:42 ` Michael S. Tsirkin
2025-10-29 3:09 ` [PATCH net v4 4/4] virtio-net: correct hdr_len handling for tunnel gso Xuan Zhuo
2025-10-29 9:51 ` Paolo Abeni
2025-10-30 8:02 ` [PATCH net v4 0/4] fixes two virtio-net related bugs Michael S. Tsirkin
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=CACGkMEs9qwGfnmTR2zCS09QZpKG5OnpCJ19BUtL6AkAW3L-9eg@mail.gmail.com \
--to=jasowang@redhat.com \
--cc=alvaro.karsz@solid-run.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eperezma@redhat.com \
--cc=hengqi@linux.alibaba.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=virtualization@lists.linux.dev \
--cc=willemb@google.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).