summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_subr.c
diff options
context:
space:
mode:
authorandre <andre@FreeBSD.org>2004-02-24 15:27:41 +0000
committerandre <andre@FreeBSD.org>2004-02-24 15:27:41 +0000
commit5ef70fe223ecca1ecc385a720742f0b16159e859 (patch)
treeeda4f0335f73851268852863dcbbd967de416d1f /sys/netinet/tcp_subr.c
parente94b95684a67ec548cafe6ed6e753eecec3c60ec (diff)
downloadFreeBSD-src-5ef70fe223ecca1ecc385a720742f0b16159e859.zip
FreeBSD-src-5ef70fe223ecca1ecc385a720742f0b16159e859.tar.gz
Convert the tcp segment reassembly queue to UMA and limit the maximum
amount of segments it will hold. The following tuneables and sysctls control the behaviour of the tcp segment reassembly queue: net.inet.tcp.reass.maxsegments (loader tuneable) specifies the maximum number of segments all tcp reassemly queues can hold (defaults to 1/16 of nmbclusters). net.inet.tcp.reass.maxqlen specifies the maximum number of segments any individual tcp session queue can hold (defaults to 48). net.inet.tcp.reass.cursegments (readonly) counts the number of segments currently in all reassembly queues. net.inet.tcp.reass.overflows (readonly) counts how often either the global or local queue limit has been reached. Tested by: bms, silby Reviewed by: bms, silby
Diffstat (limited to 'sys/netinet/tcp_subr.c')
-rw-r--r--sys/netinet/tcp_subr.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 0878744..210a582 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -289,6 +289,7 @@ tcp_init()
tcp_timer_init();
syncache_init();
tcp_hc_init();
+ tcp_reass_init();
}
/*
@@ -711,7 +712,9 @@ tcp_discardcb(tp)
while ((q = LIST_FIRST(&tp->t_segq)) != NULL) {
LIST_REMOVE(q, tqe_q);
m_freem(q->tqe_m);
- FREE(q, M_TSEGQ);
+ uma_zfree(tcp_reass_zone, q);
+ tp->t_segqlen--;
+ tcp_reass_qsize--;
}
inp->inp_ppcb = NULL;
tp->t_inpcb = NULL;
@@ -772,7 +775,9 @@ tcp_drain()
!= NULL) {
LIST_REMOVE(te, tqe_q);
m_freem(te->tqe_m);
- FREE(te, M_TSEGQ);
+ uma_zfree(tcp_reass_zone, te);
+ tcpb->t_segqlen--;
+ tcp_reass_qsize--;
}
}
INP_UNLOCK(inpb);
OpenPOWER on IntegriCloud