From nobody Thu Oct 22 09:29:30 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 4j9LTB64Bsz6wclB; Thu, 22 Oct 2026 09:29:34 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 4j9LTB5DV3z3Np0; Thu, 22 Oct 2026 09:29:34 +0000 (UTC) (envelope-from kp@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1792661374; 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=Jii+BLbNzftPwh926mWwDV5jK58YpL7yT5qawVKESKY=; b=EEl1ZcEC3KNy8ksa6jjbvLynFaA8k8ggHVh2TGSB0AvWOeFLpvabEZ4ovW4yb4tQTXCkom qdOJo0sL9NVF207Ci43SjhiUA9ys8T8ssIBcl/8dpkQg/FNFhXQa0lLD36e2pM1s3UQd0y 2rTAzVYTYlYuYvcZE3p2kVJ9WJaJOSNKJttowkuy8CRnai7Njn/4C9QKQIBQjBsZM00AxI tbYP45wTNocqyVEiQXmrhgOBp0a7rhAbhbDtcvBRuqJqydH8/w8AqvModENV8prCKSVim2 eWaBC7gE0Cv5pt6+UvEcxHFHjZepvXrggcTsND4bzlA7OFfX3MKnC+YDRNoFug== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1792661374; b=cbBpeu/mmzwoZkKjQF5qFWszk1NPtENsMNL8bJFmiLtG6+VtDPCqPtrmXzNvIty8B3tQUY llPBl50YGYpLW8ZsmIh8COlrYcciHLfWp9AC3HOf8cbU6JO+2i2lF+P6q2Dg5uX1li0jVn IQP2OSNEN3HpWcDcmOWq9qnX7T38lyJvqi2trD3DaW9LdRKdsh1qWZBpFpkNvlM2GAdQGv fqI8eO5EJi4SbIPch9X/gL0QHe9RELgPeSzZtm/k69zETP//gbY7z0EzFcH95nwxAiMXoc HMokhQqrfHweSHOngQiAEfBP9jnmxIqWRdFf1L+OQ0VuYRp2mxuk4H5taH2TnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1792661374; 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=Jii+BLbNzftPwh926mWwDV5jK58YpL7yT5qawVKESKY=; b=HOWz6/7JkP1Fc/oWJUdsR01Z3kukqaP4aTMDPTRy9EU8pUnj8kj4xe3weiYqeidppXECgL 4prmj9dQd4QsJxSN7R1NMEAfXeAxzhOCLfWRVxwDw0QGzmurPjBjqq502qhlrUMZoAoZBo lPm6BrZFcsGa3fLL8ZpnXM/dSIwzTWeo1cX/rRSLIkZyTL/oDxWHchs0g3f4jYhtrbPbTp dACqtcuA+BW4FBRklTWssJKqGRrZ46orxPZn39dumE99X/xU9ayVwzsftfeZVwOAY1TKCP 4Zb7+XG+6nujBuFUZjlhpA6ChZcBAoJ70DCxYoHtQZ5dFYwJB64KElIHW4uZVA== 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 4j9LTB3L2nz1h5s; Thu, 22 Oct 2026 09:29:34 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 4DE674AE36; Thu, 22 Oct 2026 11:29:31 +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 11:29:30 +0200 X-Mailer: MailMate (2.0r6272) Message-ID: <72D36446-63AD-4D3F-8B3E-54A12A788745@FreeBSD.org> In-Reply-To: <6ad9838d.21448.54c59970@gitrepo.freebsd.org> References: <6ad9838d.21448.54c59970@gitrepo.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_65EB42A7-3680-48E0-863C-2ECB2A199FE8_=" --=_MailMate_65EB42A7-3680-48E0-863C-2ECB2A199FE8_= Content-Type: text/plain; charset=UTF-8; format=flowed; markup=markdown Content-Transfer-Encoding: quoted-printable 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=3D7146ad04f18e7f0767a4d44cff43c= 1c67ea98cec > > 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 buff= er, = not the receive buffer. I=E2=80=99m seeing this panic whenever I try to ssh into my dev box: panic: mutex so_rcv not owned at /usr/src/sys/netinet/tcp_output.c:2157 cpuid =3D 4 time =3D 1792657806 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x36/frame = 0xfffffe00343b34a0 vpanic() at vpanic+0x149/frame 0xfffffe00343b35d0 panic() at panic+0x43/frame 0xfffffe00343b3630 __mtx_assert() at __mtx_assert+0xa9/frame 0xfffffe00343b3640 tcp_autosndbuf() at tcp_autosndbuf+0x32/frame 0xfffffe00343b3670 tcp_default_output() at tcp_default_output+0x651/frame = 0xfffffe00343b3840 tcp_do_segment() at tcp_do_segment+0x2db5/frame 0xfffffe00343b3940 tcp_input_with_port() at tcp_input_with_port+0x10ec/frame = 0xfffffe00343b3a90 tcp_input() at tcp_input+0xb/frame 0xfffffe00343b3aa0 ip_input() at ip_input+0x271/frame 0xfffffe00343b3b00 netisr_dispatch_src() at netisr_dispatch_src+0xbf/frame = 0xfffffe00343b3b60 ether_demux() at ether_demux+0x17a/frame 0xfffffe00343b3ba0 ether_nh_input() at ether_nh_input+0x3b4/frame 0xfffffe00343b3bf0 netisr_dispatch_src() at netisr_dispatch_src+0xbf/frame = 0xfffffe00343b3c50 ether_input() at ether_input+0xe9/frame 0xfffffe00343b3cb0 iflib_rxeof() at iflib_rxeof+0x919/frame 0xfffffe00343b3de0 _task_fn_rx() at _task_fn_rx+0xce/frame 0xfffffe00343b3e30 gtaskqueue_run_locked() at gtaskqueue_run_locked+0x1a8/frame = 0xfffffe00343b3ec0 gtaskqueue_thread_loop() at gtaskqueue_thread_loop+0xd3/frame = 0xfffffe00343b3ef0 fork_exit() at fork_exit+0x82/frame 0xfffffe00343b3f30 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe00343b3f30 --- trap 0xafafafaf, rip =3D 0xafafafafafafafaf, rsp =3D = 0xafafafafafafafaf, rbp =3D 0xafafafafafafafaf --- =E2=80=94 Kristof --=_MailMate_65EB42A7-3680-48E0-863C-2ECB2A199FE8_= Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

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.
I=E2=80=99m seeing this panic whenever I try to ssh into my dev box:

pa=
nic: mutex so_rcv not owned at /usr/src/sys/netinet/tcp_output.c:2157
cpuid =3D 4
time =3D 1792657806
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x36/frame 0xfffffe00343=
b34a0
vpanic() at vpanic+0x149/frame 0xfffffe00343b35d0
panic() at panic+0x43/frame 0xfffffe00343b3630
__mtx_assert() at __mtx_assert+0xa9/frame 0xfffffe00343b3640
tcp_autosndbuf() at tcp_autosndbuf+0x32/frame 0xfffffe00343b3670
tcp_default_output() at tcp_default_output+0x651/frame 0xfffffe00343b3840=

tcp_do_segment() at tcp_do_segment+0x2db5/frame 0xfffffe00343b3940
tcp_input_with_port() at tcp_input_with_port+0x10ec/frame 0xfffffe00343b3=
a90
tcp_input() at tcp_input+0xb/frame 0xfffffe00343b3aa0
ip_input() at ip_input+0x271/frame 0xfffffe00343b3b00
netisr_dispatch_src() at netisr_dispatch_src+0xbf/frame 0xfffffe00343b3b6=
0
ether_demux() at ether_demux+0x17a/frame 0xfffffe00343b3ba0
ether_nh_input() at ether_nh_input+0x3b4/frame 0xfffffe00343b3bf0
netisr_dispatch_src() at netisr_dispatch_src+0xbf/frame 0xfffffe00343b3c5=
0
ether_input() at ether_input+0xe9/frame 0xfffffe00343b3cb0
iflib_rxeof() at iflib_rxeof+0x919/frame 0xfffffe00343b3de0
_task_fn_rx() at _task_fn_rx+0xce/frame 0xfffffe00343b3e30
gtaskqueue_run_locked() at gtaskqueue_run_locked+0x1a8/frame 0xfffffe0034=
3b3ec0
gtaskqueue_thread_loop() at gtaskqueue_thread_loop+0xd3/frame 0xfffffe003=
43b3ef0
fork_exit() at fork_exit+0x82/frame 0xfffffe00343b3f30
fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe00343b3f30
--- trap 0xafafafaf, rip =3D 0xafafafafafafafaf, rsp =3D 0xafafafafafafaf=
af, rbp =3D 0xafafafafafafafaf ---

=E2=80=94
Kristof

--=_MailMate_65EB42A7-3680-48E0-863C-2ECB2A199FE8_=--