From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=cA0zNZvQ; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id 08C745A0279 for ; Wed, 10 Sep 2025 11:10:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1757495406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Qq5mQkXptdQfWsYWIEcZ3NnjMemGq+ysQEJFhnLhfRA=; b=cA0zNZvQL+kWbLQKV0zWshsOAJJt0h53i4YG+CX5UCi33AefBq8HyQ0MnK+4QzlwSsTb6N Ku1X+6agzSuOL+tdaQcO/PqVKXr1H1NSPi0ncSePkl09ynieBvtKdCfTii6/sa8nZ5BY/1 t9oZLmvalz6jJxzMNXgFiSeMJ3GsLb8= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-180-atgWo8A2MJKAl_qtyj7PYw-1; Wed, 10 Sep 2025 05:10:05 -0400 X-MC-Unique: atgWo8A2MJKAl_qtyj7PYw-1 X-Mimecast-MFC-AGG-ID: atgWo8A2MJKAl_qtyj7PYw_1757495404 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-45df7e734e0so3426395e9.0 for ; Wed, 10 Sep 2025 02:10:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757495403; x=1758100203; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Qq5mQkXptdQfWsYWIEcZ3NnjMemGq+ysQEJFhnLhfRA=; b=B3GVv3guBdrA+5lsNK34eMDnvWYc8LsUVAb37iA+SqoT/EcSwDFf1V8XWK099dLyLz L2wwFddMCVAXZgkNTp9CDqSsBUWeflgiuT8Q+gJyIWLOELuXLLPtvAk9lMnaZPUJ+OuJ 38CYy5JDRarJctYAqf/kWq7FDHRaJSilqX7B2ULD9sav8ZLO/6YEp+TfA2s3gVgRr++i fs7+3o55PogChCKOtgYAccUutGL0+OP8PZF30H7a9jmNEkegAFcSO9XjfQi1iq0Ncurc bScIsANoAil9hS/G/TWJWqsv55694sx0oBCg+M4twS61B4VKkYopDxmTE0ilMu40KoMm K/Iw== X-Forwarded-Encrypted: i=1; AJvYcCWcoeZfSEee6RkL/OnZwQUAh7jqaqBPMt5GJscEWdgs0VuyjFZPO3LF1oNZE9fMX9hFk0WdSbPfv+8=@passt.top X-Gm-Message-State: AOJu0Yz7En9QRtS0QQugDneEB01T3u2eTG/cXoXhvoxMlVSFO9TKNLg4 uaoI/Q8mwL/Onu8mOmWH14oETjjqgE0BHKjTRPevbj3x+T5P6d+hqOHi03AoL28K4jIr3JZ8zUz UzJGWOscdxDzzYQgffxhzDFwnHY0yL1976danck6raMfOTUCmcDXM8NacNKoyqQ== X-Gm-Gg: ASbGncsNzLte/339rAzLGOB1C+xrJN7D3QNGc3lL/p1CVCGfwKzr5vOrtOlNcRo40+U 8ZxE3Vn8A/Y9dkqgVxjis5q11sEYXUqvR5/ugKBgK5SCXT3E4R6i2sQvZ0seIB8cltYJ8KxmK5a MHTzt1btOvAaCGsz3r8GgFiA4HS91yIMHIuWAzNWxQY0yPYATvV4aAC27fRK4dITXJ2sbFA88zh ENhblnYwbpgjdi5cAlMWuRKw/lvJ4gYSYWjeGva/GdDhspIXsMNhnKTh4VGusvlRxEVzZ4+TjgX ufAeItRuTROeOOKInfP4JwubVscc14zMeSX5sHAXEPXMAA== X-Received: by 2002:a05:600c:a4c:b0:45d:cfc6:5166 with SMTP id 5b1f17b1804b1-45de2096f6dmr122429045e9.23.1757495403524; Wed, 10 Sep 2025 02:10:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGPeyLNWGEVGV1GPW9pKhMWvaDXDpxvGR7HymRzKafVkN1zxSF3gIqFYPYxqFTGRzgO8qTvQg== X-Received: by 2002:a05:600c:a4c:b0:45d:cfc6:5166 with SMTP id 5b1f17b1804b1-45de2096f6dmr122428725e9.23.1757495402997; Wed, 10 Sep 2025 02:10:02 -0700 (PDT) Received: from [192.168.188.22] ([80.243.52.135]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3e7521bf85esm6243175f8f.1.2025.09.10.02.10.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Sep 2025 02:10:02 -0700 (PDT) Message-ID: <6908b27b-1ab1-44ce-a209-7cfe8ac55290@redhat.com> Date: Wed, 10 Sep 2025 11:10:01 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 0/8] tcp: Fixes for issues uncovered by tests with 6.17-rc1 kernels To: Stefano Brivio , passt-dev@passt.top References: <20250909181655.2990223-1-sbrivio@redhat.com> From: Paul Holzinger In-Reply-To: <20250909181655.2990223-1-sbrivio@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: -l-wyqtjWEpjO5k4g6V73-aH_77vsudwsnTsyDU7Jdg_1757495404 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID-Hash: AWIT3BS25LYKKGYIPLKUTWXSRNZ7FBNJ X-Message-ID-Hash: AWIT3BS25LYKKGYIPLKUTWXSRNZ7FBNJ X-MailFrom: pholzing@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Jon Maloy , David Gibson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 09/09/2025 20:16, Stefano Brivio wrote: > 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(-) > Reproducer runs for over 14 hours now without failure so looks like we found all the problems now. Tested-by: Paul Holzinger -- Paul Holzinger