git: ab0ef9455f73 - main - hpts: move inp initialization from the generic inpcb code to TCP

From: Gleb Smirnoff <glebius_at_FreeBSD.org>
Date: Tue, 08 Nov 2022 18:24:59 UTC
The branch main has been updated by glebius:

URL: https://cgit.FreeBSD.org/src/commit/?id=ab0ef9455f7362aaa05f9437818dc0b963eae27a

commit ab0ef9455f7362aaa05f9437818dc0b963eae27a
Author:     Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2022-11-08 18:24:40 +0000
Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2022-11-08 18:24:40 +0000

    hpts: move inp initialization from the generic inpcb code to TCP
    
    Differential revision:  https://reviews.freebsd.org/D37124
---
 sys/netinet/in_pcb.c   | 7 -------
 sys/netinet/tcp_subr.c | 7 +++++++
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index 70aaca21a20f..2118d5f41e41 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -639,13 +639,6 @@ in_pcballoc(struct socket *so, struct inpcbinfo *pcbinfo)
 	 * to be cleaned up.
 	 */
 	inp->inp_route.ro_flags = RT_LLE_CACHE;
-#ifdef TCPHPTS
-	/*
-	 * If using hpts lets drop a random number in so
-	 * not all new connections fall on the same CPU.
-	 */
-	inp->inp_hpts_cpu = hpts_random_cpu(inp);
-#endif
 	refcount_init(&inp->inp_refcount, 1);   /* Reference from socket. */
 	INP_WLOCK(inp);
 	INP_INFO_WLOCK(pcbinfo);
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 76765a223b71..acd82b4e851c 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -2315,6 +2315,13 @@ tcp_newtcpcb(struct inpcb *inp)
 	 */
 	inp->inp_ip_ttl = V_ip_defttl;
 	inp->inp_ppcb = tp;
+#ifdef TCPHPTS
+	/*
+	 * If using hpts lets drop a random number in so
+	 * not all new connections fall on the same CPU.
+	 */
+	inp->inp_hpts_cpu = hpts_random_cpu(inp);
+#endif
 #ifdef TCPPCAP
 	/*
 	 * Init the TCP PCAP queues.