diff options
author | Kacheong Poon <Kacheong.Poon@Sun.COM> | 2010-02-26 07:49:01 -0800 |
---|---|---|
committer | Kacheong Poon <Kacheong.Poon@Sun.COM> | 2010-02-26 07:49:01 -0800 |
commit | 47b75f87aad8081805fc42779dae59a3ee1de59d (patch) | |
tree | 73df1c5754df638510dae1f9e5f98e62f7d2cccb /usr/src | |
parent | ab5dfd5e82c7de6e8a7172573741f3c5890a82fa (diff) | |
download | illumos-gate-47b75f87aad8081805fc42779dae59a3ee1de59d.tar.gz |
6928514 ilb_nat_src_timer fires too early
6929436 Some TCP stats are reported incorrectly
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/uts/common/inet/ilb/ilb_nat.c | 8 | ||||
-rw-r--r-- | usr/src/uts/common/inet/tcp/tcp_stats.c | 19 |
2 files changed, 16 insertions, 11 deletions
diff --git a/usr/src/uts/common/inet/ilb/ilb_nat.c b/usr/src/uts/common/inet/ilb/ilb_nat.c index 0be473fb12..6fd790e9a4 100644 --- a/usr/src/uts/common/inet/ilb/ilb_nat.c +++ b/usr/src/uts/common/inet/ilb/ilb_nat.c @@ -20,7 +20,7 @@ */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -135,9 +135,6 @@ ilb_nat_src_init(ilb_stack_t *ilbs) { int i; - ilbs->ilbs_nat_src_tid = timeout(ilb_nat_src_timer, ilbs, - SEC_TO_TICK(ILB_NAT_SRC_TIMEOUT + - gethrtime() % ILB_NAT_SRC_TIMEOUT_JITTER)); ilbs->ilbs_nat_src = kmem_zalloc(sizeof (ilb_nat_src_hash_t) * ilbs->ilbs_nat_src_hash_size, KM_SLEEP); for (i = 0; i < ilbs->ilbs_nat_src_hash_size; i++) { @@ -147,6 +144,9 @@ ilb_nat_src_init(ilb_stack_t *ilbs) mutex_init(&ilbs->ilbs_nat_src[i].nsh_lock, NULL, MUTEX_DEFAULT, NULL); } + ilbs->ilbs_nat_src_tid = timeout(ilb_nat_src_timer, ilbs, + SEC_TO_TICK(ILB_NAT_SRC_TIMEOUT + + gethrtime() % ILB_NAT_SRC_TIMEOUT_JITTER)); } /* diff --git a/usr/src/uts/common/inet/tcp/tcp_stats.c b/usr/src/uts/common/inet/tcp/tcp_stats.c index 3993f09d3f..d7b818d807 100644 --- a/usr/src/uts/common/inet/tcp/tcp_stats.c +++ b/usr/src/uts/common/inet/tcp/tcp_stats.c @@ -180,7 +180,7 @@ tcp_snmp_get(queue_t *q, mblk_t *mpctl) tcp_snmp_state(tcp); if (tce.tcpConnState == MIB2_TCP_established || tce.tcpConnState == MIB2_TCP_closeWait) - TCPS_BUMP_MIB(tcps, tcpCurrEstab); + BUMP_MIB(&tcp_mib, tcpCurrEstab); needattr = B_FALSE; bzero(&mlp, sizeof (mlp)); @@ -346,16 +346,17 @@ tcp_snmp_get(queue_t *q, mblk_t *mpctl) } } - /* fixed length structure for IPv4 and IPv6 counters */ - SET_MIB(tcp_mib.tcpConnTableSize, sizeof (mib2_tcpConnEntry_t)); - SET_MIB(tcp_mib.tcp6ConnTableSize, sizeof (mib2_tcp6ConnEntry_t)); + tcp_sum_mib(tcps, &tcp_mib); - /* synchronize 32- and 64-bit counters */ + /* + * Synchronize 32- and 64-bit counters. Note that tcpInSegs and + * tcpOutSegs are not updated anywhere in TCP. The new 64 bits + * counters are used. Hence the old counters' values in tcp_sc_mib + * are always 0. + */ SYNC32_MIB(&tcp_mib, tcpInSegs, tcpHCInSegs); SYNC32_MIB(&tcp_mib, tcpOutSegs, tcpHCOutSegs); - tcp_sum_mib(tcps, &tcp_mib); - optp = (struct opthdr *)&mpctl->b_rptr[sizeof (struct T_optmgmt_ack)]; optp->level = MIB2_TCP; optp->name = 0; @@ -855,6 +856,10 @@ tcp_sum_mib(tcp_stack_t *tcps, mib2_tcp_t *tcp_mib) cnt = tcps->tcps_sc_cnt; for (i = 0; i < cnt; i++) tcp_cp_mib(&tcps->tcps_sc[i]->tcp_sc_mib, tcp_mib); + + /* Fixed length structure for IPv4 and IPv6 counters */ + SET_MIB(tcp_mib->tcpConnTableSize, sizeof (mib2_tcpConnEntry_t)); + SET_MIB(tcp_mib->tcp6ConnTableSize, sizeof (mib2_tcp6ConnEntry_t)); } /* |