summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_timewait.c
diff options
context:
space:
mode:
authorps <ps@FreeBSD.org>2006-04-21 09:25:40 +0000
committerps <ps@FreeBSD.org>2006-04-21 09:25:40 +0000
commit10b2fe8deaf19b4c81cb9088e607c6b818b49a2b (patch)
tree104c2b8ecefe4f49f0608012d591ed6bc153383e /sys/netinet/tcp_timewait.c
parent71dd15704489306788703f67dac59f4814c34efe (diff)
downloadFreeBSD-src-10b2fe8deaf19b4c81cb9088e607c6b818b49a2b.zip
FreeBSD-src-10b2fe8deaf19b4c81cb9088e607c6b818b49a2b.tar.gz
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.
Diffstat (limited to 'sys/netinet/tcp_timewait.c')
-rw-r--r--sys/netinet/tcp_timewait.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c
index a6e6ab8..92da5c5 100644
--- a/sys/netinet/tcp_timewait.c
+++ b/sys/netinet/tcp_timewait.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
OpenPOWER on IntegriCloud