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=nrERXc+s; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 5ADD75A0619 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=ZzeLf06yPVjGaQh7JZ0SYnUvMFnBn7nvsJXnwYcomS0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nrERXc+snbtQci8cDo9Pnccx98D4x7JqWiGjOy/wRbAVqmzB0Zn7JY0ErNgQaM9VQ 9zxVVHLjaKDPFL8sdV8rFHIGh6+sxxRsrH3lhsBbNIw/eguyfCFTDhh4nJ3N8TlpyD kvUoSJOQcmsLy4x+iqB1P7t+tyt+pRHR1KnUqip8+ReW0iXxeLKHROoS7/Nn/20Moc OODJMS2jX5CSI74DLncOzd/9TITP8PLnKlRg1oITTc25RJNIgGQ3TU344jlxa1ssti vOIMJESoGPU4MyYOgiexiK+Ce0lawJefKxpOT7Xf1PIXnFgPdrdD+9rISDaQ06J40C w8+4d6MriTe0A== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4dMsq26RJ4z4wHY; Fri, 05 Dec 2025 11:35:26 +1100 (AEDT) Date: Fri, 5 Dec 2025 11:08:06 +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> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="uWqoapSGGaQK6EL7" Content-Disposition: inline In-Reply-To: <20251204074542.2156548-5-sbrivio@redhat.com> Message-ID-Hash: 75QICR7OJDI3CWZ3MSD6M2HS2BIED4UW X-Message-ID-Hash: 75QICR7OJDI3CWZ3MSD6M2HS2BIED4UW 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: --uWqoapSGGaQK6EL7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. 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. > 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, stru= ct 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 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 --uWqoapSGGaQK6EL7 Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmkyIlcACgkQzQJF27ox 2Gdfvg//ZuAOGm79UHkRYEPVAWclrYAl6K8vLBsr04WPtvRV/p7G7MPsO9KGKJKb 3jK11soKK1GugHcc4KyMOmpMXRfJr2DZf2i2i6G1Zq7rG1PMzPNaHICiruN4aFHj HN1C7aTHKKV0W+K6grQFDBANs6W8M47jBotKhaRc4RSHTc1h7D9o2IYuiFB7iLk2 H5xU7+R0oX1xDk/3NfF+zIeAwyNcxBMDQMt00NR7vl1DeAhQMzGv1HG4pqASg/Rj NX5pWcsoSD+IfGLUoNP+AWW31KKV8UEbquXgF00WYLl9nZ5ormyzorglXnCOAwaW Oo7O6kYA3Og0lSqUXiVe3uq318GYDDOxBGkFHHu6MRxH3ugqQyDrqAKOd4OhSCXk o6/RxDUp9aAnF2G9W1twaCQYEmzWPfitDa1V0DRhbEyDQOxbigkRcriYD4i9ZJDH LdxE33+IbFcQ9REfktfinPj+9QxoGB9S6/pogB1frR7srGT7fuDjr9cPXnsKbRIg 9K8zIWskshNcgE262mkdBF6yfzrtXp41aBHp98H2rQGSXUZOjQ7i/VASqYD9hEyY M8oDDi/5WkZHBxaCiWTok/xP3q6d/lkguMGSpcfk2O0J/CWeDQ2QjXx9gOPUp5gR kQhYjqQjF9bizy1sXtQKJg6BL9Xg/Ae8h/uxJfRaWjFwbZaaz/U= =QQPW -----END PGP SIGNATURE----- --uWqoapSGGaQK6EL7--