diff options
author | jhb <jhb@FreeBSD.org> | 2010-08-27 18:17:46 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2010-08-27 18:17:46 +0000 |
commit | f7e5db4f07571bdd9335c7380c937a4c6b79ccc0 (patch) | |
tree | 3276a141f06c47e248280f30de828a91d91cead3 /sys/netinet | |
parent | 4b6cfc055c3236a237ee7e11d50d7e63ee5bf6ea (diff) | |
download | FreeBSD-src-f7e5db4f07571bdd9335c7380c937a4c6b79ccc0.zip FreeBSD-src-f7e5db4f07571bdd9335c7380c937a4c6b79ccc0.tar.gz |
Simplify the tcp pcblist estimate logic slightly.
MFC after: 3 days
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/tcp_subr.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index fe8f79a..b537fb9 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1022,11 +1022,9 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) * resource-intensive to repeat twice on every request. */ if (req->oldptr == NULL) { - m = syncache_pcbcount(); - n = V_tcbinfo.ipi_count; - n += imax((m + n) / 8, 10); - req->oldidx = 2 * (sizeof xig) + - (m + n) * sizeof(struct xtcpcb); + n = V_tcbinfo.ipi_count + syncache_pcbcount(); + n += imax(n / 8, 10); + req->oldidx = 2 * (sizeof xig) + n * sizeof(struct xtcpcb); return (0); } |