From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202502 header.b=KVJXVDjQ; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id CE80A5A061B for ; Wed, 12 Feb 2025 01:57:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202502; t=1739321833; bh=Zybw7E2edB/VNABnWP27P744sKAYXbxFnWQscOmSOPI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KVJXVDjQ0nYTzzsSAxSkzwmxy+6hqQ4X0hluj/4vTrcvqiH+wR735fqLx11Wdi7h1 ZN4ai37yewg/02rC3IvN59Vq2eatRGQ5D9yGLvoyIeCjv+sFljc8y9B+t2pyHxjY6T vNTApEDPRWkihaBIdujN929MJRYF7BkUfziFXKoQoZZMQjiF+kVYui/JICGUulLgA8 ROJgPMXO0yP5s5FcvUkfrTJaq978Xj5CAaY218K+jJtRwGgFiT0OFAB0zO7v4fxqK0 WPZSWBydjj8naxGOxkPMFvKRlgaSkfZDav0KmMaY7+K9afBkYyw6oiDYe5Gv5fR9jv QhZ1neyex2z1Q== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4Yt0Jn1kjHz4wcj; Wed, 12 Feb 2025 11:57:13 +1100 (AEDT) Date: Wed, 12 Feb 2025 11:44:13 +1100 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH] tcp: Implement conservative zero-window probe on ACK timeout Message-ID: References: <20250211195100.197876-1-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="XACBIXgo4AOZLjak" Content-Disposition: inline In-Reply-To: <20250211195100.197876-1-sbrivio@redhat.com> Message-ID-Hash: GCVKL7HZM6FVSLLTIS57Y7UNGBAVXZMX X-Message-ID-Hash: GCVKL7HZM6FVSLLTIS57Y7UNGBAVXZMX X-MailFrom: dgibson@gandalf.ozlabs.org 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: passt-dev@passt.top, Jon Maloy 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: --XACBIXgo4AOZLjak Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 11, 2025 at 08:51:00PM +0100, Stefano Brivio wrote: > This probably doesn't cover all the cases where we should send a > zero-window probe, but it's rather unobtrusive and obvious, so start > from here, also because I just observed this case (without the fix > from the previous patch, to take into account window information from > keep-alive segments). >=20 > If we hit the ACK timeout, and try re-sending data from the socket, > if the window is zero, we'll just fail again, go back to the timer, > and so on, until we hit the maximum number of re-transmissions and > reset the connection. >=20 > Don't do that: forcibly try to send something by implementing the > equivalent of a zero-window probe in this case. >=20 > Signed-off-by: Stefano Brivio Reviewed-by: David Gibson > --- > tcp.c | 2 ++ > 1 file changed, 2 insertions(+) >=20 > diff --git a/tcp.c b/tcp.c > index 2addf4a..b87478f 100644 > --- a/tcp.c > +++ b/tcp.c > @@ -2175,6 +2175,8 @@ void tcp_timer_handler(const struct ctx *c, union e= poll_ref ref) > flow_dbg(conn, "ACK timeout, retry"); > conn->retrans++; > conn->seq_to_tap =3D conn->seq_ack_from_tap; > + if (!conn->wnd_from_tap) > + conn->wnd_from_tap =3D 1; /* Zero-window probe */ > if (tcp_set_peek_offset(conn->sock, 0)) { > tcp_rst(c, conn); > } else { --=20 David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson --XACBIXgo4AOZLjak Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmer7twACgkQzQJF27ox 2GeXQw/8C2LX8b+Np7mcLr7zCqHbBpvS6ThNkDlkbgSsiIsxqB7Ch/JMblYL/gh5 AyqxjzJU9Paba5ococ6w3ZVRp0hHhII7sA80e+nBfnptGAJbWHN+m0qDHCAexPHq Clr2kV2Cj7LFtCGwic0QIUI5mj8N4RlHyIC0iKo4NM2IbzLJ8IzwStju3AVXmXYk qUXTpqU7ROZdc01iNJAjcW6JOCvetAmxCHDZCNKTbwl7DHMXAqDC8I2KF7ykzAJl v3qOfmr2TrZqR2zwfbyjhZbQyyB/zEDxKRFPyl0GEPQq8bZiQa5anJVs8hg21ICm dQi7bMWFYQXP1Zd7+R3e9KbIQ2PfzwcHcFXzfVdiXEiLliiSliB67j5RW3988sz0 WsBC38MM6PP+gNGUYLGIUXi3V55oG1nXG79bV6AL9Z6B8NqpGrxGgso/nMH1B/GB ytQVRXXRJiOH0ygbNROMsLyJIHg9+SVgtd1vNxhr96q6IOwTxnQ1AOrqq+peWHds qoYyWwm+qpxd0g7N2v2exi9fvVa4hUS70xyhWV1i2OLDrICk6jXmaDuEeWvCeEPg ZT9xURKos5+S8821pp9gvEA+wFt8fr5s0SfxeDP9BVRSA4lI4zAmTTaXOSFA1bYL ipivazPCo0eO6EY7DvfKKm8YFb/DfL+atobdKPpDcoEr8NphnIM= =mEc7 -----END PGP SIGNATURE----- --XACBIXgo4AOZLjak--