From nobody Thu Apr 16 21:05:41 2026 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 4fxVsh5D2tz6Zfb1; Thu, 16 Apr 2026 21:05:44 +0000 (UTC) (envelope-from markj@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxVsh4h5hz3CXP; Thu, 16 Apr 2026 21:05:44 +0000 (UTC) (envelope-from markj@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776373544; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bbR+BCRws9yM67pLXF4/9mJyg8dvYbwLpPiajzyMeYE=; b=NldC+iq1Kzj5b8P7IaPUmwesVl1C1Qh/KxoUzIHNac524MMgO2KlWoSCvhXK20yJ3y40vi 6cPecjvG2pRyJgkqg4eNtV0l1RI6triDPfeBAay+TwOa37z20fqM3DD/JU4M4EMivwqMgC l+6kMvpyQz8ryLcpT/hzurjrWRNiFY220zE5k6NWzCAEiIEW8IHC/gWfwtvy7jotAnIzAz M21SQeA9YjKxMMgoS6+09xuqk5zcz7SJU/99CMlpEjO59PVdLOLIVbqFmtl7Cu30D04/dc 0BZ4ebtvEpjpQayxn7CgOzVm3J6wv61nMa+ih2L1REJvbzqB5O/LtQKNtjrg+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776373544; a=rsa-sha256; cv=none; b=YyOG+c9bVhoZ0UKR9l4baxulwdXlM60Xc7fYfaxMJHDNNdu8u66YtBq6jwR13g1SOwwq6K vBxhMVVy881YBSw+tqkPy/vGd0lkF4jzBNQz8D1eiYgHpkQ03qti92iBTjOYCyIWI5S5mC moKD9MEytOnTcWf6wYmfflRxmCaIq3fFoiFGsV08WUtERyOjSC1/emhLuYiOLDRsj4s4/I AH4RSNeR5Nb596AzrVNJcYZ36NiLvBnOOlB8RvW1RSYa+cZMkxY/EZfxiGSzF03ceBdPgH /b/jMHPyX9PysXoevXI/eVwHzxTVuu9Nj27ni5DO/TQqRYXgjp5ZP/yqStixMQ== 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=1776373544; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bbR+BCRws9yM67pLXF4/9mJyg8dvYbwLpPiajzyMeYE=; b=lZQhDjFA0jeakMySgMRTHeEPeb86/VMcSlhY9YQkOWYhNyZAKJJ+RC7VdqDU+Y8ibhr+95 hndPUU5Sl4v9kjlLosjcuRtE8OTtINibuG9Q4FHpons/ubftTl/Jl0U3eKtYK2USRtS/B/ iV0GBCae5YK0p51b5tT+bwTIwcRe3WL0k4g55z1rW01GQ80VcyQdBb0OTfcEIANzOFTMSO BmydxT+tFTevyOClQI9R5vSBWbQo/cF6UqXjtaTvvVBEyoatCmDiK5ep13T6gQrpAbukMj Qpdhh3Ml/L7un8bh3hox4xhsE08i5tAhUJx2uDTy9MUsn2eXjx8Ra9/8PcK8Ag== Received: from nuc (192-0-220-237.cpe.teksavvy.com [192.0.220.237]) (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) (Authenticated sender: markj) by smtp.freebsd.org (Postfix) with ESMTPSA id 4fxVsh1XqMzG8H; Thu, 16 Apr 2026 21:05:44 +0000 (UTC) (envelope-from markj@freebsd.org) Date: Thu, 16 Apr 2026 17:05:41 -0400 From: Mark Johnston To: Gleb Smirnoff Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 9b76228006d8 - main - inpcb: retire inp_vnet Message-ID: References: <69de65eb.21a5c.61244c2a@gitrepo.freebsd.org> 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <69de65eb.21a5c.61244c2a@gitrepo.freebsd.org> On Tue, Apr 14, 2026 at 04:06:03PM +0000, Gleb Smirnoff wrote: > The branch main has been updated by glebius: > > URL: https://cgit.FreeBSD.org/src/commit/?id=9b76228006d8f0e45dea03d305eeac587d7a8500 > > commit 9b76228006d8f0e45dea03d305eeac587d7a8500 > Author: Gleb Smirnoff > AuthorDate: 2026-04-14 16:02:00 +0000 > Commit: Gleb Smirnoff > CommitDate: 2026-04-14 16:02:00 +0000 > > inpcb: retire inp_vnet > > Now that a functional inpcb can not outlive its socket, just use socket's > vnet pointer. > --- > sys/kern/uipc_ktls.c | 4 ++-- > sys/netinet/in_pcb.c | 3 --- > sys/netinet/in_pcb.h | 8 -------- > sys/netinet/tcp_hpts.c | 2 +- > sys/netinet/tcp_timer.c | 10 +++++----- > 5 files changed, 8 insertions(+), 19 deletions(-) > > diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c > index 0112cf8b6941..4c3a4085b8db 100644 > --- a/sys/kern/uipc_ktls.c > +++ b/sys/kern/uipc_ktls.c > @@ -1797,7 +1797,7 @@ ktls_reset_send_tag(void *context, int pending) > INP_WLOCK(inp); > tp = intotcpcb(inp); > if (!(tp->t_flags & TF_DISCONNECTED)) { > - CURVNET_SET(inp->inp_vnet); > + CURVNET_SET(inp->inp_socket->so_vnet); > tp = tcp_drop(tp, ECONNABORTED); > CURVNET_RESTORE(); > if (tp != NULL) { > @@ -2475,7 +2475,7 @@ ktls_drop(struct socket *so, int error) > NET_EPOCH_ENTER(et); > INP_WLOCK(inp); > if (!(tp->t_flags & TF_DISCONNECTED)) { > - CURVNET_SET(inp->inp_vnet); > + CURVNET_SET(inp->inp_socket->so_vnet); > tp = tcp_drop(tp, error); > CURVNET_RESTORE(); > if (tp != NULL) > diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c > index af62aea91bf8..22c3287b93fd 100644 > --- a/sys/netinet/in_pcb.c > +++ b/sys/netinet/in_pcb.c > @@ -558,9 +558,6 @@ in_pcbinfo_init(struct inpcbinfo *pcbinfo, struct inpcbstorage *pcbstor, > > mtx_init(&pcbinfo->ipi_hash_lock, pcbstor->ips_hashlock_name, > NULL, MTX_DEF); > -#ifdef VIMAGE > - pcbinfo->ipi_vnet = curvnet; > -#endif > CK_LIST_INIT(&pcbinfo->ipi_list_unconn); > pcbinfo->ipi_count = 0; > > diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h > index 8663ba205b0a..1a6ce50aedbb 100644 > --- a/sys/netinet/in_pcb.h > +++ b/sys/netinet/in_pcb.h > @@ -299,7 +299,6 @@ struct xktls_session { > #include > #include > #include > -#include > #include > #include > > @@ -418,8 +417,6 @@ struct inpcb { > }; > }; > > -#define inp_vnet inp_pcbinfo->ipi_vnet > - > /* > * Per-VNET pcb database for each high-level protocol (UDP, TCP, ...) in both > * IPv4 and IPv6. > @@ -478,11 +475,6 @@ struct inpcbinfo { > * hashed by local port. > */ > struct inpcblbgrouphead *ipi_lbgrouphashbase; /* (r:e/w:h) */ > - > - /* > - * Pointer to network stack instance > - */ > - struct vnet *ipi_vnet; /* (c) */ > }; > > /* > diff --git a/sys/netinet/tcp_hpts.c b/sys/netinet/tcp_hpts.c > index 8dfbe126d46a..2bb78ed28372 100644 > --- a/sys/netinet/tcp_hpts.c > +++ b/sys/netinet/tcp_hpts.c > @@ -1359,7 +1359,7 @@ again: > */ > __tcp_set_hpts(pace, tp); > } > - CURVNET_SET(inp->inp_vnet); > + CURVNET_SET(inp->inp_socket->so_vnet); It's possible to have inp->inp_socket == NULL here. This is triggered by the sys/netinet/tcp_hpts_test.py tests. > /* Lets do any logging that we might want to */ > tcp_hpts_log(hpts, tp, &tv, slots_to_run, i, from_callout); > > diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c > index b409daf5895e..ca242f2be627 100644 > --- a/sys/netinet/tcp_timer.c > +++ b/sys/netinet/tcp_timer.c > @@ -315,7 +315,7 @@ tcp_timer_delack(struct tcpcb *tp) > > INP_WLOCK_ASSERT(inp); > > - CURVNET_SET(inp->inp_vnet); > + CURVNET_SET(inp->inp_socket->so_vnet); > tp->t_flags |= TF_ACKNOW; > TCPSTAT_INC(tcps_delack); > NET_EPOCH_ENTER(et); > @@ -335,7 +335,7 @@ tcp_timer_2msl(struct tcpcb *tp) > INP_WLOCK_ASSERT(inp); > > TCP_PROBE2(debug__user, tp, PRU_SLOWTIMO); > - CURVNET_SET(inp->inp_vnet); > + CURVNET_SET(inp->inp_socket->so_vnet); > tcp_log_end_status(tp, TCP_EI_STATUS_2MSL); > tcp_free_sackholes(tp); > /* > @@ -385,7 +385,7 @@ tcp_timer_keep(struct tcpcb *tp) > INP_WLOCK_ASSERT(inp); > > TCP_PROBE2(debug__user, tp, PRU_SLOWTIMO); > - CURVNET_SET(inp->inp_vnet); > + CURVNET_SET(inp->inp_socket->so_vnet); > /* > * Because we don't regularly reset the keepalive callout in > * the ESTABLISHED state, it may be that we don't actually need > @@ -493,7 +493,7 @@ tcp_timer_persist(struct tcpcb *tp) > INP_WLOCK_ASSERT(inp); > > TCP_PROBE2(debug__user, tp, PRU_SLOWTIMO); > - CURVNET_SET(inp->inp_vnet); > + CURVNET_SET(inp->inp_socket->so_vnet); > /* > * Persistence timer into zero window. > * Force a byte to be output, if possible. > @@ -560,7 +560,7 @@ tcp_timer_rexmt(struct tcpcb *tp) > INP_WLOCK_ASSERT(inp); > > TCP_PROBE2(debug__user, tp, PRU_SLOWTIMO); > - CURVNET_SET(inp->inp_vnet); > + CURVNET_SET(inp->inp_socket->so_vnet); > if (tp->t_fb->tfb_tcp_rexmit_tmr) { > /* The stack has a timer action too. */ > (*tp->t_fb->tfb_tcp_rexmit_tmr)(tp); >