tcp: remove the looping on pcb count in tcp_destroy()

This was useful when TCP timers were not able to reliably stop. Note that
in_pcbinfo_destroy() called later asserts that V_tcbinfo.ipi_count is 0.

This reverts 806929d514, b54e08e11a.
This commit is contained in:
Gleb Smirnoff
2024-11-14 11:39:12 -08:00
parent 20162e6f1c
commit fb7c1ac5ac
-15
View File
@@ -58,7 +58,6 @@
#include <sys/refcount.h>
#include <sys/mbuf.h>
#include <sys/priv.h>
#include <sys/proc.h>
#include <sys/sdt.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
@@ -1593,24 +1592,10 @@ SYSINIT(tcp_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, tcp_init, NULL);
static void
tcp_destroy(void *unused __unused)
{
int n;
#ifdef TCP_HHOOK
int error;
#endif
/*
* All our processes are gone, all our sockets should be cleaned
* up, which means, we should be past the tcp_discardcb() calls.
* Sleep to let all tcpcb timers really disappear and cleanup.
*/
for (;;) {
INP_INFO_WLOCK(&V_tcbinfo);
n = V_tcbinfo.ipi_count;
INP_INFO_WUNLOCK(&V_tcbinfo);
if (n == 0)
break;
pause("tcpdes", hz / 10);
}
tcp_hc_destroy();
syncache_destroy();
in_pcbinfo_destroy(&V_tcbinfo);