From nobody Sun Jan 30 10:42:06 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 B0AAA199DA76; Sun, 30 Jan 2022 10:42:06 +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 4JmnnV4d0lz4kds; Sun, 30 Jan 2022 10:42:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643539326; 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=BjeEVmhn80yJQoMgJOWe+MITcR4DUE9/XadNQA3vDE0=; b=OPKPfMevKXPtw9lAsoA2Djr8cx63d4riKibWwnYkcqqLwu2WtDOYfOJPh5cSf5tbaJMe+0 f+yl+F2GGDp9xLrtBpJcR41d3jwlrNmfUm2lROcVOAHqg8YYLWmEcsDqisM7EcRUR+fUkX TaOMxtHOh16n9EEsqGtLcavBxe3IsT1CK6/3k/TElVG6KGFn5W1G4wTllcGQ+3mv8ClWhF nwMA+uYvElRP8j6xTPDL2NJZezWFM6Ns80HaHxi7VjU+9RXbrSMChlZAwMK2WuQ7mzcc6e Ky+Iu/AFLPhp+LGeBpYxRxEgj2AI08mDrZGNkQt/Ou5EXjfcH/sFlTkaPS2DEg== 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 7EC1B27634; Sun, 30 Jan 2022 10:42:06 +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 20UAg65H027856; Sun, 30 Jan 2022 10:42:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20UAg68D027855; Sun, 30 Jan 2022 10:42:06 GMT (envelope-from git) Date: Sun, 30 Jan 2022 10:42:06 GMT Message-Id: <202201301042.20UAg68D027855@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger Subject: git: c3915f848b56 - stable/13 - tcp: Tidying up the conditionals for unwinding a spurious RTO 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: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c3915f848b56221836bb95dfa293a43ca5f1e630 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643539326; 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=BjeEVmhn80yJQoMgJOWe+MITcR4DUE9/XadNQA3vDE0=; b=VcZ6F15P9hZl/aVM7DEeOOXUOk0iv+2tF0+9xdIWlQlEqOSD3hUJsoY2xbre6lPiLQEl3g fCzNAXR5sDl538MlRz1V0VePztzzH36TZerlIO8H8nDkZinNkMh5u5EYKTlAy11uOzfcUg 0JDaLY95/4+vrr7pzix75eJz5/VRcgh+ymBqLF7MRz4se3dtKa+8ljZL2rFLAu2VSp1yt4 cBjf/dG5A7L3C2dQyS1X3HmAb8ikz5hFeUZvHjfLBJDo6dHjyCi66DNBvFubdJ0sgFkxQS ftnGJ8qGeOC6GNUgb8C60rh22MI9tOxg90V2Ep30gJg9gQNlVVizdfon5WI9mA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643539326; a=rsa-sha256; cv=none; b=p43r9bux30fOT8rBTOqa9Go0xfKwVTz5p7ymJbrmHOPHJ2iT0bYemFeJZVTGXuebmsfe5L glj75Qi4B29ge96UR9P18NqOeun7Ocj4S0c9ZxsQsUXNkmM5X4H2HVwvFa6aEuYD1echVq NxbLOix7NP4Clb/qWPa8nRPZaIFifd4uhKEV/rOy1Y2k7yf1dXVImJws6EkTkmJI6B+THN xo9UKb90J3UEeuz1c9iRhlUHrmfCyVer4jbY70VP3ju1Y26/B2IICp7rF9o1RC5rlR2OUh n0WIeJCdHkzA8BHDLjknsjr7mXEGvNxV0kSqPmq7N8mJneok0vvvIuM7nvIQgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=c3915f848b56221836bb95dfa293a43ca5f1e630 commit c3915f848b56221836bb95dfa293a43ca5f1e630 Author: Richard Scheffenegger AuthorDate: 2022-01-27 17:59:21 +0000 Commit: Richard Scheffenegger CommitDate: 2022-01-30 10:41:16 +0000 tcp: Tidying up the conditionals for unwinding a spurious RTO - Use the semantically correct TSTMP_xx macro when comparing timestamps. (No functional change) - check for bad retransmits only when TSopt is present in ACK (don't assume there will be a valid TSopt in the TCP options struct) - exclude tsecr == 0, since that most likely indicates an invalid ts echo return (tsecr) value. Reviewed By: tuexen, #transport MFC after: 3 days Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D34062 (cherry picked from commit 4531b3450b23a01de04b3bb393e475cf734793c8) --- sys/netinet/tcp_input.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 0848afd3c2b0..2c7d15368483 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1653,9 +1653,10 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, to.to_tsecr -= tp->ts_offset; if (TSTMP_GT(to.to_tsecr, tcp_ts_getticks())) to.to_tsecr = 0; - else if (tp->t_flags & TF_PREVVALID && - tp->t_rxtshift == 1 && - tp->t_badrxtwin != 0 && SEQ_LT(to.to_tsecr, tp->t_badrxtwin)) + else if (tp->t_rxtshift == 1 && + tp->t_flags & TF_PREVVALID && + tp->t_badrxtwin != 0 && + TSTMP_LT(to.to_tsecr, tp->t_badrxtwin)) cc_cong_signal(tp, th, CC_RTO_ERR); } /* @@ -1812,7 +1813,8 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, if ((to.to_flags & TOF_TS) == 0 && tp->t_rxtshift == 1 && tp->t_flags & TF_PREVVALID && - (int)(ticks - tp->t_badrxtwin) < 0) { + tp->t_badrxtwin != 0 && + TSTMP_LT(ticks, tp->t_badrxtwin)) { cc_cong_signal(tp, th, CC_RTO_ERR); } @@ -2886,8 +2888,10 @@ process_ACK: */ if (tp->t_rxtshift == 1 && tp->t_flags & TF_PREVVALID && - tp->t_badrxtwin && - SEQ_LT(to.to_tsecr, tp->t_badrxtwin)) + tp->t_badrxtwin != 0 && + to.to_flags & TOF_TS && + to.to_tsecr != 0 && + TSTMP_LT(to.to_tsecr, tp->t_badrxtwin)) cc_cong_signal(tp, th, CC_RTO_ERR); /*