tcp_subr.c (157478) | tcp_subr.c (157927) |
---|---|
1/*- 2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95 | 1/*- 2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95 |
30 * $FreeBSD: head/sys/netinet/tcp_subr.c 157478 2006-04-04 14:31:37Z glebius $ | 30 * $FreeBSD: head/sys/netinet/tcp_subr.c 157927 2006-04-21 09:25:40Z ps $ |
31 */ 32 33#include "opt_compat.h" 34#include "opt_inet.h" 35#include "opt_inet6.h" 36#include "opt_ipsec.h" 37#include "opt_mac.h" 38#include "opt_tcpdebug.h" --- 204 unchanged lines hidden (view full) --- 243 244static uma_zone_t tcpcb_zone; 245static uma_zone_t tcptw_zone; 246struct callout isn_callout; 247 248/* 249 * TCP initialization. 250 */ | 31 */ 32 33#include "opt_compat.h" 34#include "opt_inet.h" 35#include "opt_inet6.h" 36#include "opt_ipsec.h" 37#include "opt_mac.h" 38#include "opt_tcpdebug.h" --- 204 unchanged lines hidden (view full) --- 243 244static uma_zone_t tcpcb_zone; 245static uma_zone_t tcptw_zone; 246struct callout isn_callout; 247 248/* 249 * TCP initialization. 250 */ |
251static void 252tcp_zone_change(void *tag) 253{ 254 255 uma_zone_set_max(tcbinfo.ipi_zone, maxsockets); 256 uma_zone_set_max(tcpcb_zone, maxsockets); 257 uma_zone_set_max(tcptw_zone, maxsockets / 5); 258} 259 |
|
251void 252tcp_init(void) 253{ 254 int hashsize = TCBHASHSIZE; 255 256 tcp_delacktime = TCPTV_DELACK; 257 tcp_keepinit = TCPTV_KEEP_INIT; 258 tcp_keepidle = TCPTV_KEEP_IDLE; --- 46 unchanged lines hidden (view full) --- 305 tcp_hc_init(); 306 tcp_reass_init(); 307 callout_init(&isn_callout, CALLOUT_MPSAFE); 308 tcp_isn_tick(NULL); 309 EVENTHANDLER_REGISTER(shutdown_pre_sync, tcp_fini, NULL, 310 SHUTDOWN_PRI_DEFAULT); 311 sack_hole_zone = uma_zcreate("sackhole", sizeof(struct sackhole), 312 NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); | 260void 261tcp_init(void) 262{ 263 int hashsize = TCBHASHSIZE; 264 265 tcp_delacktime = TCPTV_DELACK; 266 tcp_keepinit = TCPTV_KEEP_INIT; 267 tcp_keepidle = TCPTV_KEEP_IDLE; --- 46 unchanged lines hidden (view full) --- 314 tcp_hc_init(); 315 tcp_reass_init(); 316 callout_init(&isn_callout, CALLOUT_MPSAFE); 317 tcp_isn_tick(NULL); 318 EVENTHANDLER_REGISTER(shutdown_pre_sync, tcp_fini, NULL, 319 SHUTDOWN_PRI_DEFAULT); 320 sack_hole_zone = uma_zcreate("sackhole", sizeof(struct sackhole), 321 NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); |
322 EVENTHANDLER_REGISTER(maxsockets_change, tcp_zone_change, NULL, 323 EVENTHANDLER_PRI_ANY); |
|
313} 314 315void 316tcp_fini(void *xtp) 317{ 318 319 callout_stop(&isn_callout); 320} --- 2039 unchanged lines hidden --- | 324} 325 326void 327tcp_fini(void *xtp) 328{ 329 330 callout_stop(&isn_callout); 331} --- 2039 unchanged lines hidden --- |