hpts: move inp initialization from the generic inpcb code to TCP

Differential revision:	https://reviews.freebsd.org/D37124
This commit is contained in:
Gleb Smirnoff 2022-11-08 10:24:40 -08:00
parent 9eb0e8326d
commit ab0ef9455f
2 changed files with 7 additions and 7 deletions

View File

@ -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);

View File

@ -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.