public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
* [PATCH v4 0/8] tcp: Fixes for issues uncovered by tests with 6.17-rc1 kernels
@ 2025-09-09 18:16 Stefano Brivio
  2025-09-09 18:16 ` [PATCH v4 1/8] tcp: FIN flags have to be retransmitted as well Stefano Brivio
                   ` (8 more replies)
  0 siblings, 9 replies; 20+ messages in thread
From: Stefano Brivio @ 2025-09-09 18:16 UTC (permalink / raw)
  To: passt-dev; +Cc: Jon Maloy, Paul Holzinger, David Gibson

Starting from Linux kernel commit 1d2fbaad7cd8 ("tcp: stronger
sk_rcvbuf checks"), window limits are enforced more aggressively with
a bigger amount of zero-window updates compared to what happened with
e2142825c120 ("net: tcp: send zero-window ACK when no memory") alone,
and occasional duplicate ACKs can now be seen also for local transfers
with default (208 KiB) socket buffer sizes.

Paul reports that, with 6.17-rc1-ish kernels, Podman tests for the
pasta integration occasionally fail on the "TCP/IPv4 large transfer,
tap" case.

While playing with a reproducer that seems to be matching those
failures:

  while true; do ./pasta --trace -l /tmp/pasta.log -p /tmp/pasta.pcap --config-net -t 5555 -- socat TCP-LISTEN:5555 OPEN:/tmp/large.rcv,trunc & (sleep 0.3; socat -T2 OPEN:large.bin TCP:88.198.0.164:5555; ); wait; diff large.bin /tmp/large.rcv || break; done

and a kernel including that commit, I hit a few different failures,
that should be fixed by this series.

Paul tested v1 of this series and found an additional failure
(transfer timeout), which I could reproduce with a slightly different
command:

  while true; do ./pasta --trace -l /tmp/pasta.log -p /tmp/pasta.pcap --config-net -t 5555 -- socat TCP-LISTEN:5555 EXEC:./write.sh & (sleep 0.3; socat -T2 OPEN:large.bin TCP:88.198.0.164:5555; ); wait; diff large.bin /tmp/large.rcv || break; done

where write.sh is simply:

  #!/bin/sh
  
  cat > /tmp/large.rcv

so that the connection is not half-closed starting from the beginning,
because socat can't make assumptions about the unidirectional nature
of the traffic. This should now be fixed as well by the new version of
patch 3/8.

v4:
  - add patch 8/8

v3:
  - add patch 6/7
  - in 7/7, check dlen <= 1 for keep-alive segments, instead of len <= 1

v2: in 3/6, rewind sequence also if the zero-window update comes in
    the middle of a batch with non-zero window updates

Stefano Brivio (8):
  tcp: FIN flags have to be retransmitted as well
  tcp: Factor sequence rewind for retransmissions into a new function
  tcp: Rewind sequence when guest shrinks window to zero
  tcp: Fix closing logic for half-closed connections
  tcp: Don't try to transmit right after the peer shrank the window to
    zero
  tcp: Cast operands of sequence comparison macros to uint32_t before
    using them
  tcp: Fast re-transmit if half-closed, make TAP_FIN_RCVD path
    consistent
  tcp: Don't send FIN segment to guest yet if we have pending
    unacknowledged data

 tcp.c          | 142 ++++++++++++++++++++++++++++++++++++++-----------
 tcp_buf.c      |   5 +-
 tcp_internal.h |  12 +++--
 3 files changed, 122 insertions(+), 37 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2025-09-10 23:56 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-09 18:16 [PATCH v4 0/8] tcp: Fixes for issues uncovered by tests with 6.17-rc1 kernels Stefano Brivio
2025-09-09 18:16 ` [PATCH v4 1/8] tcp: FIN flags have to be retransmitted as well Stefano Brivio
2025-09-09 18:16 ` [PATCH v4 2/8] tcp: Factor sequence rewind for retransmissions into a new function Stefano Brivio
2025-09-09 18:16 ` [PATCH v4 3/8] tcp: Rewind sequence when guest shrinks window to zero Stefano Brivio
2025-09-10  2:20   ` David Gibson
2025-09-10  6:37     ` Stefano Brivio
2025-09-10  7:18       ` David Gibson
2025-09-10 23:48   ` Jon Maloy
2025-09-09 18:16 ` [PATCH v4 4/8] tcp: Fix closing logic for half-closed connections Stefano Brivio
2025-09-10 23:56   ` Jon Maloy
2025-09-09 18:16 ` [PATCH v4 5/8] tcp: Don't try to transmit right after the peer shrank the window to zero Stefano Brivio
2025-09-09 18:16 ` [PATCH v4 6/8] tcp: Cast operands of sequence comparison macros to uint32_t before using them Stefano Brivio
2025-09-10  2:21   ` David Gibson
2025-09-09 18:16 ` [PATCH v4 7/8] tcp: Fast re-transmit if half-closed, make TAP_FIN_RCVD path consistent Stefano Brivio
2025-09-10  2:27   ` David Gibson
2025-09-10  9:57     ` Stefano Brivio
2025-09-09 18:16 ` [PATCH v4 8/8] tcp: Don't send FIN segment to guest yet if we have pending unacknowledged data Stefano Brivio
2025-09-10  2:29   ` David Gibson
2025-09-10  6:37     ` Stefano Brivio
2025-09-10  9:10 ` [PATCH v4 0/8] tcp: Fixes for issues uncovered by tests with 6.17-rc1 kernels Paul Holzinger

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