diff options
author | ps <ps@FreeBSD.org> | 2006-04-21 09:25:40 +0000 |
---|---|---|
committer | ps <ps@FreeBSD.org> | 2006-04-21 09:25:40 +0000 |
commit | 10b2fe8deaf19b4c81cb9088e607c6b818b49a2b (patch) | |
tree | 104c2b8ecefe4f49f0608012d591ed6bc153383e /sys/netinet/ip_divert.c | |
parent | 71dd15704489306788703f67dac59f4814c34efe (diff) | |
download | FreeBSD-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/ip_divert.c')
-rw-r--r-- | sys/netinet/ip_divert.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c index 8cfad6b..2b14f44 100644 --- a/sys/netinet/ip_divert.c +++ b/sys/netinet/ip_divert.c @@ -116,6 +116,13 @@ static u_long div_recvspace = DIVRCVQ; /* XXX sysctl ? */ /* * Initialize divert connection block queue. */ +static void +div_zone_change(void *tag) +{ + + uma_zone_set_max(divcbinfo.ipi_zone, maxsockets); +} + void div_init(void) { @@ -132,6 +139,8 @@ div_init(void) divcbinfo.ipi_zone = uma_zcreate("divcb", sizeof(struct inpcb), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); uma_zone_set_max(divcbinfo.ipi_zone, maxsockets); + EVENTHANDLER_REGISTER(maxsockets_change, div_zone_change, + NULL, EVENTHANDLER_PRI_ANY); } /* |