aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_subr.c
diff options
context:
space:
mode:
authorPaul Saab <ps@FreeBSD.org>2006-04-21 09:25:40 +0000
committerPaul Saab <ps@FreeBSD.org>2006-04-21 09:25:40 +0000
commit4f590175b7f3a4efecdd28ffd3306d30724d32c9 (patch)
tree104c2b8ecefe4f49f0608012d591ed6bc153383e /sys/netinet/tcp_subr.c
parent9b062675f01a7f2f089796902a035081661f7a89 (diff)
downloadsrc-4f590175b7f3a4efecdd28ffd3306d30724d32c9.tar.gz
src-4f590175b7f3a4efecdd28ffd3306d30724d32c9.zip
Allow for nmbclusters and maxsockets to be increased via sysctl.
An eventhandler is used to update all the various zones that depend on these values.
Notes
Notes: svn path=/head/; revision=157927
Diffstat (limited to 'sys/netinet/tcp_subr.c')
-rw-r--r--sys/netinet/tcp_subr.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index a6e6ab8fca2d..92da5c5c2cc0 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -248,6 +248,15 @@ struct callout isn_callout;
/*
* TCP initialization.
*/
+static void
+tcp_zone_change(void *tag)
+{
+
+ uma_zone_set_max(tcbinfo.ipi_zone, maxsockets);
+ uma_zone_set_max(tcpcb_zone, maxsockets);
+ uma_zone_set_max(tcptw_zone, maxsockets / 5);
+}
+
void
tcp_init(void)
{
@@ -310,6 +319,8 @@ tcp_init(void)
SHUTDOWN_PRI_DEFAULT);
sack_hole_zone = uma_zcreate("sackhole", sizeof(struct sackhole),
NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
+ EVENTHANDLER_REGISTER(maxsockets_change, tcp_zone_change, NULL,
+ EVENTHANDLER_PRI_ANY);
}
void