diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2004-03-02 12:51:13 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2004-03-02 12:51:13 +0000 |
commit | 835d04e86adaca1827270e4164d33b5015f1f893 (patch) | |
tree | f90f281b7d537c1f1f8722c6904cd20b5428ec14 /sys/netinet/tcp_subr.c | |
parent | 1e2f9f75f8131bfba8403f7d557dd4273ea61601 (diff) |
limit total number of queued out-of-order packets to NMBCLUSTERS/2; ok mcbride
Diffstat (limited to 'sys/netinet/tcp_subr.c')
-rw-r--r-- | sys/netinet/tcp_subr.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index b920816bad5..27e9bd25203 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_subr.c,v 1.76 2004/02/27 16:44:45 markus Exp $ */ +/* $OpenBSD: tcp_subr.c,v 1.77 2004/03/02 12:51:12 markus Exp $ */ /* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */ /* @@ -148,17 +148,18 @@ int tcp_syn_cache_limit = TCP_SYN_HASH_SIZE*TCP_SYN_BUCKET_SIZE; int tcp_syn_bucket_limit = 3*TCP_SYN_BUCKET_SIZE; struct syn_cache_head tcp_syn_cache[TCP_SYN_HASH_SIZE]; +int tcp_reass_limit = NMBCLUSTERS / 2; /* hardlimit for tcpqe_pool */ + #ifdef INET6 extern int ip6_defhlim; #endif /* INET6 */ struct pool tcpcb_pool; +struct pool tcpqe_pool; #ifdef TCP_SACK struct pool sackhl_pool; #endif -int tcp_freeq(struct tcpcb *); - struct tcpstat tcpstat; /* tcp statistics */ tcp_seq tcp_iss; @@ -173,6 +174,9 @@ tcp_init() #endif /* TCP_COMPAT_42 */ pool_init(&tcpcb_pool, sizeof(struct tcpcb), 0, 0, 0, "tcpcbpl", NULL); + pool_init(&tcpqe_pool, sizeof(struct ipqent), 0, 0, 0, "tcpqepl", + NULL); + pool_sethardlimit(&tcpqe_pool, tcp_reass_limit, NULL, 0); #ifdef TCP_SACK pool_init(&sackhl_pool, sizeof(struct sackhole), 0, 0, 0, "sackhlpl", NULL); @@ -717,7 +721,7 @@ tcp_freeq(struct tcpcb *tp) while ((qe = LIST_FIRST(&tp->segq)) != NULL) { LIST_REMOVE(qe, ipqe_q); m_freem(qe->ipqe_m); - pool_put(&ipqent_pool, qe); + pool_put(&tcpqe_pool, qe); rv = 1; } return (rv); |