From nobody Thu Dec 30 14:32:21 2021 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 080451911DBF; Thu, 30 Dec 2021 14:32:22 +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 4JPrMT56tvz3kPQ; Thu, 30 Dec 2021 14:32:21 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 8FA121A1B0; Thu, 30 Dec 2021 14:32:21 +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 1BUEWL2X030208; Thu, 30 Dec 2021 14:32:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BUEWLHY030207; Thu, 30 Dec 2021 14:32:21 GMT (envelope-from git) Date: Thu, 30 Dec 2021 14:32:21 GMT Message-Id: <202112301432.1BUEWLHY030207@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: 1adb91e52164 - main - sctp: retire sctp_mtu_size_reset() 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: 1adb91e52164af634c816327f8cdb3751dc76ce4 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640874741; 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=OW9KptRptxjShP2htv71dwj+tpFc+WK6bTOaaQ/wWGo=; b=WK9YpGAx95cVfwZ3ce1+iEm+bPh47fsiht22W510LCIZgM3ptJcUT4KS3ig0CLLqok4E8+ ajQ2hfeHBVwOsfUM38zF9+Q9sfQXgSBM43hZw2H82D4rbPKkTKLHH5Vl7tqIJADF6xZlOz rQ/kuz+a4yCuZd6lg7Spaxte6TF2O5+/kwmU0opzMIzy0xemj4XBgzQn7JSuaP7BeqNz9z 4i4UZJc8d2WBjOf2seFE16ENOOSYVumW6h4TvqEz0wP597h4MO3XJurs7T43f4YJliqWc1 rxvSdnnY/CLvIPRK8KFobKAfmcwsit1fF1SRSJmr3rbTW6eq9cDH/S+u3SsPEA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640874741; a=rsa-sha256; cv=none; b=FdJUEQfoY6WN0RPKGfvCPj2PmH0XjsbZ8vpQWP/zgFITkJueSULga4i3Q3IvygzPQUTmp1 mjjijVRQ2fd7WhAxnph7Yi04mbC9K5FO3/4PvC2rkMInh1aX8JZXovpVqDJODCWzCKuMa7 Vucfxz0wSWHcVYKyYF4boM9hjIB0mg3dXVcrxZi2+wtNIuLSyEgBNzy/t5CbIBpAGhwgeB +NycQvpp1J1kGBV0N08nt9qmYEVvUoEU+10hZvs36u+FL7Eq8LL9/jZlkFYyCIeLdpN5D0 hEMY9XrxDKUJY4xgaqAdVR7VGH2qhgkVZUMVvC8BqI9kaBBZGKcdIHLGARQrgg== 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=1adb91e52164af634c816327f8cdb3751dc76ce4 commit 1adb91e52164af634c816327f8cdb3751dc76ce4 Author: Michael Tuexen AuthorDate: 2021-12-30 14:30:11 +0000 Commit: Michael Tuexen CommitDate: 2021-12-30 14:30:11 +0000 sctp: retire sctp_mtu_size_reset() Thanks to Timo Voelker for making me aware that sctp_mtu_size_reset() is very similar to sctp_pathmtu_adjustment(). MFC after: 3 days --- sys/netinet/sctp_output.c | 16 +++++++--------- sys/netinet/sctputil.c | 31 ------------------------------- sys/netinet/sctputil.h | 3 --- 3 files changed, 7 insertions(+), 43 deletions(-) diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index 17a4df2243e2..4c48d4787a69 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -4244,10 +4244,10 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, mtu -= sizeof(struct udphdr); } if (mtu < net->mtu) { + net->mtu = mtu; if ((stcb != NULL) && (stcb->asoc.smallest_mtu > mtu)) { - sctp_mtu_size_reset(inp, &stcb->asoc, mtu); + sctp_pathmtu_adjustment(stcb, mtu, true); } - net->mtu = mtu; } } } else if (ro->ro_nh == NULL) { @@ -4586,18 +4586,16 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, mtu -= sizeof(struct udphdr); } if (mtu < net->mtu) { + net->mtu = mtu; if ((stcb != NULL) && (stcb->asoc.smallest_mtu > mtu)) { - sctp_mtu_size_reset(inp, &stcb->asoc, mtu); + sctp_pathmtu_adjustment(stcb, mtu, false); } - net->mtu = mtu; } } - } else if (ifp) { - if (ND_IFINFO(ifp)->linkmtu && + } else if (ifp != NULL) { + if ((ND_IFINFO(ifp)->linkmtu > 0) && (stcb->asoc.smallest_mtu > ND_IFINFO(ifp)->linkmtu)) { - sctp_mtu_size_reset(inp, - &stcb->asoc, - ND_IFINFO(ifp)->linkmtu); + sctp_pathmtu_adjustment(stcb, ND_IFINFO(ifp)->linkmtu, false); } } } diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index df3768ca2a35..04a7e12f10eb 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -2905,37 +2905,6 @@ sctp_calculate_len(struct mbuf *m) return (tlen); } -void -sctp_mtu_size_reset(struct sctp_inpcb *inp, - struct sctp_association *asoc, uint32_t mtu) -{ - /* - * Reset the P-MTU size on this association, this involves changing - * the asoc MTU, going through ANY chunk+overhead larger than mtu to - * allow the DF flag to be cleared. - */ - struct sctp_tmit_chunk *chk; - unsigned int eff_mtu, ovh; - - asoc->smallest_mtu = mtu; - if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { - ovh = SCTP_MIN_OVERHEAD; - } else { - ovh = SCTP_MIN_V4_OVERHEAD; - } - eff_mtu = mtu - ovh; - TAILQ_FOREACH(chk, &asoc->send_queue, sctp_next) { - if (chk->send_size > eff_mtu) { - chk->flags |= CHUNK_FLAGS_FRAGMENT_OK; - } - } - TAILQ_FOREACH(chk, &asoc->sent_queue, sctp_next) { - if (chk->send_size > eff_mtu) { - chk->flags |= CHUNK_FLAGS_FRAGMENT_OK; - } - } -} - /* * Given an association and starting time of the current RTT period, update * RTO in number of msecs. net should point to the current network. diff --git a/sys/netinet/sctputil.h b/sys/netinet/sctputil.h index 3319eb4f455b..8253fde829e1 100644 --- a/sys/netinet/sctputil.h +++ b/sys/netinet/sctputil.h @@ -108,9 +108,6 @@ sctp_timer_stop(int, struct sctp_inpcb *, struct sctp_tcb *, int sctp_dynamic_set_primary(struct sockaddr *sa, uint32_t vrf_id); -void - sctp_mtu_size_reset(struct sctp_inpcb *, struct sctp_association *, uint32_t); - void sctp_wakeup_the_read_socket(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int so_locked