git: 2b3a77467dd3 - main - hpts: make stacks responsible for tcp_hpts_init()

From: Gleb Smirnoff <glebius_at_FreeBSD.org>
Date: Mon, 04 Dec 2023 18:59:28 UTC
The branch main has been updated by glebius:

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

commit 2b3a77467dd3d74a7170f279fb25f9736b46ef8a
Author:     Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2023-12-04 18:19:46 +0000
Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2023-12-04 18:19:46 +0000

    hpts: make stacks responsible for tcp_hpts_init()
    
    Those stacks that use HPTS should care about init, not generic code.
    
    Reviewed by:            imp, tuexen, rrs
    Differential Revision:  https://reviews.freebsd.org/D42856
---
 sys/netinet/tcp_stacks/bbr.c  | 2 ++
 sys/netinet/tcp_stacks/rack.c | 2 ++
 sys/netinet/tcp_subr.c        | 3 ---
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c
index 013bd0982fd3..aa78e02e39d9 100644
--- a/sys/netinet/tcp_stacks/bbr.c
+++ b/sys/netinet/tcp_stacks/bbr.c
@@ -9926,6 +9926,8 @@ bbr_init(struct tcpcb *tp, void **ptr)
 	struct tcp_bbr *bbr = NULL;
 	uint32_t cts;
 
+	tcp_hpts_init(tp);
+
 	*ptr = uma_zalloc(bbr_pcb_zone, (M_NOWAIT | M_ZERO));
 	if (*ptr == NULL) {
 		/*
diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c
index 5df188aae52c..e7027dd1b2dd 100644
--- a/sys/netinet/tcp_stacks/rack.c
+++ b/sys/netinet/tcp_stacks/rack.c
@@ -14973,6 +14973,8 @@ rack_init(struct tcpcb *tp, void **ptr)
 	uint32_t iwin, snt, us_cts;
 	int err, no_query;
 
+	tcp_hpts_init(tp);
+
 	/*
 	 * First are we the initial or are we a switched stack?
 	 * If we are initing via tcp_newtcppcb the ptr passed
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index cfbf32a40d86..b3f5375cb8cf 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -2313,9 +2313,6 @@ tcp_newtcpcb(struct inpcb *inp)
 	 * which may match an IPv4-mapped IPv6 address.
 	 */
 	inp->inp_ip_ttl = V_ip_defttl;
-#ifdef TCPHPTS
-	tcp_hpts_init(tp);
-#endif
 #ifdef TCPPCAP
 	/*
 	 * Init the TCP PCAP queues.