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=A/1t4lvt; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id A66B95A0619 for ; Fri, 05 Dec 2025 03:50:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202510; t=1764903020; bh=7DFaz/Jw5cb98NbKQPg1kYjxy7NGyDgRs43SGv2AlPw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=A/1t4lvtrD3KEwDRy2iSqx49cWIyONUZ97fShQiUkCIdfX9Ll8PKTXZ4DnULea+Mv xuM3RfRJ6ATySPadDV2dhKeNzGxdlVfVQlwiKLfUVSWxTGSUeJGKACJjylJscp+7v0 hH5w/IcEwWZAHcK8tcz+Lp6ravLd/K2OA59mawj6L8KpNB38NGQJRUlChnVDl+Y4Em 2TajBe4/eaGO+h6OliQs6DO6fWF0oJmmOuLPM6StZuVsPjsMZr2zuyzDOj+Lxt4jcT Up2KbBj+l89QyUNyO6/SqcwbPwjIEjozDq4xXlpL1zYUMBJuEizWcD/uv1OCc18uv8 xDuNfsuA1po9g== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4dMwph10Kvz4wGv; Fri, 05 Dec 2025 13:50:20 +1100 (AEDT) Date: Fri, 5 Dec 2025 13:50:15 +1100 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH 4/8] tcp: Acknowledge everything if sending buffer is less than SNDBUF_BIG Message-ID: References: <20251204074542.2156548-1-sbrivio@redhat.com> <20251204074542.2156548-5-sbrivio@redhat.com> <20251205022012.2acceb8e@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="QjdFzskkRpJaavR9" Content-Disposition: inline In-Reply-To: <20251205022012.2acceb8e@elisabeth> Message-ID-Hash: 673GHU4FOCL63WQMMPGRY7SGNAWCEC3W X-Message-ID-Hash: 673GHU4FOCL63WQMMPGRY7SGNAWCEC3W 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: --QjdFzskkRpJaavR9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 05, 2025 at 02:20:12AM +0100, Stefano Brivio wrote: > On Fri, 5 Dec 2025 11:08:06 +1100 > David Gibson wrote: >=20 > > On Thu, Dec 04, 2025 at 08:45:37AM +0100, Stefano Brivio wrote: > > > ...instead of checking if it's less than SNDBUF_SMALL, because this > > > isn't simply an optimisation to coalesce ACK segments: we rely on > > > having enough data at once from the sender to make the buffer grow > > > by means of TCP buffer size tuning implemented in the Linux kernel. > > >=20 > > > Use SNDBUF_BIG: above that, we don't need auto-tuning (even though > > > it might happen). SNDBUF_SMALL is too... small. =20 > >=20 > > Do you have an idea of how often sndbuf exceeds SNDBUF_BIG? I'm > > wondering if by making this change we might have largely eliminated > > the first branch in practice. >=20 > Before this series, or after 6/8 in this series, it happens quite > often. It depends on the bandwidth * delay product of course, but at 1 > Gbps and 20 ms RTT we get there in a couple of seconds. >=20 > Maybe 1 MiB would make more sense for typical conditions, but I'd defer > this to a more adaptive implementation of the whole thing. I think it > should also depend on the RTT, ideally. Ok. Adding that context to the commit message might be useful. Otherwise, Reviewed-by: David Gibson >=20 > >=20 > > > Signed-off-by: Stefano Brivio > > > --- > > > tcp.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > >=20 > > > diff --git a/tcp.c b/tcp.c > > > index e4c5a5b..fbf97a0 100644 > > > --- a/tcp.c > > > +++ b/tcp.c > > > @@ -1079,7 +1079,7 @@ int tcp_update_seqack_wnd(const struct ctx *c, = struct tcp_tap_conn *conn, > > > if (bytes_acked_cap && !force_seq && > > > !CONN_IS_CLOSING(conn) && > > > !(conn->flags & LOCAL) && !tcp_rtt_dst_low(conn) && > > > - (unsigned)SNDBUF_GET(conn) >=3D SNDBUF_SMALL) { > > > + (unsigned)SNDBUF_GET(conn) >=3D SNDBUF_BIG) { > > > if (!tinfo) { > > > tinfo =3D &tinfo_new; > > > if (getsockopt(s, SOL_TCP, TCP_INFO, tinfo, &sl)) > > > --=20 > > > 2.43.0 >=20 > --=20 > Stefano >=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 --QjdFzskkRpJaavR9 Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmkySGcACgkQzQJF27ox 2GcqjhAAhW2Goyrwagx+KH616GPRvMVDWsZ1UkbHdlD1TVU4mkhi3wHQ5cIpOuWq rkD7WOHgEf9Ps9nbpBIaSCkgGRTmOHij02jorjhCUt3dyWPbGPuKYrkn+UT1NHJP E/sPV1P33ZRG6j3eLYIbhWhhNW1z+0Tv7L34QngBPa3i12ShrK45cidjsfNO8GNC SfMjT6Fw6BNNCR2sFTgvUXEIM6q2VSZcCjLx1+koCPXwqAgDfQv0a1lcvKugct2u iFDFmytYSWNge8AHc7wcdhWZ+cadmnpLJiKyTuM9GEn9HxeqxLlTfqbPk0o+eitK FKH//MK9F3BApUpPafwpHI7fuah8PQtNHaitgVV+KRlE5id3ml84Zgz8ePUzQ6ML 4tK9SPJPsRA/elnKYZ4rCM0aNMGNzEL8b1HnDm3gwp/Z5Y8of1h1o2OmcwZfVgWr MAhMN3Upd+zaXnQClqiWwuy6Zsk2aS95lBKpnlEwmzALMmiTgqkD9YDYV/mXh6+j Uzlq3sLDsIAiK8a7un1+hlYBQR3MIPkAqBITDZ0txJVGORPe+8jZOfKBUbhx1i1/ jRI8uYzyDTLTcLdaxl7JpUubgX9Vun5OMiXahRRwAgGdPXx4mWmGn5kSQAlYdoye +HYe3zk/SxaUtVw19tr3bLHY+tHBmreMe12dtODhPa81kiwXLgU= =wkd6 -----END PGP SIGNATURE----- --QjdFzskkRpJaavR9--