From nobody Tue Nov 08 18:25:00 2022 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 4N6GjS4L2mz4V7T9; Tue, 8 Nov 2022 18:25: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 4N6GjS3dDyz4KxD; Tue, 8 Nov 2022 18:25:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667931900; 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=Qp/fB/p/0whRfYYX8XbhHToZ5QygpoPJ2l/vciuFviM=; b=K3lnEKurBISBH4CZeu+Yr0jT3TshAwq2izrVMQfs8qqgRdcZ4Bkvmt9548aF6LCBTXJeOy eWLUgDXqSBhtDCM8G60XLfWKiPj6w94MAaU3JlA9PdfL7/R8mNQphrgZngWm92inB5ITBN a18mEEKLIbT00zAqdhbk/vv9Z1AeioWJUyK/fmhAT0qju5jbyZVrclySG5VB25yknaJdDx OrR2rRixboOMOMaUt205lTmUY+XKpZoDqem38To/QMAoSSQzpJLtIzzgdZ/ZuzU2dYVzwv tyOD3qEU+WiJAggNFx5g4XEWi93CF8mQeH/gG+pkrjb/WP1H5jRosNv3BP8dww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667931900; 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=Qp/fB/p/0whRfYYX8XbhHToZ5QygpoPJ2l/vciuFviM=; b=SbhWLuYqMn2y1JaX1xZnYLa+iL1GISQuCCLxhda9u4pb960MUX85UE0I0957m74o02oMQb dC/jDR9mAFaN2YZuKekqoGb7lVennFCNMUxC/wPn0ME3Ce+FzsG/XFyPS1YMPVu5vM54Yu tfFpk0qjKB0AjytlHmBV6EJd28kHxHHy5oGTzfBUcEBu/SPA9F5RIT0i6LpM8LZ7AUtIdt QKbNcU6+tfeIz6Qv8rKYN9ClRMmNXVZTA8dID/fcZGw7SrbkiOJaNnsJTjZdDDubqluHa8 SQVa4LMfYUIvka2ZbXo4J+uvY/cCqfyTN4xWhp56D4E/CMv19uKeFCS0nPxuEg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1667931900; a=rsa-sha256; cv=none; b=SbF1m/9P7hoRE0Hjd7yrBQyTbn2WlkoD8KaOpXrJKmqJrAasMjijGtDZ955DsEZA8whjqg /UysCt7yzX1DihtcHJp9IpIqcLvYWQxwZ5CKN+K0dKQ7/EYeOcfR/BAx+iOLYKdX1VTmxq ++ARCZtJ2EW7FAOCY3ZftV5UDAzwBctt7+HiCoVUotUXUoifyBiS1igsurtr7ARHkLzZ6P /6Y9jWQs4zZ8I0jgI+yTR4YUlkcqgzYOlbpZR1i5AswONQ5IZ1GKxW8PZyE6ihSKP3LxyA 5H+lUb/L6TpfMdSeImw7ZaRY+0EbQXW+HGVayCLz6eCMs1GcUJ2e2H8wrUcLeQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4N6GjS2ddJzrx6; Tue, 8 Nov 2022 18:25:00 +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 2A8IP0fe043494; Tue, 8 Nov 2022 18:25:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2A8IP0ek043493; Tue, 8 Nov 2022 18:25:00 GMT (envelope-from git) Date: Tue, 8 Nov 2022 18:25:00 GMT Message-Id: <202211081825.2A8IP0ek043493@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 8840ae228807 - main - tcp: don't store VNET in every tcpcb, take it from the inpcbinfo 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: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8840ae2288079b1221ab4e6623110b50d0092542 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=8840ae2288079b1221ab4e6623110b50d0092542 commit 8840ae2288079b1221ab4e6623110b50d0092542 Author: Gleb Smirnoff AuthorDate: 2022-11-08 18:24:40 +0000 Commit: Gleb Smirnoff CommitDate: 2022-11-08 18:24:40 +0000 tcp: don't store VNET in every tcpcb, take it from the inpcbinfo Reviewed by: rscheff Differential revision: https://reviews.freebsd.org/D37125 --- sys/kern/uipc_ktls.c | 2 +- sys/netinet/tcp_subr.c | 3 --- sys/netinet/tcp_timer.c | 18 +++++++++++------- sys/netinet/tcp_var.h | 1 - 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index 521c416b5234..b4e5004ed1f8 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -1748,7 +1748,7 @@ ktls_reset_send_tag(void *context, int pending) if (!in_pcbrele_wlocked(inp)) { if (!(inp->inp_flags & INP_DROPPED)) { tp = intotcpcb(inp); - CURVNET_SET(tp->t_vnet); + CURVNET_SET(inp->inp_vnet); tp = tcp_drop(tp, ECONNABORTED); CURVNET_RESTORE(); if (tp != NULL) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index acd82b4e851c..58e410edf0bb 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -2260,9 +2260,6 @@ tcp_newtcpcb(struct inpcb *inp) } #endif -#ifdef VIMAGE - tp->t_vnet = inp->inp_vnet; -#endif tp->t_timers = &tm->tt; TAILQ_INIT(&tp->t_segq); tp->t_maxseg = diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c index 0ef17603beea..cf11dee8af68 100644 --- a/sys/netinet/tcp_timer.c +++ b/sys/netinet/tcp_timer.c @@ -254,9 +254,9 @@ tcp_timer_delack(void *xtp) struct inpcb *inp = tptoinpcb(tp); #endif - CURVNET_SET(tp->t_vnet); - INP_WLOCK(inp); + CURVNET_SET(inp->inp_vnet); + if (callout_pending(&tp->t_timers->tt_delack) || !callout_active(&tp->t_timers->tt_delack)) { INP_WUNLOCK(inp); @@ -318,7 +318,6 @@ tcp_timer_2msl(void *xtp) { struct tcpcb *tp = xtp; struct inpcb *inp = tptoinpcb(tp); - CURVNET_SET(tp->t_vnet); #ifdef TCPDEBUG int ostate; @@ -326,6 +325,8 @@ tcp_timer_2msl(void *xtp) #endif INP_WLOCK(inp); + CURVNET_SET(inp->inp_vnet); + tcp_log_end_status(tp, TCP_EI_STATUS_2MSL); tcp_free_sackholes(tp); if (callout_pending(&tp->t_timers->tt_2msl) || @@ -394,7 +395,6 @@ tcp_timer_keep(void *xtp) struct tcpcb *tp = xtp; struct inpcb *inp = tptoinpcb(tp); struct tcptemp *t_template; - CURVNET_SET(tp->t_vnet); #ifdef TCPDEBUG int ostate; @@ -402,6 +402,8 @@ tcp_timer_keep(void *xtp) #endif INP_WLOCK(inp); + CURVNET_SET(inp->inp_vnet); + if (callout_pending(&tp->t_timers->tt_keep) || !callout_active(&tp->t_timers->tt_keep)) { INP_WUNLOCK(inp); @@ -539,7 +541,6 @@ tcp_timer_persist(void *xtp) #endif bool progdrop; int outrv; - CURVNET_SET(tp->t_vnet); #ifdef TCPDEBUG int ostate; @@ -547,6 +548,8 @@ tcp_timer_persist(void *xtp) #endif INP_WLOCK(inp); + CURVNET_SET(inp->inp_vnet); + if (callout_pending(&tp->t_timers->tt_persist) || !callout_active(&tp->t_timers->tt_persist)) { INP_WUNLOCK(inp); @@ -619,7 +622,6 @@ tcp_timer_rexmt(void * xtp) { struct epoch_tracker et; struct tcpcb *tp = xtp; - CURVNET_SET(tp->t_vnet); struct inpcb *inp = tptoinpcb(tp); int rexmt, outrv; bool isipv6; @@ -630,6 +632,8 @@ tcp_timer_rexmt(void * xtp) #endif INP_WLOCK(inp); + CURVNET_SET(inp->inp_vnet); + if (callout_pending(&tp->t_timers->tt_rexmt) || !callout_active(&tp->t_timers->tt_rexmt)) { INP_WUNLOCK(inp); @@ -1090,8 +1094,8 @@ tcp_timer_discard(void *ptp) struct tcpcb *tp = (struct tcpcb *)ptp; struct inpcb *inp = tptoinpcb(tp); - CURVNET_SET(tp->t_vnet); INP_WLOCK(inp); + CURVNET_SET(inp->inp_vnet); NET_EPOCH_ENTER(et); KASSERT((tp->t_timers->tt_flags & TT_STOPPED) != 0, diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 12d18b420bbc..2cfc1ff3f21a 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -181,7 +181,6 @@ struct tcpcb { struct mbuf *t_in_pkt; struct mbuf *t_tail_pkt; struct tcp_timer *t_timers; /* All the TCP timers in one struct */ - struct vnet *t_vnet; /* back pointer to parent vnet */ uint32_t snd_ssthresh; /* snd_cwnd size threshold for * for slow start exponential to * linear switch