In VNET TCP teardown Do not sleep unconditionally but only if we

have any TCP connections left.

Submitted by:		zec
Approved by:		re (hrs)
MFC after:		13 days
This commit is contained in:
Bjoern A. Zeeb 2016-06-23 11:55:15 +00:00
parent 5b0c29decf
commit 361279a4fb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=302140

View File

@ -739,10 +739,11 @@ tcp_destroy(void *unused __unused)
* Sleep to let all tcpcb timers really disappear and cleanup.
*/
do {
pause("tcpdes", hz/10);
INP_LIST_RLOCK(&V_tcbinfo);
n = V_tcbinfo.ipi_count;
INP_LIST_RUNLOCK(&V_tcbinfo);
if (n != 0)
pause("tcpdes", hz / 10);
} while (n != 0);
tcp_hc_destroy();
syncache_destroy();