From nobody Wed Jun 8 21:31:39 2022 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 21F0B83671B; Wed, 8 Jun 2022 21:31:40 +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 4LJL5S0V28z3w17; Wed, 8 Jun 2022 21:31:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654723900; 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=+37/xdlkXdrEnTthSAxjqy6PlnGGN9AmwsZRIk13s/Y=; b=BdgtQNG9Y4G1uWu5nYRzAKgtlTW6nJyr2peRV+VW7FgGTZ6cfzt9ON9yBOYuT7EYKJ4AgC sOob6w8W+RiJwRmuNfmwed6+cDBpXkERRy6nkaWIn8sfTKTS/N/aoSBZA/RiNLfF7KY4i8 kk9e9vM3nl78Jz0sOB6FOaMwVu+QLOE+93o2aihJVwzO6kmSTDIdPQMLJ23WEQXeZC5xTr dncneu0VB9RABh6g1Xsi74KjsV57wi9HyGks0c3GertdRZJuOqohIOgdoT15l9+vLHCj7a 2HR6/3jq9j932q8ZASL2h5lPfci5kepyva3Zqlgzmgb496FNHEryHNX6Ovle8g== 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 E52B1171F7; Wed, 8 Jun 2022 21:31:39 +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 258LVd3w051579; Wed, 8 Jun 2022 21:31:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 258LVd1M051578; Wed, 8 Jun 2022 21:31:39 GMT (envelope-from git) Date: Wed, 8 Jun 2022 21:31:39 GMT Message-Id: <202206082131.258LVd1M051578@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: ee9ee699d6b5 - main - 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/main X-Git-Reftype: branch X-Git-Commit: ee9ee699d6b5ee7613c6a166d2db5dbb59389cfc Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654723900; 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=+37/xdlkXdrEnTthSAxjqy6PlnGGN9AmwsZRIk13s/Y=; b=Bdjmn7XLWLrodskdAr4cedAY2c2lo37K7bGinDkfGP6b5PEPQE7FJNaUWQm/B/GYs8DPYh 9vna/3IYLcgBZ6KzKGZxF9RIGlzpzfTy+/WGY3I1Gt4BKX9C+3rEXHF5RluhqVV9XjLnF/ WA4mlwyJk1C5OrW1STZlxyVVb3ZvskpRJcUfNouI8Y7aDYvpSd85c8a1N2H23KlV3phuP+ otyzJyH2WAzBBRERnVtcpQVb7XqIWR8TwoKFAjh12hEGJgWzSaiHgWkuk+awnMq0aVK6wQ 2n+t2xgwSWyjvdLEPYnIdOPVdWNDhbYIDU8UAuZ9fzYlSK1AkqjUrzllydHCAg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1654723900; a=rsa-sha256; cv=none; b=uab3HU9WVVmRADp8XBs2qV2nhT84WdWJ7wAGhXu/PIHrsyGkQTCDwkuPwsBmA3NERqKpDq dMIq8ivoT2niB/ex0pwAfA/ML35FyQew5WZwn6Vnte9ZAcQg/nzCXw94Ij2SJuOj/XIzO3 TODbNTjRtNTpQfJT614rtx4yrP/iMZsX2yzn3dqbQiNiOErgUCHFh/9Nv4xDwG6pnIG1TR aB60EvVQqL/4kWi3tIn4CYHAJREEpnhaEwEzZ3RcoJ1jy86Jr4RoQ2vKl2CZfqfI8B3Y16 BieqmfpDqpTVZ14W/51G+VmQ1SrsWg6Kl5eDYfD6gUP3XVDbejSWF7MEr/YJOA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=ee9ee699d6b5ee7613c6a166d2db5dbb59389cfc commit ee9ee699d6b5ee7613c6a166d2db5dbb59389cfc Author: Michael Tuexen AuthorDate: 2022-06-08 21:30:52 +0000 Commit: Michael Tuexen CommitDate: 2022-06-08 21:30:52 +0000 sctp: remove book keeping not needed anymore MFC after: 3 days --- 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 0a3827899888..629fd65d1aa6 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -12442,7 +12442,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; @@ -12557,7 +12556,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) { @@ -12565,7 +12563,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) { /*- @@ -12582,7 +12579,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); @@ -12591,11 +12587,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); @@ -12626,7 +12620,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; } @@ -12669,7 +12662,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; /* @@ -12683,7 +12675,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")); @@ -12703,7 +12694,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; @@ -12807,7 +12797,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")); @@ -12863,10 +12852,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); @@ -12915,7 +12902,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")); @@ -12974,7 +12960,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) { @@ -12986,7 +12971,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; @@ -13021,7 +13005,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")); @@ -13056,10 +13039,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) { @@ -13144,7 +13125,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")); @@ -13165,12 +13145,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)) { /* @@ -13226,7 +13204,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")); @@ -13356,7 +13333,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) @@ -13367,7 +13343,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)) { @@ -13399,7 +13374,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")); @@ -13442,7 +13416,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")); @@ -13519,7 +13492,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; @@ -13533,7 +13505,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")); @@ -13555,7 +13526,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")); @@ -13605,7 +13575,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")); @@ -13636,7 +13605,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")); @@ -13652,12 +13620,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);