From: Stefano Brivio <sbrivio@redhat.com>
To: David du Colombier <0intro@gmail.com>
Cc: passt-dev@passt.top, Laurent Vivier <lvivier@redhat.com>
Subject: Re: [PATCH v2] tap: Trim Ethernet padding from short IPv4 frames instead of dropping them
Date: Fri, 19 Jun 2026 19:05:33 +0200 (CEST) [thread overview]
Message-ID: <20260619190532.77004548@elisabeth> (raw)
In-Reply-To: <20260616163705.1285803-1-0intro@gmail.com>
On Tue, 16 Jun 2026 18:37:05 +0200
David du Colombier <0intro@gmail.com> wrote:
> tap4_handler() requires the L2 payload after the IP header to match
> the IP datagram length exactly. Guests whose drivers pad transmitted
> frames to the 60 byte Ethernet minimum, as real hardware requires and
> as drivers modelled on hardware do (Plan 9's virtio-net, for one),
> send pure ACK and FIN segments as 60 byte frames: 14 byte Ethernet
> header, 40 byte IPv4 datagram, 6 padding octets. Those frames fail
> the exact length check and are dropped without trace.
>
> passt then never sees such a guest's acknowledgements: it
> retransmits from the lowest unacknowledged sequence with exponential
> backoff while the guest, which received and acknowledged everything,
> waits. Every fresh connection stalls for minutes (a 1 MiB HTTP fetch
> over --map-host-loopback measured 248 s before this change, 0.27 s
> after; bulk transfer over established connections, whose ACKs ride
> data segments above the padding threshold, is unaffected). FIN
> segments are padded too, so teardown hangs as well. Note that
> tap_send_single() pads passt's own outbound frames to ETH_ZLEN, so
> the receive path was already stricter than the send path.
>
> Trim the trailing padding to the IP datagram length instead, using a
> new iov_tail_trim() helper, and keep dropping frames genuinely
> shorter than the datagram they claim to carry. IPv6 is unaffected:
> its minimal TCP frame is 74 bytes, above the padding threshold.
>
> Signed-off-by: David du Colombier <0intro@gmail.com>
> ---
> v2:
> - store the iov_tail_size() result in a local variable instead of
> computing it twice
> - pass ARRAY_SIZE(trim_iov) instead of UIO_MAXIOV
Applied, thanks for fixing this, and welcome to the git log!
--
Stefano
prev parent reply other threads:[~2026-06-19 17:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260612214338.12345-1-0intro@gmail.com>
2026-06-16 16:37 ` David du Colombier
2026-06-19 17:05 ` Stefano Brivio [this message]
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=20260619190532.77004548@elisabeth \
--to=sbrivio@redhat.com \
--cc=0intro@gmail.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).