diff options
author | 2016-07-20 19:57:53 +0000 | |
---|---|---|
committer | 2016-07-20 19:57:53 +0000 | |
commit | 01461878cdf93c9dff6ec80e05aa8f172daae557 (patch) | |
tree | 6b714dfd8aafaa50efa6022838f1fcbadb62d59a /sys/netinet/tcp_usrreq.c | |
parent | Use more compact idiom to select architecture dependent files to compile. No (diff) | |
download | wireguard-openbsd-01461878cdf93c9dff6ec80e05aa8f172daae557.tar.xz wireguard-openbsd-01461878cdf93c9dff6ec80e05aa8f172daae557.zip |
To tune the TCP SYN cache we need more information. Print the
relevant counters with netstat -s -p tcp.
OK henning@
Diffstat (limited to 'sys/netinet/tcp_usrreq.c')
-rw-r--r-- | sys/netinet/tcp_usrreq.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 79e16cf1737..9fbcecf3f42 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_usrreq.c,v 1.133 2016/07/20 09:15:28 bluhm Exp $ */ +/* $OpenBSD: tcp_usrreq.c,v 1.134 2016/07/20 19:57:53 bluhm Exp $ */ /* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */ /* @@ -936,6 +936,24 @@ tcp_sysctl(name, namelen, oldp, oldlenp, newp, newlen) case TCPCTL_STATS: if (newp != NULL) return (EPERM); + { + struct syn_cache_set *set; + int i; + + set = &tcp_syn_cache[tcp_syn_cache_active]; + tcpstat.tcps_sc_hash_size = set->scs_size; + tcpstat.tcps_sc_entry_count = set->scs_count; + tcpstat.tcps_sc_entry_limit = tcp_syn_cache_limit; + tcpstat.tcps_sc_bucket_maxlen = 0; + for (i = 0; i < set->scs_size; i++) { + if (tcpstat.tcps_sc_bucket_maxlen < + set->scs_buckethead[i].sch_length) + tcpstat.tcps_sc_bucket_maxlen = + set->scs_buckethead[i].sch_length; + } + tcpstat.tcps_sc_bucket_limit = tcp_syn_bucket_limit; + tcpstat.tcps_sc_uses_left = set->scs_use; + } return (sysctl_struct(oldp, oldlenp, newp, newlen, &tcpstat, sizeof(tcpstat))); |