From nobody Tue Feb 22 23:00:13 2022 X-Original-To: dev-commits-src-branches@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 02D2F19EA144; Tue, 22 Feb 2022 23:00:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4K3F4Y6hMvz3mqt; Tue, 22 Feb 2022 23:00:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645570813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0bbh51leg8M5PJC7auzGuvW1Fzj1EwbLo49UCi4Xrxs=; b=muTAaYcQPVV1x4weEdHcudE41G7APu4cIf+7oQ1BXHCLLvRqnEqcyAmAoZA943oQo0EfIW RqqhdIXxDE9EIwNbWh75WrNtesEsCKknhNzRNnzTBSi9LmUQlTeAWsjBJFQzLunTlUFu59 ZAkeOQMtUeATbfXWAyKlbiyYXphPFeIwfvHSl2w8nJofdtL4ccHegdhrboyHsL5+rHgiON I6e75jam+SAgUjodQIX6xBga4cV6IBfIPIcN8EubCbT29pQFFBRH8FOYssF8TMCcEv0nBM uabUJhD9h6gAIVdGeaVNzUIgXJZ2RCJkKLxr9OTUdQwCkjcphVuD8jELHpNGaQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C733A4FBE; Tue, 22 Feb 2022 23:00:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 21MN0Do0076231; Tue, 22 Feb 2022 23:00:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21MN0Dxg076227; Tue, 22 Feb 2022 23:00:13 GMT (envelope-from git) Date: Tue, 22 Feb 2022 23:00:13 GMT Message-Id: <202202222300.21MN0Dxg076227@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 0f448d433847 - stable/13 - sctp: improve KASSERT messages List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0f448d433847ea996ed993b11ade8fd2a0aa6639 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645570813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0bbh51leg8M5PJC7auzGuvW1Fzj1EwbLo49UCi4Xrxs=; b=H9DtaRbs/79fCa1+GjzAqzjnsIYC8rzT1DEeIqCzKhSm+qvLwrszx7QaKIXoVD3tD/0GAk JEIMvDYlrEOwrBFoiZbNSrrNOCZyp3p7LM04W0U9GXjzzdnkqjPs3xr+3KKgklZjLagUzA 6NzLIL363nlmVaWmI/XjnEJH93Z+dzQbZqnzUxkit58jEQB3mGtF+2Lvi9X0REowxYM84e XwBOpehXFj6QUyLhgEnhSfz2vDStoMQTyKlVpcu8zsRK8qb40SedQuvb5EuCBSv01xWKIg VsLijDs1gPAcJY29tOQ8XRNWVOopkUIKtBgUDpQwdrbWgLuz7OX8GiChUSCGEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645570813; a=rsa-sha256; cv=none; b=jbRFPcw6zDDXzhnQokfWGH1nWfrNJcSfEeMCsN1rn2e1Ut37IazjLmtWwIWsuYN5za0NTA Ki8TWP+teD57k3teYOIjkNNouzva/WJRdl6X8IDrMP12tlcbZLzmMxoPIqt8dlzZYpCxnv aOeQMdtps7ZJc/cA/gt9JJz6VcuS0VBlOonNDHelNu/jrjJw2qwsopzFDQHzTcOJ/Gga+h LXrDFg9eR8PsbK+SuOujy9Wc7+vebQHLH8g9QyA4/cBUwGn29la3Ym8z2BAhjdp5jlnub0 vDq5G+Vo0tzi5iDQG8F849avYpPZziUzcqACLqQQph7SoeQWjj0szvzpJ9D7Yg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=0f448d433847ea996ed993b11ade8fd2a0aa6639 commit 0f448d433847ea996ed993b11ade8fd2a0aa6639 Author: Michael Tuexen AuthorDate: 2021-10-08 09:32:55 +0000 Commit: Michael Tuexen CommitDate: 2022-02-22 22:59:52 +0000 sctp: improve KASSERT messages (cherry picked from commit bd19202c92e3d73e90aedd518f0963797744e50f) --- sys/netinet/sctp_ss_functions.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/sys/netinet/sctp_ss_functions.c b/sys/netinet/sctp_ss_functions.c index c08bec07c588..23b1dc20e4cf 100644 --- a/sys/netinet/sctp_ss_functions.c +++ b/sys/netinet/sctp_ss_functions.c @@ -165,20 +165,20 @@ sctp_ss_default_select(struct sctp_tcb *stcb SCTP_UNUSED, struct sctp_nets *net, { struct sctp_stream_out *strq, *strqt; - if (asoc->ss_data.locked_on_sending) { + if (asoc->ss_data.locked_on_sending != NULL) { KASSERT(asoc->ss_data.locked_on_sending->ss_params.scheduled, - ("strq %p not scheduled", + ("locked_on_sending %p not scheduled", (void *)asoc->ss_data.locked_on_sending)); return (asoc->ss_data.locked_on_sending); } strqt = asoc->ss_data.last_out_stream; + KASSERT(strqt == NULL || strqt->ss_params.scheduled, + ("last_out_stream %p not scheduled", (void *)strqt)); default_again: /* Find the next stream to use */ if (strqt == NULL) { strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); } else { - KASSERT(strqt->ss_params.scheduled, - ("strq %p not scheduled", (void *)strqt)); strq = TAILQ_NEXT(strqt, ss_params.ss.rr.next_spoke); if (strq == NULL) { strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); @@ -332,13 +332,13 @@ sctp_ss_rrp_packet_done(struct sctp_tcb *stcb SCTP_UNUSED, struct sctp_nets *net struct sctp_stream_out *strq, *strqt; strqt = asoc->ss_data.last_out_stream; + KASSERT(strqt == NULL || strqt->ss_params.scheduled, + ("last_out_stream %p not scheduled", (void *)strqt)); rrp_again: /* Find the next stream to use */ if (strqt == NULL) { strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); } else { - KASSERT(strqt->ss_params.scheduled, - ("strq %p not scheduled", (void *)strqt)); strq = TAILQ_NEXT(strqt, ss_params.ss.rr.next_spoke); if (strq == NULL) { strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); @@ -484,20 +484,20 @@ sctp_ss_prio_select(struct sctp_tcb *stcb SCTP_UNUSED, struct sctp_nets *net, { struct sctp_stream_out *strq, *strqt, *strqn; - if (asoc->ss_data.locked_on_sending) { + if (asoc->ss_data.locked_on_sending != NULL) { KASSERT(asoc->ss_data.locked_on_sending->ss_params.scheduled, - ("strq %p not scheduled", + ("locked_on_sending %p not scheduled", (void *)asoc->ss_data.locked_on_sending)); return (asoc->ss_data.locked_on_sending); } strqt = asoc->ss_data.last_out_stream; + KASSERT(strqt == NULL || strqt->ss_params.scheduled, + ("last_out_stream %p not scheduled", (void *)strqt)); prio_again: /* Find the next stream to use */ if (strqt == NULL) { strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); } else { - KASSERT(strqt->ss_params.scheduled, - ("strq %p not scheduled", (void *)strqt)); strqn = TAILQ_NEXT(strqt, ss_params.ss.prio.next_spoke); if (strqn != NULL && strqn->ss_params.ss.prio.priority == strqt->ss_params.ss.prio.priority) { @@ -656,9 +656,9 @@ sctp_ss_fb_select(struct sctp_tcb *stcb SCTP_UNUSED, struct sctp_nets *net, { struct sctp_stream_out *strq = NULL, *strqt; - if (asoc->ss_data.locked_on_sending) { + if (asoc->ss_data.locked_on_sending != NULL) { KASSERT(asoc->ss_data.locked_on_sending->ss_params.scheduled, - ("strq %p not scheduled", + ("locked_on_sending %p not scheduled", (void *)asoc->ss_data.locked_on_sending)); return (asoc->ss_data.locked_on_sending); }