From nobody Thu Oct 22 10:51:34 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4j9NHs2pJyz6wlQV; Thu, 22 Oct 2026 10:51:37 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4j9NHs1xBjz4L2h; Thu, 22 Oct 2026 10:51:37 +0000 (UTC) (envelope-from kp@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1792666297; 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: in-reply-to:in-reply-to:references:references; bh=AYUIuU/+hYIEdaZz3yXc8/kdqLSTjn9XrVlKY2/JX9Y=; b=ddRF2qSkEsiyBs0FbU4vnimLYF0lOFCZy36BddFVAT8UODxU4zOjawzxJ3fjtHTNBlEqPy HRXpsAP0gv/AGRgYVpMvM67yVdqZHDx0ulmYCqPRqzf1nPeADdGY/59XNVGVc32PVIsi8K tF6OPbkrR7DXiy6vdGBZ2tSwnT+PukK3GaftRbBK0DZksdfOG/wOVOdsqngoo7kbNPTy5U 2MCouFPUkzl80opyJ9t1hqnoQMFREg7X5VUoYsTyQrO0F26KFO1Y/d24RuJPmSofAdxgUS dIO/0MugeeMUbJEEu27/dkK4tUNnH6cgUFaAaukiQ/BagnA48uf1faQEB8Oa9g== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1792666297; b=T54RWjgmRUKs6lY0llpW/ZQiQeqmph2rBAHHNs5ZO9M4ZjDXo8QTLOHZnEa0NCUmCAx4yF o1lAhHAe3ZCmN2TRO2hBm9bAUdtZEs1+k2NY8Er3i2iPWx+vkqt4K9Bi6hHu/gm+N0ABlI eKn4+9z4HGrKWZZPIB/Tn5Tb6FxKYnwvfDG9WivR4y8Tn+iVlNsML9x+M3SPHEZDOldadU 9u1Xwzz4dMSANYg3kpf+SXtd64NBdsEWmPTzA40WVkSDB/WQh+aCWdfWqnrJh1niJZwiG8 YRq41ETNJLokWQxpjD0pz27zDaPMuf86wMQlYLGJb/tk10MMxyUCYECh3c94MA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1792666297; 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: in-reply-to:in-reply-to:references:references; bh=AYUIuU/+hYIEdaZz3yXc8/kdqLSTjn9XrVlKY2/JX9Y=; b=r8rhbLB1Bp8hdAtC16P91lAsas9poqwKMCd9MQ2SxXDPaWnNqr12C2JEbpfuxNut8nSCQf h9UOuu5TmKpAcawQPJlIR59n18RO/fPhjDN8oARIDlkK18tITwrNkscfH8jZ0U2rqjPkXm oUDoml7OJwP1oBRXq8bLkxpCuzMZ5+QputC1Rpy51T9VvWjunN9/4119fXF8EnpLAuGz/D khesFntVQTpveLgkXcdHbdC9lK7iyKGJMaRanqsaYoopDT841YxEUUxWWY5bFB+0UE3iT/ b7nnq4ECBKa/B/szTEu7dsVKmt0xfzjm1resv7cOnveV0b1RhSHmUc/bFjaajg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx1.codepro.be", Issuer "YR1" (not verified)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4j9NHs0KYCzTq7; Thu, 22 Oct 2026 10:51:37 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 25F774C38A; Thu, 22 Oct 2026 12:51:35 +0200 (CEST) From: Kristof Provost To: Gleb Smirnoff Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 7146ad04f18e - main - tcp: refactor tcp_autosndbuf() and associated sysctls Date: Thu, 22 Oct 2026 12:51:34 +0200 X-Mailer: MailMate (2.0r6272) Message-ID: In-Reply-To: <72D36446-63AD-4D3F-8B3E-54A12A788745@FreeBSD.org> References: <6ad9838d.21448.54c59970@gitrepo.freebsd.org> <72D36446-63AD-4D3F-8B3E-54A12A788745@FreeBSD.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: Commit messages for the main branch of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_MailMate_9319CB04-96D3-43AB-BBE3-4B6BA14A274B_=" --=_MailMate_9319CB04-96D3-43AB-BBE3-4B6BA14A274B_= Content-Type: text/plain; charset=UTF-8; format=flowed; markup=markdown Content-Transfer-Encoding: quoted-printable On 22 Oct 2026, at 11:29, Kristof Provost wrote: > On 22 Oct 2026, at 5:31, Gleb Smirnoff wrote: >> The branch main has been updated by glebius: >> >> URL: = >> https://cgit.FreeBSD.org/src/commit/?id=3D7146ad04f18e7f0767a4d44cff43= c1c67ea98cec >> >> commit 7146ad04f18e7f0767a4d44cff43c1c67ea98cec >> Author: Gleb Smirnoff >> AuthorDate: 2026-10-22 03:27:47 +0000 >> Commit: Gleb Smirnoff >> CommitDate: 2026-10-22 03:27:47 +0000 >> >> tcp: refactor tcp_autosndbuf() and associated sysctls >> >> Rename tcp_sndbuf_autoscale() to tcp_autosndbuf(). This matches >> complementary tcp_autorcvbuf() that was factored out as a = >> separate >> function a few months before tcp_sndbuf_autoscale() was. Move = >> the large >> comment to the header of the function. Use unsigned types for = >> all sizing >> sysctls and variables and use bool for the switching sysctl. Add = >> a >> comment above net.inet.tcp.sendbuf_auto_lowat (default to off) = >> providing a >> reference to its origins. Add DTrace probe tcp::send-autoresize, >> complementary to the existing tcp::receive-autoresize. >> >> Rack has its own function, just enable the DTrace probe there. >> >> Reviewed by: tuexen >> Differential Revision: https://reviews.freebsd.org/D60732 >> --- >> sys/netinet/in_kdtrace.c | 4 ++ >> sys/netinet/in_kdtrace.h | 1 + >> sys/netinet/tcp_output.c | 142 = >> +++++++++++++++++++++--------------------- >> sys/netinet/tcp_stacks/bbr.c | 2 +- >> sys/netinet/tcp_stacks/rack.c | 5 +- >> sys/netinet/tcp_var.h | 10 +-- >> 6 files changed, 85 insertions(+), 79 deletions(-) >> > =E2=80=A6 >> index 09295544855f..d11a2b745382 100644 >> --- a/sys/netinet/tcp_output.c >> +++ b/sys/netinet/tcp_output.c > =E2=80=A6 >> void >> -tcp_sndbuf_autoscale(struct tcpcb *tp, struct socket *so, uint32_t = >> sendwin) >> +tcp_autosndbuf(struct tcpcb *tp, u_int sendwin) >> { >> > =E2=80=A6 >> + SOCK_RECVBUF_LOCK_ASSERT(so); >> + > Is this assert right? I=E2=80=99d think autosndbuf is about the send bu= ffer, = > not the receive buffer. > With this patch the system does just work for me: diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index d11a2b745382..b5f36d83f5a2 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -2154,7 +2154,7 @@ tcp_autosndbuf(struct tcpcb *tp, u_int sendwin) struct socket *so =3D tptosocket(tp); u_int lowat, newsize; - SOCK_RECVBUF_LOCK_ASSERT(so); + SOCK_SENDBUF_LOCK_ASSERT(so); if (!V_tcp_do_autosndbuf || (so->so_snd.sb_flags & SB_AUTOSIZE) = =3D=3D 0) return; =E2=80=94 Kristof --=_MailMate_9319CB04-96D3-43AB-BBE3-4B6BA14A274B_= Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On 22 Oct 2026, at 11:29, Kristof Provost wrote:

On 22 Oct 2026, at 5:31, Gleb Smirnoff wrote:

The branch main has been updated by glebius:

URL: https://cgit.FreeBSD.org/src/co= mmit/?id=3D7146ad04f18e7f0767a4d44cff43c1c67ea98cec

commit 7146ad04f18e7f0767a4d44cff43c1c67ea98cec
Author: Gleb Smirnoff glebius@= FreeBSD.org
AuthorDate: 2026-10-22 03:27:47 +0000
Commit: Gleb Smirnoff glebius@= FreeBSD.org
CommitDate: 2026-10-22 03:27:47 +0000

tc=
p: refactor tcp_autosndbuf() and associated sysctls

Rename tcp_sndbuf_autoscale() to tcp_autosndbuf().  This matches
complementary tcp_autorcvbuf() that was factored out as a separate
function a few months before tcp_sndbuf_autoscale() was.  Move the large
comment to the header of the function.  Use unsigned types for all sizing=

sysctls and variables and use bool for the switching sysctl.  Add a
comment above net.inet.tcp.sendbuf_auto_lowat (default to off) providing =
a
reference to its origins.  Add DTrace probe tcp::send-autoresize,
complementary to the existing tcp::receive-autoresize.

Rack has its own function, just enable the DTrace probe there.

Reviewed by:            tuexen
Differential Revision:  https://reviews.freebsd.org/D60732

sys/netinet/in_kdtrace.c | 4 ++
sys/netinet/in_kdtrace.h | 1 +
sys/netinet/tcp_output.c | 142 +++++++++++++++++++++----------------= -----
sys/netinet/tcp_stacks/bbr.c | 2 +-
sys/netinet/tcp_stacks/rack.c | 5 +-
sys/netinet/tcp_var.h | 10 +--
6 files changed, 85 insertions(+), 79 deletions(-)

=E2=80=A6

index 09295544855f..d11a2b745382 100644
--- a/sys/netinet/tcp_output.c
+++ b/sys/netinet/tcp_output.c

=E2=80=A6

void
-tcp_sndbuf_autoscale(struct tcpcb *tp, struct socket *so, uint32_t sendw= in)
+tcp_autosndbuf(struct tcpcb *tp, u_int sendwin)
{

=E2=80=A6

  • SOCK_RECVBUF_LOCK_ASSERT(so);

Is this assert right? I=E2=80=99d think autosndbuf is abo= ut the send buffer, not the receive buffer.

With this patch the system does just work for me:

di=
ff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c
index d11a2b745382..b5f36d83f5a2 100644
--- a/sys/netinet/tcp_output.c
+++ b/sys/netinet/tcp_output.c
@@ -2154,7 +2154,7 @@ tcp_autosndbuf(struct tcpcb *tp, u_int sendwin)
        struct socket *so =3D tptosocket(tp);
        u_int lowat, newsize;

-       SOCK_RECVBUF_LOCK_ASSERT(so);
+       SOCK_SENDBUF_LOCK_ASSERT(so);

        if (!V_tcp_do_autosndbuf || (so->so_snd.sb_flags & SB_AUTO=
SIZE) =3D=3D 0)
                return;

=E2=80=94
Kristof

--=_MailMate_9319CB04-96D3-43AB-BBE3-4B6BA14A274B_=--