From nobody Wed Feb 01 23:22:35 2023 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 4P6dHb4207z3cKGW; Wed, 1 Feb 2023 23:22:35 +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 4P6dHb3Txlz3JDv; Wed, 1 Feb 2023 23:22:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675293755; 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=fPZSe4l5XEMrP/K6JOfRZpnCkZpHOOa2qigzON8GPVU=; b=WUN8+9zMOZyR0eRLbK3dRrK5HkS0Q2+7nhAvVWnygljfjbUm64zv1UF7pitYfKY/81U6n/ rX1jWyR9/rMl/0K2WXfUH5os8b+mJzqWjxVDH6YbsyxeZgdTSI4aUeZWLGtwNCe5eLC2xs NFle/EIbFJASetYeHWcXDvP7Q5kxHrG8m9d0ujZdyZrRpYYB1kqPHbru+ey9T6nDmpieL/ 4aZpy9Ya3sbb/B/GZUr7dhnV6sk9eAyQLl2C/2jih424PcKApuu+in2fsjjPG2RxAG1xdK jQ6vQNc6h0dfamgfRYBrmneoiXClM7XXryTg4gcKchvVqk8GhcdtEbR5InrJHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675293755; 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=fPZSe4l5XEMrP/K6JOfRZpnCkZpHOOa2qigzON8GPVU=; b=GkgIIjLJWVeKHwxJ2OybxIoZChtz+zZyy3gvkM6LjPKaaot6w3/kbvDO7PPFgqfLn27ECT DyCH7hxXDSB2Od+FewyqTJh+RF3r7pZa6VzC3V0C/uMDe2tdOwtROKJtpKwCwqw522bbUA /jcN+pr2eMEM/+0h/qO47n389kQ+PJRnM/fXOnMvND9Gz+C70XqM4cGSMM9bsPyc2rTJVr 3vH/hSRyVNuLPaAawjWo8QhACb9SMWoMH7wnMdI1J05NlX9fG5A5HiY2hDKNbzED6hGKtp hgpScy69Kjuddw9J4pLVps9ZVlLJ7VSUySwiOGIsO8x4xLmr7eQwJhf9KwCnuw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675293755; a=rsa-sha256; cv=none; b=Tt0VJFjK7J80kXl81hWIj33unYIxjpEF8llwVgJXFHPq3yMHcUzCKZguyPsIgXzvo5wKHx 3GLhVfiP6VfMa3UtgJWwIeRVoYMWEyhoNVEyoUqBVAC7mctvisBl9K9qdfMDRNRJeOzp6Z o3E0RrVG39x76D8ogIdwXWDKORflJrCv5x9D+rAQFfEB81I2AL+RZ1yzrTo5r7mD8/OpMd GuAiFySX2uCepuryg3F5FtjpLmeQbTfZZEat1q5/NOCORPuZd521ppHs0Q6/TiuLeimWr7 wenWLXjglSBE8UrmH4vNQymwDcZZ/UA9iHk/kT5Qq5kN1WnohBGZR9IN0LhNYA== 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 4P6dHb2XcnzXfK; Wed, 1 Feb 2023 23:22:35 +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 311NMZGs060940; Wed, 1 Feb 2023 23:22:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 311NMZw5060939; Wed, 1 Feb 2023 23:22:35 GMT (envelope-from git) Date: Wed, 1 Feb 2023 23:22:35 GMT Message-Id: <202302012322.311NMZw5060939@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: 1d8d5348645f - stable/13 - sctp: remove book keeping not needed anymore 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: 1d8d5348645f3dcdc65562c4ad9765cb62156251 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=1d8d5348645f3dcdc65562c4ad9765cb62156251 commit 1d8d5348645f3dcdc65562c4ad9765cb62156251 Author: Michael Tuexen AuthorDate: 2022-06-08 21:30:52 +0000 Commit: Michael Tuexen CommitDate: 2023-02-01 23:22:04 +0000 sctp: remove book keeping not needed anymore (cherry picked from commit ee9ee699d6b5ee7613c6a166d2db5dbb59389cfc) --- sys/netinet/sctp_output.c | 38 ++------------------------------------ 1 file changed, 2 insertions(+), 36 deletions(-) diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index 7dcd2eab8ed2..6736f7e9f948 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -12440,7 +12440,6 @@ sctp_lower_sosend(struct socket *so, bool free_cnt_applied = false; bool some_on_control; bool got_all_of_the_send = false; - bool hold_tcblock = false; bool non_blocking = false; error = 0; @@ -12555,7 +12554,6 @@ sctp_lower_sosend(struct socket *so, stcb = LIST_FIRST(&inp->sctp_asoc_list); if (stcb != NULL) { SCTP_TCB_LOCK(stcb); - hold_tcblock = true; } SCTP_INP_RUNLOCK(inp); } else if (sinfo_assoc_id > SCTP_ALL_ASSOC) { @@ -12563,7 +12561,6 @@ sctp_lower_sosend(struct socket *so, SCTP_INP_RUNLOCK(inp); if (stcb != NULL) { SCTP_TCB_LOCK_ASSERT(stcb); - hold_tcblock = true; } } else if (addr != NULL) { /*- @@ -12580,7 +12577,6 @@ sctp_lower_sosend(struct socket *so, SCTP_INP_WUNLOCK(inp); } else { SCTP_TCB_LOCK_ASSERT(stcb); - hold_tcblock = true; } } else { SCTP_INP_RUNLOCK(inp); @@ -12589,11 +12585,9 @@ sctp_lower_sosend(struct socket *so, #ifdef INVARIANTS if (stcb != NULL) { SCTP_TCB_LOCK_ASSERT(stcb); - KASSERT(hold_tcblock, ("tcb lock hold, hold_tcblock is false")); - } else { - KASSERT(!hold_tcblock, ("hold_tcblock is true, but stcb is NULL")); } #endif + if ((stcb == NULL) && (addr != NULL)) { /* Possible implicit send? */ SCTP_ASOC_CREATE_LOCK(inp); @@ -12624,7 +12618,6 @@ sctp_lower_sosend(struct socket *so, SCTP_INP_WUNLOCK(inp); } else { SCTP_TCB_LOCK_ASSERT(stcb); - hold_tcblock = true; SCTP_ASOC_CREATE_UNLOCK(inp); create_lock_applied = false; } @@ -12667,7 +12660,6 @@ sctp_lower_sosend(struct socket *so, goto out_unlocked; } SCTP_TCB_LOCK_ASSERT(stcb); - hold_tcblock = true; SCTP_ASOC_CREATE_UNLOCK(inp); create_lock_applied = false; /* @@ -12681,7 +12673,6 @@ sctp_lower_sosend(struct socket *so, if (sctp_process_cmsgs_for_init(stcb, control, &error)) { sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_OUTPUT + SCTP_LOC_6); - hold_tcblock = false; stcb = NULL; KASSERT(error != 0, ("error is 0 although sctp_process_cmsgs_for_init() indicated an error")); @@ -12701,7 +12692,6 @@ sctp_lower_sosend(struct socket *so, KASSERT(!create_lock_applied, ("create_lock_applied is true")); KASSERT(stcb != NULL, ("stcb is NULL")); - KASSERT(hold_tcblock, ("hold_tcblock is false")); SCTP_TCB_LOCK_ASSERT(stcb); asoc = &stcb->asoc; @@ -12805,7 +12795,6 @@ sctp_lower_sosend(struct socket *so, local_soresv = sndlen; KASSERT(stcb != NULL, ("stcb is NULL")); - KASSERT(hold_tcblock, ("hold_tcblock is false")); SCTP_TCB_LOCK_ASSERT(stcb); KASSERT((asoc->state & SCTP_STATE_ABOUT_TO_BE_FREED) == 0, ("Association about to be freed")); @@ -12861,10 +12850,8 @@ sctp_lower_sosend(struct socket *so, SCTP_BUF_LEN(mm) = (int)(tot_out + sizeof(struct sctp_paramhdr)); if (top == NULL) { SCTP_TCB_UNLOCK(stcb); - hold_tcblock = false; error = uiomove((caddr_t)ph, (int)tot_out, uio); SCTP_TCB_LOCK(stcb); - hold_tcblock = true; if ((asoc->state & SCTP_STATE_ABOUT_TO_BE_FREED) || (asoc->state & SCTP_STATE_WAS_ABORTED)) { sctp_m_freem(mm); @@ -12913,7 +12900,6 @@ sctp_lower_sosend(struct socket *so, } KASSERT(stcb != NULL, ("stcb is NULL")); - KASSERT(hold_tcblock, ("hold_tcblock is false")); SCTP_TCB_LOCK_ASSERT(stcb); KASSERT((asoc->state & SCTP_STATE_ABOUT_TO_BE_FREED) == 0, ("Association about to be freed")); @@ -12972,7 +12958,6 @@ sctp_lower_sosend(struct socket *so, be.error = 0; stcb->block_entry = &be; SCTP_TCB_UNLOCK(stcb); - hold_tcblock = false; error = sbwait(&so->so_snd); if (error == 0) { if (so->so_error != 0) { @@ -12984,7 +12969,6 @@ sctp_lower_sosend(struct socket *so, } SOCKBUF_UNLOCK(&so->so_snd); SCTP_TCB_LOCK(stcb); - hold_tcblock = true; stcb->block_entry = NULL; if (error != 0) { goto out_unlocked; @@ -13019,7 +13003,6 @@ sctp_lower_sosend(struct socket *so, skip_preblock: KASSERT(stcb != NULL, ("stcb is NULL")); - KASSERT(hold_tcblock, ("hold_tcblock is false")); SCTP_TCB_LOCK_ASSERT(stcb); KASSERT((asoc->state & SCTP_STATE_ABOUT_TO_BE_FREED) == 0, ("Association about to be freed")); @@ -13054,10 +13037,8 @@ skip_preblock: if (strm->last_msg_incomplete == 0) { do_a_copy_in: SCTP_TCB_UNLOCK(stcb); - hold_tcblock = false; sp = sctp_copy_it_in(stcb, asoc, sndrcvninfo, uio, net, max_len, user_marks_eor, &error); SCTP_TCB_LOCK(stcb); - hold_tcblock = true; if ((asoc->state & SCTP_STATE_ABOUT_TO_BE_FREED) || (asoc->state & SCTP_STATE_WAS_ABORTED)) { if (asoc->state & SCTP_STATE_WAS_ABORTED) { @@ -13142,7 +13123,6 @@ skip_preblock: } KASSERT(stcb != NULL, ("stcb is NULL")); - KASSERT(hold_tcblock, ("hold_tcblock is false")); SCTP_TCB_LOCK_ASSERT(stcb); KASSERT((asoc->state & SCTP_STATE_ABOUT_TO_BE_FREED) == 0, ("Association about to be freed")); @@ -13163,12 +13143,10 @@ skip_preblock: ((max_len > 0) && (SCTP_SB_LIMIT_SND(so) < SCTP_BASE_SYSCTL(sctp_add_more_threshold))) || (uio->uio_resid <= max_len)) { SCTP_TCB_UNLOCK(stcb); - hold_tcblock = false; sndout = 0; new_tail = NULL; mm = sctp_copy_resume(uio, (int)max_len, user_marks_eor, &error, &sndout, &new_tail); SCTP_TCB_LOCK(stcb); - hold_tcblock = true; if ((asoc->state & SCTP_STATE_ABOUT_TO_BE_FREED) || (asoc->state & SCTP_STATE_WAS_ABORTED)) { /* @@ -13224,7 +13202,6 @@ skip_preblock: } KASSERT(stcb != NULL, ("stcb is NULL")); - KASSERT(hold_tcblock, ("hold_tcblock is false")); SCTP_TCB_LOCK_ASSERT(stcb); KASSERT((asoc->state & SCTP_STATE_ABOUT_TO_BE_FREED) == 0, ("Association about to be freed")); @@ -13354,7 +13331,6 @@ skip_preblock: be.error = 0; stcb->block_entry = &be; SCTP_TCB_UNLOCK(stcb); - hold_tcblock = false; error = sbwait(&so->so_snd); if (error == 0) { if (so->so_error != 0) @@ -13365,7 +13341,6 @@ skip_preblock: } SOCKBUF_UNLOCK(&so->so_snd); SCTP_TCB_LOCK(stcb); - hold_tcblock = true; stcb->block_entry = NULL; if ((asoc->state & SCTP_STATE_ABOUT_TO_BE_FREED) || (asoc->state & SCTP_STATE_WAS_ABORTED)) { @@ -13397,7 +13372,6 @@ skip_preblock: } KASSERT(stcb != NULL, ("stcb is NULL")); - KASSERT(hold_tcblock, ("hold_tcblock is false")); SCTP_TCB_LOCK_ASSERT(stcb); KASSERT((asoc->state & SCTP_STATE_ABOUT_TO_BE_FREED) == 0, ("Association about to be freed")); @@ -13440,7 +13414,6 @@ skip_preblock: dataless_eof: KASSERT(stcb != NULL, ("stcb is NULL")); - KASSERT(hold_tcblock, ("hold_tcblock is false")); SCTP_TCB_LOCK_ASSERT(stcb); KASSERT((asoc->state & SCTP_STATE_ABOUT_TO_BE_FREED) == 0, ("Association about to be freed")); @@ -13517,7 +13490,6 @@ dataless_eof: sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, false, SCTP_SO_LOCKED); NET_EPOCH_EXIT(et); - hold_tcblock = false; stcb = NULL; error = ECONNABORTED; goto out; @@ -13531,7 +13503,6 @@ dataless_eof: skip_out_eof: KASSERT(stcb != NULL, ("stcb is NULL")); - KASSERT(hold_tcblock, ("hold_tcblock is false")); SCTP_TCB_LOCK_ASSERT(stcb); KASSERT((asoc->state & SCTP_STATE_ABOUT_TO_BE_FREED) == 0, ("Association about to be freed")); @@ -13553,7 +13524,6 @@ skip_out_eof: } KASSERT(stcb != NULL, ("stcb is NULL")); - KASSERT(hold_tcblock, ("hold_tcblock is false")); SCTP_TCB_LOCK_ASSERT(stcb); KASSERT((asoc->state & SCTP_STATE_ABOUT_TO_BE_FREED) == 0, ("Association about to be freed")); @@ -13603,7 +13573,6 @@ skip_out_eof: } KASSERT(stcb != NULL, ("stcb is NULL")); - KASSERT(hold_tcblock, ("hold_tcblock is false")); SCTP_TCB_LOCK_ASSERT(stcb); KASSERT((asoc->state & SCTP_STATE_ABOUT_TO_BE_FREED) == 0, ("Association about to be freed")); @@ -13634,7 +13603,6 @@ skip_out_eof: asoc->total_output_queue_size, error); KASSERT(stcb != NULL, ("stcb is NULL")); - KASSERT(hold_tcblock, ("hold_tcblock is false")); SCTP_TCB_LOCK_ASSERT(stcb); KASSERT((asoc->state & SCTP_STATE_ABOUT_TO_BE_FREED) == 0, ("Association about to be freed")); @@ -13650,12 +13618,10 @@ out_unlocked: if (local_soresv) { atomic_subtract_int(&asoc->sb_send_resv, (int)sndlen); } - if (hold_tcblock) { - SCTP_TCB_UNLOCK(stcb); - } if (free_cnt_applied) { atomic_subtract_int(&asoc->refcnt, 1); } + SCTP_TCB_UNLOCK(stcb); } if (top != NULL) { sctp_m_freem(top);