From nobody Sat Feb 10 09:34:01 2024 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 4TX5By4NXMz59KpD; Sat, 10 Feb 2024 09:34:02 +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 4TX5Bx5YK0z4ZH5; Sat, 10 Feb 2024 09:34:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707557641; 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=C0g1nkRBL76QuaFizVZ+fCCObTcPBahi9yMkQg3Liew=; b=rc26uhSJ3vuYLSX/6inAcy51+QfuTd3bU/VgOf02bfoc9ohqQoJGPMMe+CZD4inRYIaBYY AohQEGXAn2b3G/iFpc0311QI11odGJTw+hYeSw/JuIs3G6zv4J2HyFkK0KXyTF9361z4Vv OMRTSE1YeC0at/eFoTlqoqP8SfugANWPjRw3n39eU5axdRfjMQb+N+GCOM/7iGzCrkImbz zKxGDj5HZLNVasmFJPM9ALT5rvyT7yp03VptlDV3hSu0l2zUjrl9o45np/m/4wPL62W1k7 N5pRtulGfYMwRaLbet6d2pfCs/ROdkUteXB2ibFxtn8Oo/S11kH0yw26COgfVQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1707557641; a=rsa-sha256; cv=none; b=rVVQgWxgOe9Zftbwi2rHy/ApYIVjStY665GHhGamcbdbffXEz66qF5hiQMYPMiUjP0b8EM IuCdoQ9bx8M7nwHuYV6moivRhRRT0D6XsAwaEEgxPbs2NuWOayZk4KfJiq0pcu1zNV3nj0 OtCa6EGXw2jVSLW9iXXJsBerz4Vr3jxAUTCv4G6W4VSs2K0WFNbVENGd5kieKVe30jBZVK vrjkhYEPmy05cvC7jWdiboElvwXTNKPAbik6qSTaoGFfs4nFAlIc5gImqd1nNTqQM4m0i2 WyUoOKMQV9O7JdO37M+0GBXp4eEhR9fJDev/VUUhtbSsAaSRxEX/TwPRGFxqXA== 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=1707557641; 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=C0g1nkRBL76QuaFizVZ+fCCObTcPBahi9yMkQg3Liew=; b=FpDLM6tjsqvyu0c7ze2yEu6QurTK5HdO+J/Kxni6McrDhg1yvpLkwJjbqmT090qvEaATZe 9WCfEyNR/3LhRUXe/r14pRJgCzJSjyYD7F/frf6leWx/gP126WNFqapxnctzQGImOT54yV 4E7d1yjqEotTfkeGIVxd3ualDj435Iq1eBUmteHpaq68fzw5tcmGM8KWoxrlX1y/hOwffX m3hhPlfM+SXyF2CRDV2N23DZjYTnZlrQLRZHPo4gKFejTGtPSVytG79QY6kQS1DC4ynBZP WwyFRGkK5ZFd1taEWLNNAVFGM7dIV9XOoxQLBTi9QzlwRBI7CcZjSBQAxP2wMQ== 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 4TX5Bx4fL3z1B9v; Sat, 10 Feb 2024 09:34:01 +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 41A9Y1r6044216; Sat, 10 Feb 2024 09:34:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41A9Y11l044213; Sat, 10 Feb 2024 09:34:01 GMT (envelope-from git) Date: Sat, 10 Feb 2024 09:34:01 GMT Message-Id: <202402100934.41A9Y11l044213@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: 62d47d73b7eb - main - tcp: stop timers and clean scoreboard in tcp_close() 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: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 62d47d73b7eb01f3b0a37541df5e7aaa36f54335 Auto-Submitted: auto-generated The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=62d47d73b7eb01f3b0a37541df5e7aaa36f54335 commit 62d47d73b7eb01f3b0a37541df5e7aaa36f54335 Author: Richard Scheffenegger AuthorDate: 2024-02-10 09:28:42 +0000 Commit: Richard Scheffenegger CommitDate: 2024-02-10 09:30:00 +0000 tcp: stop timers and clean scoreboard in tcp_close() Stop timers when in tcp_close() instead of doing that in tcp_discardcb(). A connection in CLOSED state shall not need any timers. Assert that no timer is rescheduled after that in tcp_timer_activate() and verfiy that this is also the expected state in tcp_discardcb(). PR: 276761 Reviewed By: glebius, tuexen, #transport Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D43792 --- sys/netinet/tcp_subr.c | 4 ++-- sys/netinet/tcp_timer.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 6043a3d458e5..90e1496a822c 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -2383,10 +2383,9 @@ tcp_discardcb(struct tcpcb *tp) #endif INP_WLOCK_ASSERT(inp); + MPASS(!callout_active(&tp->t_callout)); MPASS(TAILQ_EMPTY(&tp->snd_holes)); - tcp_timer_stop(tp); - /* free the reassembly queue, if any */ tcp_reass_flush(tp); @@ -2522,6 +2521,7 @@ tcp_close(struct tcpcb *tp) tcp_fastopen_decrement_counter(tp->t_tfo_pending); tp->t_tfo_pending = NULL; } + tcp_timer_stop(tp); if (tp->t_fb->tfb_tcp_timer_stop_all != NULL) tp->t_fb->tfb_tcp_timer_stop_all(tp); in_pcbdrop(inp); diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c index f0eb3bad33cf..ed50659abf8e 100644 --- a/sys/netinet/tcp_timer.c +++ b/sys/netinet/tcp_timer.c @@ -907,6 +907,7 @@ tcp_timer_activate(struct tcpcb *tp, tt_which which, u_int delta) #endif INP_WLOCK_ASSERT(inp); + MPASS(tp->t_state > TCPS_CLOSED); if (delta > 0) { what = TT_STARTING;