From: Stefano Brivio <sbrivio@redhat.com>
To: Laurent Vivier <lvivier@redhat.com>
Cc: passt-dev@passt.top
Subject: Re: [PATCH 1/2] virtio: Introduce VNET_HLEN macro for virtio net header length
Date: Fri, 13 Feb 2026 12:47:55 +0100 (CET) [thread overview]
Message-ID: <20260213124754.6553216d@elisabeth> (raw)
In-Reply-To: <20260212113932.1047788-2-lvivier@redhat.com>
On Thu, 12 Feb 2026 12:39:31 +0100
Laurent Vivier <lvivier@redhat.com> wrote:
> Replace all open-coded sizeof(struct virtio_net_hdr_mrg_rxbuf) with a
> VNET_HLEN macro.
>
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
> tcp_vu.c | 21 +++++++--------------
> udp_vu.c | 12 ++++--------
> virtio.h | 2 ++
> vu_common.c | 13 +++++--------
> vu_common.h | 2 +-
> 5 files changed, 19 insertions(+), 31 deletions(-)
>
> diff --git a/tcp_vu.c b/tcp_vu.c
> index b9e9b55ed3d3..f7bda4943e43 100644
> --- a/tcp_vu.c
> +++ b/tcp_vu.c
> @@ -49,8 +49,7 @@ static size_t tcp_vu_hdrlen(bool v6)
> {
> size_t hdrlen;
>
> - hdrlen = sizeof(struct virtio_net_hdr_mrg_rxbuf) +
> - sizeof(struct ethhdr) + sizeof(struct tcphdr);
> + hdrlen = VNET_HLEN + sizeof(struct ethhdr) + sizeof(struct tcphdr);
My eyes thank you dearly.
--
Stefano
next prev parent reply other threads:[~2026-02-13 11:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-12 11:39 [PATCH 0/2] Fix minimum frame size checks in vhost-user paths Laurent Vivier
2026-02-12 11:39 ` [PATCH 1/2] virtio: Introduce VNET_HLEN macro for virtio net header length Laurent Vivier
2026-02-13 11:47 ` Stefano Brivio [this message]
2026-02-12 11:39 ` [PATCH 2/2] tcp_vu, udp_vu: Account for virtio net header in minimum frame size Laurent Vivier
2026-02-13 11:48 ` Stefano Brivio
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=20260213124754.6553216d@elisabeth \
--to=sbrivio@redhat.com \
--cc=lvivier@redhat.com \
--cc=passt-dev@passt.top \
/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.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
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 IMAP folder(s).