From nobody Thu Aug 7 12:46:59 2025 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 4byRkY55mQz64Dx3; Thu, 07 Aug 2025 12:47:01 +0000 (UTC) (envelope-from tuexen@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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4byRkY38hkz3w99; Thu, 07 Aug 2025 12:47:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754570821; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MA/c9WrC0KQdh1vUlqtRgnWKw1Zgp9wdydYdVBbXv6g=; b=XnbVNmR2fW2qTtPoPRa03+zCaVBAfgL3suLUsqBtPwmnjg9YQyafB6YxdqMwdCZ2gEcEYU ODjtUfgj73i+3Cr3PEVt6TzxkDt3s7EsYx51FPaqlAa4UnpZLoq8z9YUm9bpRSTvBwCTsK E7ot2Q1lZtARDxleQ+kcSZ5ieSHXLOqX7KzangJMOUgy6IreyXUQAaI4IcdYkV4M22yCb9 3RtuGFjL8d2NwZLspDUNNYUhYcAnQOuvZauL5Iv5vctJho1uF/XvTVnq+/RM8eBN6kj5eD bOlNWp2Ms+3F5MdrxxLCyQC5XbZpYl8iNSmyXoI0edjbYzTBFCiCTAZKGpV8Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754570821; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MA/c9WrC0KQdh1vUlqtRgnWKw1Zgp9wdydYdVBbXv6g=; b=ACgwqwY+gf6as5FfROfctVdVIRJWPInO/FXMZN8Z+sY25oKwhxDGsSyM7Mnb3evq70NDdl PzmnpTp6oiuy+oRj8QenCjq1Z8Hi/diMHNonHEss912jxFr3V6PpGRlua/45ZLoSL68n5X mCyw8YQ1Dcld9ZrxYUWWVDb96aID1rSLhuacJBBCwirE/rYnvW9KiZMMXQluTdGMOrMnks 8Wu3LoFa6dNhD/Kr35xkTu4nAF2bJ1m9txdcY0PG1KXM2wniUdjis4Ye9kCQz2TGsSmZDF GtZVdunik5GZPznkFbJws+DOr9f1WnX22A5XQYLESUtuugqJKU48gnB1p585HQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754570821; a=rsa-sha256; cv=none; b=LF6WwEJ6nby8oHqchSyCCNgNn6Kok7CiimfhfvUtvXlKWG6o1sLcsx2a8lS/UG83nMRtME TDwfJ3FTEEDODeM8tz3y2PbKwOi0kT6qVFyInD5h4PevID+FNx0s4RBU9BW3LsKzgXkNVR nM7CO/ket2qLCol9a44ED2qW11Zlmy8vPdyi48zJBqzzIQQElLujimZN8xwwj1TA60yDoT LxqTyZEI1cxgka4KWwQRnL2OGoBFSsVlCOlpNbRafJ3HpMeXR49R0C2v/HtGQSqt0bYN5u 6R5IoNV1sGk3ZGwdTpB99VKB4I04nTlrnRXWRPqRJziesdMj1UvVYlttS2mKtg== Received: from smtpclient.apple (unknown [IPv6:2a02:8109:1101:be00:3835:31e9:a7ec:b401]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: tuexen) by smtp.freebsd.org (Postfix) with ESMTPSA id 4byRkX60sCz10CM; Thu, 07 Aug 2025 12:47:00 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\)) Subject: Re: git: feeb19201dca - main - tcp: improve consistency of KASSERTs in tcp_sack.c From: Michael Tuexen In-Reply-To: Date: Thu, 7 Aug 2025 14:46:59 +0200 Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <8C353AC5-6E5E-45B6-AC48-D3001A37D4D8@FreeBSD.org> References: <202508060830.5768UUcN052133@gitrepo.freebsd.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.3826.700.81) > On 7. Aug 2025, at 00:29, Gleb Smirnoff wrote: >=20 > On Wed, Aug 06, 2025 at 08:30:30AM +0000, Michael Tuexen wrote: > M> When panicing, don't print the condition, which was violated, > M> but the condition which holds at the time of the panic. > M> =20 > M> Reviewed by: Nick Banks > M> MFC after: 1 week > M> Sponsored by: Netflix, Inc. > M> Differential Revision: https://reviews.freebsd.org/D51726 > M> --- > M> sys/netinet/tcp_sack.c | 30 +++++++++++++++++------------- > M> 1 file changed, 17 insertions(+), 13 deletions(-) > M>=20 > M> diff --git a/sys/netinet/tcp_sack.c b/sys/netinet/tcp_sack.c > M> index 4405098a8620..f48e60207cc2 100644 > M> --- a/sys/netinet/tcp_sack.c > M> +++ b/sys/netinet/tcp_sack.c > M> @@ -283,7 +283,7 @@ tcp_update_sack_list(struct tcpcb *tp, tcp_seq = rcv_start, tcp_seq rcv_end) > M> INP_WLOCK_ASSERT(tptoinpcb(tp)); > M> =20 > M> /* Check arguments. */ > M> - KASSERT(SEQ_LEQ(rcv_start, rcv_end), ("rcv_start <=3D rcv_end")); > M> + KASSERT(SEQ_LEQ(rcv_start, rcv_end), ("SEG_GT(rcv_start, = rcv_end)")); > M> =20 > M> if ((rcv_start =3D=3D rcv_end) && > M> (tp->rcv_numsacks >=3D 1) && > M> @@ -498,8 +498,8 @@ tcp_sackhole_free(struct tcpcb *tp, struct = sackhole *hole) > M> tp->snd_numholes--; > M> atomic_subtract_int(&V_tcp_sack_globalholes, 1); > M> =20 > M> - KASSERT(tp->snd_numholes >=3D 0, ("tp->snd_numholes >=3D 0")); > M> - KASSERT(V_tcp_sack_globalholes >=3D 0, ("tcp_sack_globalholes >=3D = 0")); > M> + KASSERT(tp->snd_numholes >=3D 0, ("tp->snd_numholes < 0")); > M> + KASSERT(V_tcp_sack_globalholes >=3D 0, ("tcp_sack_globalholes < = 0")); >=20 > IMHO, better just through MPASS() instead of self-repetitive KASSERT. Up to now, tcp_sack.c does not use MPASS(). So I wanted to stay = consistent.. I just go confused when looking at the panic messages from tcp_sack.c. Some messages printed the condition which should hold, some the = condition which holds. Best regards Michael >=20 > --=20 > Gleb Smirnoff