public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
* [PATCH 0/2] Fix minimum frame size checks in vhost-user paths
@ 2026-02-12 11:39 Laurent Vivier
  2026-02-12 11:39 ` [PATCH 1/2] virtio: Introduce VNET_HLEN macro for virtio net header length Laurent Vivier
  2026-02-12 11:39 ` [PATCH 2/2] tcp_vu, udp_vu: Account for virtio net header in minimum frame size Laurent Vivier
  0 siblings, 2 replies; 5+ messages in thread
From: Laurent Vivier @ 2026-02-12 11:39 UTC (permalink / raw)
  To: passt-dev; +Cc: Laurent Vivier

In the vhost-user code paths, buffers from the virtio queue include
a virtio net header prepended to the Ethernet frame.  The minimum
frame size checks (ETH_ZLEN, i.e. 60 bytes per IEEE 802.3) must
account for this extra header, otherwise the size requested from
vu_collect() and validated in ASSERT() is too small.

This two-patch series:

1. Introduce a VNET_HLEN macro in virtio.h to replace all open-coded
   sizeof(struct virtio_net_hdr_mrg_rxbuf) throughout the vhost-user
   code, improving readability and consistency.

2. Fix the minimum frame size calculations in tcp_vu.c and udp_vu.c
   to use ETH_ZLEN + VNET_HLEN instead of bare ETH_ZLEN, correctly
   accounting for the virtio net header in the buffer size.

Laurent Vivier (2):
  virtio: Introduce VNET_HLEN macro for virtio net header length
  tcp_vu, udp_vu: Account for virtio net header in minimum frame size

 tcp_vu.c    | 29 +++++++++++------------------
 udp_vu.c    | 14 +++++---------
 virtio.h    |  2 ++
 vu_common.c | 13 +++++--------
 vu_common.h |  2 +-
 5 files changed, 24 insertions(+), 36 deletions(-)

-- 
2.52.0



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-02-13 11:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).