diff options
author | jlemon <jlemon@FreeBSD.org> | 1999-08-26 19:52:17 +0000 |
---|---|---|
committer | jlemon <jlemon@FreeBSD.org> | 1999-08-26 19:52:17 +0000 |
commit | 9e654e1019b063fcd4e369ed888eef57d59acd1a (patch) | |
tree | 7ba927caf9fb5383cffcda1845d621d811639dae | |
parent | c3f2c4e2a93c8e228753b6aa87dc19759d9724be (diff) | |
download | FreeBSD-src-9e654e1019b063fcd4e369ed888eef57d59acd1a.zip FreeBSD-src-9e654e1019b063fcd4e369ed888eef57d59acd1a.tar.gz |
Add readonly OID ``net.inet.tcp.tcbhashsize'' so it is possible to
discover the size of the TCB hashtable on a running system.
-rw-r--r-- | sys/netinet/tcp_subr.c | 7 | ||||
-rw-r--r-- | sys/netinet/tcp_timewait.c | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index adc4ac9..f5c5b10 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95 - * $Id: tcp_subr.c,v 1.56 1999/07/05 08:46:55 msmith Exp $ + * $Id: tcp_subr.c,v 1.57 1999/07/11 18:32:45 green Exp $ */ #include "opt_compat.h" @@ -86,6 +86,10 @@ static int tcp_do_rfc1644 = 0; SYSCTL_INT(_net_inet_tcp, TCPCTL_DO_RFC1644, rfc1644, CTLFLAG_RW, &tcp_do_rfc1644 , 0, "Enable rfc1644 (TTCP) extensions"); +static int tcp_tcbhashsize = 0; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, tcbhashsize, CTLFLAG_RD, + &tcp_tcbhashsize, 0, "Size of TCP control-block hashtable"); + SYSCTL_INT(_net_inet_tcp, OID_AUTO, pcbcount, CTLFLAG_RD, &tcbinfo.ipi_count, 0, "Number of active PCBs"); @@ -140,6 +144,7 @@ tcp_init() printf("WARNING: TCB hash size not a power of 2\n"); hashsize = 512; /* safe default */ } + tcp_tcbhashsize = hashsize; tcbinfo.hashbase = hashinit(hashsize, M_PCB, &tcbinfo.hashmask); tcbinfo.porthashbase = hashinit(hashsize, M_PCB, &tcbinfo.porthashmask); diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index adc4ac9..f5c5b10 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95 - * $Id: tcp_subr.c,v 1.56 1999/07/05 08:46:55 msmith Exp $ + * $Id: tcp_subr.c,v 1.57 1999/07/11 18:32:45 green Exp $ */ #include "opt_compat.h" @@ -86,6 +86,10 @@ static int tcp_do_rfc1644 = 0; SYSCTL_INT(_net_inet_tcp, TCPCTL_DO_RFC1644, rfc1644, CTLFLAG_RW, &tcp_do_rfc1644 , 0, "Enable rfc1644 (TTCP) extensions"); +static int tcp_tcbhashsize = 0; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, tcbhashsize, CTLFLAG_RD, + &tcp_tcbhashsize, 0, "Size of TCP control-block hashtable"); + SYSCTL_INT(_net_inet_tcp, OID_AUTO, pcbcount, CTLFLAG_RD, &tcbinfo.ipi_count, 0, "Number of active PCBs"); @@ -140,6 +144,7 @@ tcp_init() printf("WARNING: TCB hash size not a power of 2\n"); hashsize = 512; /* safe default */ } + tcp_tcbhashsize = hashsize; tcbinfo.hashbase = hashinit(hashsize, M_PCB, &tcbinfo.hashmask); tcbinfo.porthashbase = hashinit(hashsize, M_PCB, &tcbinfo.porthashmask); |