From nobody Tue Feb 22 23:27:57 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 F2EAF19C8C4A; Tue, 22 Feb 2022 23:27:57 +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 4K3FhY6Ymkz3t7f; Tue, 22 Feb 2022 23:27:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645572477; 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=L060DP6sTf5z0TVdi0xdqrT5o+6VSiBdbfRpdt0ywIE=; b=bd/OhhKpt6VTFhEBAI93lrVNfKyn64V8ns4S9k1bwynBLsfWs+iwpM9pBw7/nQ8vWWXDFj RpxZaijcrxEa89KxQfT7nIt0dOynM8FFPobPiKZwa+YXdtRPiFS8RWZPfIsEzrvSDjSqCZ uKbR0gWz49XytJiEtAwocK55jw8MWmYP+baFeCPuFf99MCgNpAV5U+TbUNBjWZHxNIHhNW D78joNWo2+6m0bzki8CwTarWqJXf6ZpesW1XHYDyI857TZA3AoC4IVNv501KN2BfbvBWFp UgtNO2uYLCXGhLUb1sbtG/+uTLoQrHGjymI97OXIUsMJl5FXAWuFFtI7+TCJNg== 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 C0E8F5257; Tue, 22 Feb 2022 23:27:57 +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 21MNRvgT011677; Tue, 22 Feb 2022 23:27:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21MNRvm6011676; Tue, 22 Feb 2022 23:27:57 GMT (envelope-from git) Date: Tue, 22 Feb 2022 23:27:57 GMT Message-Id: <202202222327.21MNRvm6011676@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: f801f2c76267 - stable/13 - sctp: improve consistency, no functional change intended 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: f801f2c76267096cbc8273a54bcf33299cbca3a1 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645572477; 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=L060DP6sTf5z0TVdi0xdqrT5o+6VSiBdbfRpdt0ywIE=; b=prXZ7FJjBNz+0QuS5cAqXaeDUznmKmHkkENiDirpDM2uLF848gUUCKglpVYAY15HfTSO8/ 2QoYN4u/k9nfiQIYil71tAbI/0DwtnXl8w4xCxtZcXjWj5R9eD4hY9PSW2ygzjnnCeWInS wlsPWL3k98LbnaO+xHhsdHPNNDjzp5JRLSTC1XC4AtPuqZE9HnSXHe5pQIJalajQoYztRq EtQSRzso+EWkhMmWa/PYL4v/1/S9VwDZHHr15lAyIXW57/3IIJJIDQbaVBHXM2l873UV4m W7HgcoIb/hEJ3riM2xiKmd13di7UbM+DWsojzae59FJMxreb+sTVhNFC0/a+dA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645572477; a=rsa-sha256; cv=none; b=uxVivL9D+XnFfpvsMQE2BID4LUvKBqP2VEsUWpauiIAfspPNn2KVXlRdGZ9M+taQw+/zGa Mn2I7UJjmpjqDITAJ8bhiMxL7mVIPpaUDK+MtZWYUUufOzqclb5J5NlrrtkHmGdiocai1p nNW3itKrIp380hF5uXPcq2t7iVlMgKwDvRxCTmtjjvtJpgqopZsZOlzAMHASRBNTqrPiSl xyGG/07lb1dY3lHLLPOb12yI2bekMpdtaI02mlYqSm7k6ahnWpsy71EZkGoZJD12KAIwXU x0kTXk7JxIyQHTDxVaJNspEqahCS+joL91EAjwdfxMc5lka2oJYfuc9QonQrJw== 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=f801f2c76267096cbc8273a54bcf33299cbca3a1 commit f801f2c76267096cbc8273a54bcf33299cbca3a1 Author: Michael Tuexen AuthorDate: 2021-11-26 11:53:12 +0000 Commit: Michael Tuexen CommitDate: 2022-02-22 23:27:28 +0000 sctp: improve consistency, no functional change intended (cherry picked from commit 3c1ba6f394d2711beabc961f0bda10e1212b7ca6) --- sys/netinet/sctp_input.c | 2 +- sys/netinet/sctp_output.c | 12 ++++++------ sys/netinet/sctp_pcb.c | 8 ++++---- sys/netinet/sctputil.c | 14 +++++++------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index dc8e73fbd08c..f707bc1de11e 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -1806,7 +1806,7 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, SCTP_INP_INFO_WLOCK(); SCTP_INP_WLOCK(stcb->sctp_ep); SCTP_TCB_LOCK(stcb); - atomic_add_int(&stcb->asoc.refcnt, -1); + atomic_subtract_int(&stcb->asoc.refcnt, 1); /* send up all the data */ SCTP_TCB_SEND_LOCK(stcb); diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index 2f5183bacc9a..31742e661279 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -5832,7 +5832,7 @@ do_a_abort: itsn = sctp_select_initial_TSN(&inp->sctp_ep); initack->init.initial_tsn = htonl(itsn); SCTP_TCB_LOCK(stcb); - atomic_add_int(&asoc->refcnt, -1); + atomic_subtract_int(&asoc->refcnt, 1); } else { SCTP_INP_INCR_REF(inp); SCTP_INP_RUNLOCK(inp); @@ -6648,7 +6648,7 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, struct sctp_tcb *stcb, void *ptr, * relock.. to unlock in the iterator timer :-0 */ SCTP_TCB_LOCK(stcb); - atomic_add_int(&stcb->asoc.refcnt, -1); + atomic_subtract_int(&stcb->asoc.refcnt, 1); goto no_chunk_output; } else { if (m) { @@ -6720,7 +6720,7 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, struct sctp_tcb *stcb, void *ptr, atomic_add_int(&stcb->asoc.refcnt, 1); sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, false, SCTP_SO_NOT_LOCKED); - atomic_add_int(&stcb->asoc.refcnt, -1); + atomic_subtract_int(&stcb->asoc.refcnt, 1); goto no_chunk_output; } sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, stcb->sctp_ep, stcb, @@ -12980,7 +12980,7 @@ sctp_lower_sosend(struct socket *so, if (hold_tcblock == 0) { SCTP_TCB_LOCK(stcb); } - atomic_add_int(&stcb->asoc.refcnt, -1); + atomic_subtract_int(&stcb->asoc.refcnt, 1); free_cnt_applied = 0; /* release this lock, otherwise we hang on ourselves */ NET_EPOCH_ENTER(et); @@ -13552,7 +13552,7 @@ dataless_eof: abort_anyway: if (free_cnt_applied) { - atomic_add_int(&stcb->asoc.refcnt, -1); + atomic_subtract_int(&stcb->asoc.refcnt, 1); free_cnt_applied = 0; } SCTP_SNPRINTF(msg, sizeof(msg), @@ -13693,7 +13693,7 @@ out_unlocked: SCTP_TCB_UNLOCK(stcb); } if (stcb && free_cnt_applied) { - atomic_add_int(&stcb->asoc.refcnt, -1); + atomic_subtract_int(&stcb->asoc.refcnt, 1); } #ifdef INVARIANTS if (stcb) { diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 28e09486882f..e2460eba636a 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -4890,7 +4890,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int from_inpcbfre */ /* re-increment the lock */ if (from_inpcbfree == SCTP_NORMAL_PROC) { - atomic_add_int(&stcb->asoc.refcnt, -1); + atomic_subtract_int(&stcb->asoc.refcnt, 1); } if (stcb->asoc.refcnt) { SCTP_CLEAR_SUBSTATE(stcb, SCTP_STATE_IN_ACCEPT_QUEUE); @@ -6078,7 +6078,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, struct mbuf *m, inp = stcb->sctp_ep; atomic_add_int(&stcb->asoc.refcnt, 1); stcb_tmp = sctp_findassociation_ep_addr(&inp, sa, &net_tmp, dst, stcb); - atomic_add_int(&stcb->asoc.refcnt, -1); + atomic_subtract_int(&stcb->asoc.refcnt, 1); if ((stcb_tmp == NULL && inp == stcb->sctp_ep) || inp == NULL) { /* we must add the source address */ @@ -6162,7 +6162,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, struct mbuf *m, atomic_add_int(&stcb->asoc.refcnt, 1); stcb_tmp = sctp_findassociation_ep_addr(&inp, sa, &net, dst, stcb); - atomic_add_int(&stcb->asoc.refcnt, -1); + atomic_subtract_int(&stcb->asoc.refcnt, 1); if ((stcb_tmp == NULL && inp == stcb->sctp_ep) || inp == NULL) { @@ -6261,7 +6261,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, struct mbuf *m, atomic_add_int(&stcb->asoc.refcnt, 1); stcb_tmp = sctp_findassociation_ep_addr(&inp, sa, &net, dst, stcb); - atomic_add_int(&stcb->asoc.refcnt, -1); + atomic_subtract_int(&stcb->asoc.refcnt, 1); if (stcb_tmp == NULL && (inp == stcb->sctp_ep || inp == NULL)) { /* diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index 738f68af7799..8322603438c3 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -1541,7 +1541,7 @@ select_a_new_ep: if (sctp_it_ctl.iterator_flags) { /* We won't be staying here */ SCTP_INP_DECR_REF(it->inp); - atomic_add_int(&it->stcb->asoc.refcnt, -1); + atomic_subtract_int(&it->stcb->asoc.refcnt, 1); if (sctp_it_ctl.iterator_flags & SCTP_ITERATOR_STOP_CUR_IT) { sctp_it_ctl.iterator_flags &= ~SCTP_ITERATOR_STOP_CUR_IT; @@ -1560,7 +1560,7 @@ select_a_new_ep: SCTP_INP_RLOCK(it->inp); SCTP_INP_DECR_REF(it->inp); SCTP_TCB_LOCK(it->stcb); - atomic_add_int(&it->stcb->asoc.refcnt, -1); + atomic_subtract_int(&it->stcb->asoc.refcnt, 1); iteration_count = 0; } KASSERT(it->inp == it->stcb->sctp_ep, @@ -1780,7 +1780,7 @@ sctp_timeout_handler(void *t) * necessary below. This is safe now that we have acquired * the lock. */ - atomic_add_int(&stcb->asoc.refcnt, -1); + atomic_subtract_int(&stcb->asoc.refcnt, 1); released_asoc_reference = true; if ((type != SCTP_TIMER_TYPE_ASOCKILL) && ((stcb->asoc.state == SCTP_STATE_EMPTY) || @@ -2116,7 +2116,7 @@ out_decr: SCTP_INP_DECR_REF(inp); } if ((stcb != NULL) && !released_asoc_reference) { - atomic_add_int(&stcb->asoc.refcnt, -1); + atomic_subtract_int(&stcb->asoc.refcnt, 1); } if (net != NULL) { sctp_free_remote_addr(net); @@ -2873,7 +2873,7 @@ sctp_timer_stop(int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb, tmr->ep = NULL; } if (tmr->tcb != NULL) { - atomic_add_int(&stcb->asoc.refcnt, -1); + atomic_subtract_int(&stcb->asoc.refcnt, 1); tmr->tcb = NULL; } if (tmr->net != NULL) { @@ -5501,7 +5501,7 @@ out: SCTP_INP_DECR_REF(stcb->sctp_ep); no_lock: - atomic_add_int(&stcb->asoc.refcnt, -1); + atomic_subtract_int(&stcb->asoc.refcnt, 1); return; } @@ -6446,7 +6446,7 @@ out: } /* Save the value back for next time */ stcb->freed_by_sorcv_sincelast = freed_so_far; - atomic_add_int(&stcb->asoc.refcnt, -1); + atomic_subtract_int(&stcb->asoc.refcnt, 1); } if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_RECV_RWND_LOGGING_ENABLE) { if (stcb) {