tcp_reass.c (204838) | tcp_reass.c (207369) |
---|---|
1/*- 2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1994, 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 --- 16 unchanged lines hidden (view full) --- 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_input.c 8.12 (Berkeley) 5/24/95 30 */ 31 32#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1994, 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 --- 16 unchanged lines hidden (view full) --- 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_input.c 8.12 (Berkeley) 5/24/95 30 */ 31 32#include <sys/cdefs.h> |
33__FBSDID("$FreeBSD: head/sys/netinet/tcp_reass.c 204838 2010-03-07 15:58:44Z bz $"); | 33__FBSDID("$FreeBSD: head/sys/netinet/tcp_reass.c 207369 2010-04-29 11:52:42Z bz $"); |
34 35#include "opt_inet.h" 36#include "opt_inet6.h" 37#include "opt_tcpdebug.h" 38 39#include <sys/param.h> 40#include <sys/kernel.h> 41#include <sys/malloc.h> --- 27 unchanged lines hidden (view full) --- 69#include <netinet/tcp_timer.h> 70#include <netinet/tcp_var.h> 71#include <netinet6/tcp6_var.h> 72#include <netinet/tcpip.h> 73#ifdef TCPDEBUG 74#include <netinet/tcp_debug.h> 75#endif /* TCPDEBUG */ 76 | 34 35#include "opt_inet.h" 36#include "opt_inet6.h" 37#include "opt_tcpdebug.h" 38 39#include <sys/param.h> 40#include <sys/kernel.h> 41#include <sys/malloc.h> --- 27 unchanged lines hidden (view full) --- 69#include <netinet/tcp_timer.h> 70#include <netinet/tcp_var.h> 71#include <netinet6/tcp6_var.h> 72#include <netinet/tcpip.h> 73#ifdef TCPDEBUG 74#include <netinet/tcp_debug.h> 75#endif /* TCPDEBUG */ 76 |
77static VNET_DEFINE(int, tcp_reass_maxseg); 78VNET_DEFINE(int, tcp_reass_qsize); 79static VNET_DEFINE(int, tcp_reass_maxqlen); 80static VNET_DEFINE(int, tcp_reass_overflows); 81 82#define V_tcp_reass_maxseg VNET(tcp_reass_maxseg) 83#define V_tcp_reass_maxqlen VNET(tcp_reass_maxqlen) 84#define V_tcp_reass_overflows VNET(tcp_reass_overflows) 85 | |
86SYSCTL_NODE(_net_inet_tcp, OID_AUTO, reass, CTLFLAG_RW, 0, 87 "TCP Segment Reassembly Queue"); 88 | 77SYSCTL_NODE(_net_inet_tcp, OID_AUTO, reass, CTLFLAG_RW, 0, 78 "TCP Segment Reassembly Queue"); 79 |
80static VNET_DEFINE(int, tcp_reass_maxseg) = 0; 81#define V_tcp_reass_maxseg VNET(tcp_reass_maxseg) |
|
89SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, maxsegments, CTLFLAG_RDTUN, 90 &VNET_NAME(tcp_reass_maxseg), 0, 91 "Global maximum number of TCP Segments in Reassembly Queue"); 92 | 82SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, maxsegments, CTLFLAG_RDTUN, 83 &VNET_NAME(tcp_reass_maxseg), 0, 84 "Global maximum number of TCP Segments in Reassembly Queue"); 85 |
86VNET_DEFINE(int, tcp_reass_qsize) = 0; |
|
93SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, cursegments, CTLFLAG_RD, 94 &VNET_NAME(tcp_reass_qsize), 0, 95 "Global number of TCP Segments currently in Reassembly Queue"); 96 | 87SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, cursegments, CTLFLAG_RD, 88 &VNET_NAME(tcp_reass_qsize), 0, 89 "Global number of TCP Segments currently in Reassembly Queue"); 90 |
91static VNET_DEFINE(int, tcp_reass_maxqlen) = 48; 92#define V_tcp_reass_maxqlen VNET(tcp_reass_maxqlen) |
|
97SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, maxqlen, CTLFLAG_RW, 98 &VNET_NAME(tcp_reass_maxqlen), 0, 99 "Maximum number of TCP Segments per individual Reassembly Queue"); 100 | 93SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, maxqlen, CTLFLAG_RW, 94 &VNET_NAME(tcp_reass_maxqlen), 0, 95 "Maximum number of TCP Segments per individual Reassembly Queue"); 96 |
97static VNET_DEFINE(int, tcp_reass_overflows) = 0; 98#define V_tcp_reass_overflows VNET(tcp_reass_overflows) |
|
101SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, overflows, CTLFLAG_RD, 102 &VNET_NAME(tcp_reass_overflows), 0, 103 "Global number of TCP Segment Reassembly Queue Overflows"); 104 105/* Initialize TCP reassembly queue */ 106static void 107tcp_reass_zone_change(void *tag) 108{ 109 110 V_tcp_reass_maxseg = nmbclusters / 16; 111 uma_zone_set_max(V_tcp_reass_zone, V_tcp_reass_maxseg); 112} 113 114VNET_DEFINE(uma_zone_t, tcp_reass_zone); 115 116void 117tcp_reass_init(void) 118{ 119 | 99SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, overflows, CTLFLAG_RD, 100 &VNET_NAME(tcp_reass_overflows), 0, 101 "Global number of TCP Segment Reassembly Queue Overflows"); 102 103/* Initialize TCP reassembly queue */ 104static void 105tcp_reass_zone_change(void *tag) 106{ 107 108 V_tcp_reass_maxseg = nmbclusters / 16; 109 uma_zone_set_max(V_tcp_reass_zone, V_tcp_reass_maxseg); 110} 111 112VNET_DEFINE(uma_zone_t, tcp_reass_zone); 113 114void 115tcp_reass_init(void) 116{ 117 |
120 V_tcp_reass_maxseg = 0; 121 V_tcp_reass_qsize = 0; 122 V_tcp_reass_maxqlen = 48; 123 V_tcp_reass_overflows = 0; 124 | |
125 V_tcp_reass_maxseg = nmbclusters / 16; 126 TUNABLE_INT_FETCH("net.inet.tcp.reass.maxsegments", 127 &V_tcp_reass_maxseg); 128 V_tcp_reass_zone = uma_zcreate("tcpreass", sizeof (struct tseg_qent), 129 NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); 130 uma_zone_set_max(V_tcp_reass_zone, V_tcp_reass_maxseg); 131 EVENTHANDLER_REGISTER(nmbclusters_change, 132 tcp_reass_zone_change, NULL, EVENTHANDLER_PRI_ANY); --- 172 unchanged lines hidden --- | 118 V_tcp_reass_maxseg = nmbclusters / 16; 119 TUNABLE_INT_FETCH("net.inet.tcp.reass.maxsegments", 120 &V_tcp_reass_maxseg); 121 V_tcp_reass_zone = uma_zcreate("tcpreass", sizeof (struct tseg_qent), 122 NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); 123 uma_zone_set_max(V_tcp_reass_zone, V_tcp_reass_maxseg); 124 EVENTHANDLER_REGISTER(nmbclusters_change, 125 tcp_reass_zone_change, NULL, EVENTHANDLER_PRI_ANY); --- 172 unchanged lines hidden --- |