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=202510 header.b=QJu6DoUL; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 9AD125A061A for ; Fri, 05 Dec 2025 01:35:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202510; t=1764894926; bh=7fCm2GCX+cPgBVdAeuyYuRIvf0v+2Cvx4txQLy3CM+w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QJu6DoULetQMfxSo15Fs+3i9ow32keimMJssMt+QXlQ34Fi7Lstmb91RbKj6VXvFO r8oE33+88l+5OOe4mv+fp6CBQXSwb30ZC4qfToJJRDZKENRJ3TIPXALoWnUGhKA1KT NR3g9JNoe2wKEpuTjwBknyTapVClMIi/bFgj+F7xFv1+rLZigYv+76V7jjIuyyRh+J LRG0nlUQXGSGSvWR1fr5iKWVjuL0A0Wo8GbdVh63j55oiJ6eJur2MftRo8TWLE7+Fd bPu5epd0eQ4SX07JF5nx5+ywhJkn8GG4ELgmgE89eTP1PKdDQPHqXbry6CbyZWTMmZ Sc8Fv3Pk87sPA== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4dMsq26W71z4wHj; Fri, 05 Dec 2025 11:35:26 +1100 (AEDT) Date: Fri, 5 Dec 2025 11:35:22 +1100 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH 5/8] tcp: Don't limit window to less-than-MSS values, use zero instead Message-ID: References: <20251204074542.2156548-1-sbrivio@redhat.com> <20251204074542.2156548-6-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="wPkvaCWDiIBtylVL" Content-Disposition: inline In-Reply-To: <20251204074542.2156548-6-sbrivio@redhat.com> Message-ID-Hash: S532KFZEJ3ZLZANO6HDYQZ4Z46FE4DDJ X-Message-ID-Hash: S532KFZEJ3ZLZANO6HDYQZ4Z46FE4DDJ 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, Max Chernoff 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: --wPkvaCWDiIBtylVL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 04, 2025 at 08:45:38AM +0100, Stefano Brivio wrote: > If the sender uses data clumping (including Nagle's algorithm) for > Silly Window Syndrome (SWS) avoidance, advertising less than a MSS > means the sender might stop sending altogether, and window updates > after a low window condition are just as important as they are in > a zero-window condition. >=20 > For simplicity, approximate that limit to zero, as we have an > implementation forcing window updates after zero-sized windows. >=20 > Signed-off-by: Stefano Brivio The logic change looks good to me, so, Reviewed-by: David Gibson However, a couple of points about the description (both commit message and comment). * Nagle's algorithm is certainly related, but it's not clear to me it's quite the same thing as the sender-side SWS avoidance algorithm - Nagle's exists for a different purpose, certainly. RFC 813 doesn't name Nagle's algorithm anywhere, although that could because the name wasn't as established at the time. * Since you're referencing RFC 813 anyway, it seems relevant that what you're doing here is pretty similar to the receiver-side SWS avoidance algorithm described in section 4. > --- > tcp.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) >=20 > diff --git a/tcp.c b/tcp.c > index fbf97a0..2220059 100644 > --- a/tcp.c > +++ b/tcp.c > @@ -1140,6 +1140,18 @@ int tcp_update_seqack_wnd(const struct ctx *c, str= uct tcp_tap_conn *conn, > else > limit =3D SNDBUF_GET(conn) - (int)sendq; > =20 > + /* If the sender uses Nagle's algorithm to prevent Silly Window > + * Syndrome (SWS, RFC 813 Section 3) it's critical that, should > + * the window ever become less than the MSS, we advertise a new > + * value once it increases again to be above it. > + * > + * To this end, for simplicity, approximate a window value below > + * the MSS to zero, as we already have mechanisms in place to > + * force updates after the window becomes zero. > + */ > + if (limit < MSS_GET(conn)) > + limit =3D 0; > + > new_wnd_to_tap =3D MIN((int)tinfo->tcpi_snd_wnd, limit); > } > =20 > --=20 > 2.43.0 >=20 --=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 --wPkvaCWDiIBtylVL Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmkyKMkACgkQzQJF27ox 2Gc0mQ/9EccqjCb65PRlocqh8u6ehxGyMpqRgoz46h8pfHv7L4pRjQslinrdNk8x yz4pJw12AmJPzbSB42xyIkXliqyPkzfIe2kFOoJK1x90CQJNw94QwmiKbZUpdL1L PuJkgxOmGPdOLE2DE3cfid5VOCu/kkKQAIsBTRK7i/CS+kW5ZasWmFosDZlpBsbv X3pKEpP4d5ziMzJZTmBYmaTKCgxTzgK8mNfMEgfjdkEUQ3jcJtPLGW+VNBV9tQVg HOQc9JgiuLeDhZ2AIutIHbZLoTN3Qz52gheKY8Q1PvZtvqEovnwMf9tMdYw+Hvlh I2AWKvQuiKFkSceS0NWLX5yxSbp0AUJetMMhR+CWNHc2pcLvg7dApdAafa2FsG5d h5yamt0n+7CJPO6RGIFTeN8JINvbDpbKcdyrEbZNapYiUBR/mUws7vgaq1LHWI08 1oVm6/o0ZeNB1SCCEpJ5LyhitqxqpJPBM2rR8v+WGh2Hk86bYg3/34gjjrnfIwr/ ffg0KBkbwVtuEnD0JEBZrkEd7ohiGsoiIEIY7Ls9m0+Wfy2HV1YFQ+gTnX3I3Ri+ XZk/Hc5wjFjZ5A/BU9+rLzI9MCrZn++jDCR7B+PlTMj+6kmQN5/8283wT/BpPDFP ULKk8sUC0COQ8+9hWJ6lsZuVbJzO5P36O4Dr8iI2o5yakdN5zes= =e/En -----END PGP SIGNATURE----- --wPkvaCWDiIBtylVL--