From nobody Sat Feb 10 09:34:00 2024 X-Original-To: dev-commits-src-main@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 4TX5Bw4whNz59KtV; Sat, 10 Feb 2024 09:34:00 +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 4TX5Bw4F5mz4ZPH; Sat, 10 Feb 2024 09:34:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707557640; 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=SHp4R6LrtHLtIbMDPNJW4cB2/apjs1srZkTEkuMdSfY=; b=arSqDf4iqiw94xMnuO3lc+IgJHthSYjaV6NfVu7JC67+p+c/RLfJXLlHmEX1d5Fhe8+xxV bAGo/rwusXJ3AjctKxDP50yBXtej9a502yQAcUW/no03ZmhIEjqxJoimyjqTNZzBJKSaYF BwbEOMSZ+OJ5cqvyKHLf/0jiHHZi04QFHlnRHBd9ijjXD0cqYV5VYNHry3T4NFE6E3AO/A CiBtGNsl3ccROACWiShnmUtoaUB5pej8Aa3ZBxIST/CN6Q4tCRQ1Vd9h/Zno3OFLExdVMD HiByxi8jNwOTSH86S6iXFbT7NfBiwWjGTrZOcpD6VCpibmpKAJcOlVvEv5Ii9w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1707557640; a=rsa-sha256; cv=none; b=eycLHT1rJWXXga+w3im3NswWzVrLTYZ2dkHZPM7wZpNwOupzzoXJq/LMS3RW8cZFNw4FZu vLaFAZViW8dqVMj+QJO7j/xWvLzkWM2IhO7WpHs09dSTexq1zv41+SI9NYN1Iy+RO1G5rK x86EO4RR1SIeeb/hg1RSwBaYPqT4eikvrcofNh8NU/fvTebv+LAbBoBvLVcgE/4d/PeK4/ tN66c9tzI8xsXcJ9LWNkn3Yq9iRmvHokygO5gHXN7nk6pzY48xrFLkTq47SemtcwirfYXE 1Hd4u6QvcIKlwsee8mMxU6s7Cblf5CLTlhAQXRijC/mCbWso9EnuhOqCISqbFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707557640; 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=SHp4R6LrtHLtIbMDPNJW4cB2/apjs1srZkTEkuMdSfY=; b=WKIXbGOe78Tasta0n4Gxy6bHNH4o8bvo1F8S6jtK5DaRUvli8SI7jLeoE7rrVR0KQmRnch u/oZPqwrQ8BWXTcHyNuH6s13pRNoWfm2V3n676blRzeEKxxDyCqQpLoIzzKOTchUV8zWo3 MUV3A37NY5e5OdNkENV3vWdasTybbtvCXFEC34AQuJE5IfIXlT8CJGHpMtlFUHsGSiZjTE Tj7gNaSl5DJflVDxdfm0uYL4WVE61QHm8hfxriFrjIRhtExCZSLw1zTrJ4l2uLb6g20J+1 KKPjQUBfe3qjgOxf7bUkAjfrC6SMZOzXIM76w0q300Cobbn7vyfACL9bo7N0RQ== 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 4TX5Bw3KyMz19sY; Sat, 10 Feb 2024 09:34:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41A9Y0na044165; Sat, 10 Feb 2024 09:34:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41A9Y0Ht044162; Sat, 10 Feb 2024 09:34:00 GMT (envelope-from git) Date: Sat, 10 Feb 2024 09:34:00 GMT Message-Id: <202402100934.41A9Y0Ht044162@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Richard Scheffenegger Subject: git: a8e817cf5c9c - main - tcp: stop doing superfluous work after sending RST List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: a8e817cf5c9c6e34357e0c078a256e2526b9da53 Auto-Submitted: auto-generated The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=a8e817cf5c9c6e34357e0c078a256e2526b9da53 commit a8e817cf5c9c6e34357e0c078a256e2526b9da53 Author: Richard Scheffenegger AuthorDate: 2024-02-10 09:24:10 +0000 Commit: Richard Scheffenegger CommitDate: 2024-02-10 09:25:02 +0000 tcp: stop doing superfluous work after sending RST When sending a RST control segment in tcp_output() it means we are in TCPS_CLOSED state, called from tcp_drop(). Once the RST is sent, don't call tcp_timer_activate() or update anything in tcpcb, since that will go away shortly. PR: 276761 Provided by: glebius Reviewed By: glebius, tuexen, #transport Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D43808 --- sys/netinet/tcp_output.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index 50dc05e9c55a..26a8ed70ceff 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -1516,9 +1516,13 @@ out: tcp_account_for_send(tp, len, (tp->snd_nxt != tp->snd_max), 0, hw_tls); /* * In transmit state, time the transmission and arrange for - * the retransmit. In persist state, just set snd_max. + * the retransmit. In persist state, just set snd_max. In a closed + * state just return. */ - if ((tp->t_flags & TF_FORCEDATA) == 0 || + if (flags & TH_RST) { + TCPSTAT_INC(tcps_sndtotal); + return (0); + } else if ((tp->t_flags & TF_FORCEDATA) == 0 || !tcp_timer_active(tp, TT_PERSIST)) { tcp_seq startseq = tp->snd_nxt;