From nobody Thu Jan 11 12:19:22 2024 X-Original-To: dev-commits-src-all@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 4T9kHb1Kj6z57JnP; Thu, 11 Jan 2024 12:19:23 +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 4T9kHb0Tpbz40sT; Thu, 11 Jan 2024 12:19:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704975563; 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=zFY9bMAvdFJ1uxsaWduMDtL8AHkzbGuTpZHkvtyj5sQ=; b=la+7GKaakyIf4JDlZth/94I2JWNOoVJVH9jYcCOAuXxkmUtYGDyCmDxssvazGaccsQGiJf QA53bppwFQ4bGRRU6MGKC1yRQCLJi91rM1ngRSkCiJiZuD6JolnR3gtzzpHuMA259pnyX7 8ZsdmeQyCyOF7DdRzv37zOG3gs0NLB1u8iPUhDpg2i0QzxYccv+48Q0eX9rMFcl/RDeBXG AsSnmOHo6YWeyLPg3vLVIDabk24envhHXKDpVEy9wA3Vj3RHzsE9a/hqXOI39QBqZjd2n/ l6HqbOaapzyMa2ZPoCN9imG1+2R+BSaQx4ocOf4lUj6Qa9ltefWKmKALtbfC5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704975563; 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=zFY9bMAvdFJ1uxsaWduMDtL8AHkzbGuTpZHkvtyj5sQ=; b=eJ0p4u/dIoGFTuQwEaOUcG56HjyiLO0YoZBvXT9S0XwPgd1c/J3Rp9plLOJhJyJHr/zqLt iXv8ze5IIeKjse2kPIsDejVvJhbhtrnhLAg/6qMsIO9p0bfA/dhkAInj+qKHDM5m/a2TxP mYaRp3BaywUMlH7BsIidUIgzOqGuioKkBrmzHgxR1WDaS2Nooysc+8k7LRfZuQI5y+GRl5 L0G27tKYr71sN6cIvm52eAhCLipPv1BqHWWQCgYCt4arANpO1DxykOqOA5xhCg6PFQBNBI +xXO5/H2Gz9ZRUkVxm/xkPTJpYUTF1xBTrmSmIokXOmAdhRQ0aQ7QBltno1QLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704975563; a=rsa-sha256; cv=none; b=gUxzDp34QmKsEnB+etim7LrC7YLrujQe4aAobMVMRgqF6tXdZMOoLrVqsV6jXUJp7qZiLF pLwFBoI0ZHXFdX2EsuGpU0+OR/eGllQqWmmRA1OAAc6CtWDV+T9r1NJ0kAJn4ASekn07lC YZr6SpRZy+j0aWW0l46GODoi6E7CbYARpjP2TAFz9QpKFQJa/1mrCvrv5jmlH3wewmWpBa GHAatZNQtwK9OL+U9Dz3agv0G1OGWu3Jhqii3hKPwkZQsUmkeyElaSW21uCM/jRaUZbjxK QEQvicediijXYxJnekAwLfVOCeZQEG6Sa8m/9lcgNQp38hY11vFG7b80CvgcZQ== 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 4T9kHZ6XmmzJWq; Thu, 11 Jan 2024 12:19:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40BCJMKo085226; Thu, 11 Jan 2024 12:19:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40BCJMVQ085223; Thu, 11 Jan 2024 12:19:22 GMT (envelope-from git) Date: Thu, 11 Jan 2024 12:19:22 GMT Message-Id: <202401111219.40BCJMVQ085223@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: 6c9b92e741f0 - stable/13 - sctp: improve consistency List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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: 6c9b92e741f0f878deff8ad3553239155c517a7a Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=6c9b92e741f0f878deff8ad3553239155c517a7a commit 6c9b92e741f0f878deff8ad3553239155c517a7a Author: Michael Tuexen AuthorDate: 2023-07-28 12:36:11 +0000 Commit: Michael Tuexen CommitDate: 2024-01-11 12:18:37 +0000 sctp: improve consistency This is simplifying a patch to address PR 260116. PR: 260116 (cherry picked from commit b279e84a47ddb59e55b5a3cec31c51cd41bf0dc3) --- sys/netinet/sctputil.c | 8 ++------ sys/netinet/sctputil.h | 6 +----- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index d9cfe12861d7..e34cadd27bc8 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -5040,11 +5040,7 @@ sctp_free_bufspace(struct sctp_tcb *stcb, struct sctp_association *asoc, if ((stcb->sctp_socket != NULL) && (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) || ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE)))) { - if (stcb->sctp_socket->so_snd.sb_cc >= tp1->book_size) { - atomic_subtract_int(&((stcb)->sctp_socket->so_snd.sb_cc), tp1->book_size); - } else { - stcb->sctp_socket->so_snd.sb_cc = 0; - } + SCTP_SAVE_ATOMIC_DECREMENT(&stcb->sctp_socket->so_snd.sb_cc, tp1->book_size); } } @@ -6121,7 +6117,7 @@ get_more_data: if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_SB_LOGGING_ENABLE) { sctp_sblog(&so->so_rcv, control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBFREE, (int)cp_len); } - atomic_subtract_int(&so->so_rcv.sb_cc, (int)cp_len); + SCTP_SAVE_ATOMIC_DECREMENT(&so->so_rcv.sb_cc, (int)cp_len); if ((control->do_not_ref_stcb == 0) && stcb) { atomic_subtract_int(&stcb->asoc.sb_cc, (int)cp_len); diff --git a/sys/netinet/sctputil.h b/sys/netinet/sctputil.h index 1f450a264939..9026fd09a0be 100644 --- a/sys/netinet/sctputil.h +++ b/sys/netinet/sctputil.h @@ -251,11 +251,7 @@ do { \ } \ if (stcb->sctp_socket && ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || \ (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { \ - if (stcb->sctp_socket->so_snd.sb_cc >= sp->length) { \ - atomic_subtract_int(&stcb->sctp_socket->so_snd.sb_cc,sp->length); \ - } else { \ - stcb->sctp_socket->so_snd.sb_cc = 0; \ - } \ + SCTP_SAVE_ATOMIC_DECREMENT(&stcb->sctp_socket->so_snd.sb_cc, sp->length); \ } \ } \ } while (0)