summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/inet/tcp
diff options
context:
space:
mode:
authorSebastien Roy <seb@delphix.com>2015-05-29 13:47:23 -0400
committerRichard Lowe <richlowe@richlowe.net>2019-08-19 22:32:46 +0000
commita2f04351e04971ab0879872d264d6038c156b860 (patch)
treecd6640900e1adf19b745c5f8e796a0e97c7a8ee7 /usr/src/uts/common/inet/tcp
parentc12492cf73149aa0aa845af5d59966b0eb5aa910 (diff)
downloadillumos-gate-a2f04351e04971ab0879872d264d6038c156b860.tar.gz
11547 Want connstat(1M) command to display per-connection TCP statistics
Portions contributed by: Cody Peter Mello <cody.mello@joyent.com> Portions contributed by: Ahmed G <ahmedg@delphix.com> Reviewed by: Jason King <jason.king@joyent.com> Reviewed by: Robert Mustacchi <rm@joyent.com> Reviewed by: Dan McDonald <danmcd@joyent.com> Approved by: Richard Lowe <richlowe@richlowe.net>
Diffstat (limited to 'usr/src/uts/common/inet/tcp')
-rw-r--r--usr/src/uts/common/inet/tcp/tcp.c19
-rw-r--r--usr/src/uts/common/inet/tcp/tcp_fusion.c9
-rw-r--r--usr/src/uts/common/inet/tcp/tcp_input.c46
-rw-r--r--usr/src/uts/common/inet/tcp/tcp_output.c22
-rw-r--r--usr/src/uts/common/inet/tcp/tcp_stats.c112
-rw-r--r--usr/src/uts/common/inet/tcp/tcp_time_wait.c4
-rw-r--r--usr/src/uts/common/inet/tcp/tcp_timers.c5
7 files changed, 108 insertions, 109 deletions
diff --git a/usr/src/uts/common/inet/tcp/tcp.c b/usr/src/uts/common/inet/tcp/tcp.c
index ee1d75924e..d7458c8eee 100644
--- a/usr/src/uts/common/inet/tcp/tcp.c
+++ b/usr/src/uts/common/inet/tcp/tcp.c
@@ -1231,11 +1231,6 @@ tcp_closei_local(tcp_t *tcp)
if (!TCP_IS_SOCKET(tcp))
tcp_acceptor_hash_remove(tcp);
- TCPS_UPDATE_MIB(tcps, tcpHCInSegs, tcp->tcp_ibsegs);
- tcp->tcp_ibsegs = 0;
- TCPS_UPDATE_MIB(tcps, tcpHCOutSegs, tcp->tcp_obsegs);
- tcp->tcp_obsegs = 0;
-
/*
* This can be called via tcp_time_wait_processing() if TCP gets a
* SYN with sequence number outside the TIME-WAIT connection's
@@ -1904,15 +1899,6 @@ tcp_reinit(tcp_t *tcp)
/* Cancel outstanding timers */
tcp_timers_stop(tcp);
- /*
- * Reset everything in the state vector, after updating global
- * MIB data from instance counters.
- */
- TCPS_UPDATE_MIB(tcps, tcpHCInSegs, tcp->tcp_ibsegs);
- tcp->tcp_ibsegs = 0;
- TCPS_UPDATE_MIB(tcps, tcpHCOutSegs, tcp->tcp_obsegs);
- tcp->tcp_obsegs = 0;
-
tcp_close_mpp(&tcp->tcp_xmit_head);
if (tcp->tcp_snd_zcopy_aware)
tcp_zcopy_notify(tcp);
@@ -2084,9 +2070,6 @@ tcp_reinit_values(tcp_t *tcp)
tcp->tcp_swnd = 0;
DONTCARE(tcp->tcp_cwnd); /* Init in tcp_process_options */
- ASSERT(tcp->tcp_ibsegs == 0);
- ASSERT(tcp->tcp_obsegs == 0);
-
if (connp->conn_ht_iphc != NULL) {
kmem_free(connp->conn_ht_iphc, connp->conn_ht_iphc_allocated);
connp->conn_ht_iphc = NULL;
@@ -2178,6 +2161,8 @@ tcp_reinit_values(tcp_t *tcp)
DONTCARE(tcp->tcp_rtt_sa); /* Init in tcp_init_values */
DONTCARE(tcp->tcp_rtt_sd); /* Init in tcp_init_values */
tcp->tcp_rtt_update = 0;
+ tcp->tcp_rtt_sum = 0;
+ tcp->tcp_rtt_cnt = 0;
DONTCARE(tcp->tcp_swl1); /* Init in case TCPS_LISTEN/TCPS_SYN_SENT */
DONTCARE(tcp->tcp_swl2); /* Init in case TCPS_LISTEN/TCPS_SYN_SENT */
diff --git a/usr/src/uts/common/inet/tcp/tcp_fusion.c b/usr/src/uts/common/inet/tcp/tcp_fusion.c
index 6acc02d769..e73c34de34 100644
--- a/usr/src/uts/common/inet/tcp/tcp_fusion.c
+++ b/usr/src/uts/common/inet/tcp/tcp_fusion.c
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015 by Delphix. All rights reserved.
*/
#include <sys/types.h>
@@ -645,14 +646,16 @@ tcp_fuse_output(tcp_t *tcp, mblk_t *mp, uint32_t send_size)
peer_tcp->tcp_rack = peer_tcp->tcp_rnxt;
TCPS_BUMP_MIB(tcps, tcpOutDataSegs);
+ TCPS_BUMP_MIB(tcps, tcpHCOutSegs);
TCPS_UPDATE_MIB(tcps, tcpOutDataBytes, send_size);
+ tcp->tcp_cs.tcp_out_data_bytes += send_size;
+ tcp->tcp_cs.tcp_out_data_segs++;
TCPS_BUMP_MIB(tcps, tcpHCInSegs);
TCPS_BUMP_MIB(tcps, tcpInDataInorderSegs);
TCPS_UPDATE_MIB(tcps, tcpInDataInorderBytes, send_size);
-
- BUMP_LOCAL(tcp->tcp_obsegs);
- BUMP_LOCAL(peer_tcp->tcp_ibsegs);
+ peer_tcp->tcp_cs.tcp_in_data_inorder_bytes += send_size;
+ peer_tcp->tcp_cs.tcp_in_data_inorder_segs++;
DTRACE_TCP5(send, void, NULL, ip_xmit_attr_t *, connp->conn_ixa,
__dtrace_tcp_void_ip_t *, NULL, tcp_t *, tcp,
diff --git a/usr/src/uts/common/inet/tcp/tcp_input.c b/usr/src/uts/common/inet/tcp/tcp_input.c
index 0e12d23c3e..dd50c3f6ad 100644
--- a/usr/src/uts/common/inet/tcp/tcp_input.c
+++ b/usr/src/uts/common/inet/tcp/tcp_input.c
@@ -559,7 +559,7 @@ tcp_process_options(tcp_t *tcp, tcpha_t *tcpha)
static mblk_t *
tcp_reass(tcp_t *tcp, mblk_t *mp, uint32_t start)
{
- uint32_t end;
+ uint32_t end, bytes;
mblk_t *mp1;
mblk_t *mp2;
mblk_t *next_mp;
@@ -578,26 +578,26 @@ tcp_reass(tcp_t *tcp, mblk_t *mp, uint32_t start)
freeb(mp);
continue;
}
+ bytes = end - start;
mp->b_cont = NULL;
TCP_REASS_SET_SEQ(mp, start);
TCP_REASS_SET_END(mp, end);
mp1 = tcp->tcp_reass_tail;
- if (!mp1) {
- tcp->tcp_reass_tail = mp;
- tcp->tcp_reass_head = mp;
- TCPS_BUMP_MIB(tcps, tcpInDataUnorderSegs);
- TCPS_UPDATE_MIB(tcps, tcpInDataUnorderBytes,
- end - start);
- continue;
- }
- /* New stuff completely beyond tail? */
- if (SEQ_GEQ(start, TCP_REASS_END(mp1))) {
- /* Link it on end. */
- mp1->b_cont = mp;
+ if (mp1 == NULL || SEQ_GEQ(start, TCP_REASS_END(mp1))) {
+ if (mp1 != NULL) {
+ /*
+ * New stuff is beyond the tail; link it on the
+ * end.
+ */
+ mp1->b_cont = mp;
+ } else {
+ tcp->tcp_reass_head = mp;
+ }
tcp->tcp_reass_tail = mp;
TCPS_BUMP_MIB(tcps, tcpInDataUnorderSegs);
- TCPS_UPDATE_MIB(tcps, tcpInDataUnorderBytes,
- end - start);
+ TCPS_UPDATE_MIB(tcps, tcpInDataUnorderBytes, bytes);
+ tcp->tcp_cs.tcp_in_data_unorder_segs++;
+ tcp->tcp_cs.tcp_in_data_unorder_bytes += bytes;
continue;
}
mp1 = tcp->tcp_reass_head;
@@ -2414,7 +2414,7 @@ tcp_input_data(void *arg, mblk_t *mp, void *arg2, ip_recv_attr_t *ira)
flags = (unsigned int)tcpha->tha_flags & 0xFF;
- BUMP_LOCAL(tcp->tcp_ibsegs);
+ TCPS_BUMP_MIB(tcps, tcpHCInSegs);
DTRACE_PROBE2(tcp__trace__recv, mblk_t *, mp, tcp_t *, tcp);
if ((flags & TH_URG) && sqp != NULL) {
@@ -2659,7 +2659,7 @@ tcp_input_data(void *arg, mblk_t *mp, void *arg2, ip_recv_attr_t *ira)
tcp->tcp_ack_tid = 0;
}
tcp_send_data(tcp, ack_mp);
- BUMP_LOCAL(tcp->tcp_obsegs);
+ TCPS_BUMP_MIB(tcps, tcpHCOutSegs);
TCPS_BUMP_MIB(tcps, tcpOutAck);
if (!IPCL_IS_NONSTR(connp)) {
@@ -3048,6 +3048,7 @@ try_again:;
if (tcp->tcp_rwnd == 0) {
TCPS_BUMP_MIB(tcps, tcpInWinProbe);
+ tcp->tcp_cs.tcp_in_zwnd_probes++;
} else {
TCPS_BUMP_MIB(tcps, tcpInDataPastWinSegs);
TCPS_UPDATE_MIB(tcps, tcpInDataPastWinBytes, -rgap);
@@ -3297,6 +3298,9 @@ ok:;
} else if (seg_len > 0) {
TCPS_BUMP_MIB(tcps, tcpInDataInorderSegs);
TCPS_UPDATE_MIB(tcps, tcpInDataInorderBytes, seg_len);
+ tcp->tcp_cs.tcp_in_data_inorder_segs++;
+ tcp->tcp_cs.tcp_in_data_inorder_bytes += seg_len;
+
/*
* If an out of order FIN was received before, and the seq
* num and len of the new segment match that of the FIN,
@@ -4146,7 +4150,7 @@ process_ack:
}
mp = tcp_ack_mp(tcp);
if (mp != NULL) {
- BUMP_LOCAL(tcp->tcp_obsegs);
+ TCPS_BUMP_MIB(tcps, tcpHCOutSegs);
TCPS_BUMP_MIB(tcps, tcpOutAck);
tcp_send_data(tcp, mp);
}
@@ -4837,6 +4841,8 @@ xmit_check:
TCPS_BUMP_MIB(tcps, tcpRetransSegs);
TCPS_UPDATE_MIB(tcps, tcpRetransBytes,
snd_size);
+ tcp->tcp_cs.tcp_out_retrans_segs++;
+ tcp->tcp_cs.tcp_out_retrans_bytes += snd_size;
tcp_send_data(tcp, mp1);
}
}
@@ -4912,7 +4918,7 @@ ack_check:
if (mp1 != NULL) {
tcp_send_data(tcp, mp1);
- BUMP_LOCAL(tcp->tcp_obsegs);
+ TCPS_BUMP_MIB(tcps, tcpHCOutSegs);
TCPS_BUMP_MIB(tcps, tcpOutAck);
}
if (tcp->tcp_ack_tid != 0) {
@@ -5228,6 +5234,8 @@ tcp_set_rto(tcp_t *tcp, hrtime_t rtt)
TCPS_BUMP_MIB(tcps, tcpRttUpdate);
tcp->tcp_rtt_update++;
+ tcp->tcp_rtt_sum += m;
+ tcp->tcp_rtt_cnt++;
/* tcp_rtt_sa is not 0 means this is a new sample. */
if (sa != 0) {
diff --git a/usr/src/uts/common/inet/tcp/tcp_output.c b/usr/src/uts/common/inet/tcp/tcp_output.c
index c836076430..f54ab3fb33 100644
--- a/usr/src/uts/common/inet/tcp/tcp_output.c
+++ b/usr/src/uts/common/inet/tcp/tcp_output.c
@@ -1273,7 +1273,9 @@ tcp_output(void *arg, mblk_t *mp, void *arg2, ip_recv_attr_t *dummy)
TCPS_BUMP_MIB(tcps, tcpOutDataSegs);
TCPS_UPDATE_MIB(tcps, tcpOutDataBytes, len);
- BUMP_LOCAL(tcp->tcp_obsegs);
+ TCPS_BUMP_MIB(tcps, tcpHCOutSegs);
+ tcp->tcp_cs.tcp_out_data_segs++;
+ tcp->tcp_cs.tcp_out_data_bytes += len;
/* Update the latest receive window size in TCP header. */
tcpha->tha_win = htons(tcp->tcp_rwnd >> tcp->tcp_rcv_ws);
@@ -1960,16 +1962,21 @@ tcp_send(tcp_t *tcp, const int mss, const int total_hdr_len,
}
*snxt += len;
*tail_unsent = (*xmit_tail)->b_wptr - mp1->b_wptr;
- BUMP_LOCAL(tcp->tcp_obsegs);
+ TCPS_BUMP_MIB(tcps, tcpHCOutSegs);
TCPS_BUMP_MIB(tcps, tcpOutDataSegs);
TCPS_UPDATE_MIB(tcps, tcpOutDataBytes, len);
+ tcp->tcp_cs.tcp_out_data_segs++;
+ tcp->tcp_cs.tcp_out_data_bytes += len;
tcp_send_data(tcp, mp);
continue;
}
*snxt += len; /* Adjust later if we don't send all of len */
+ TCPS_BUMP_MIB(tcps, tcpHCOutSegs);
TCPS_BUMP_MIB(tcps, tcpOutDataSegs);
TCPS_UPDATE_MIB(tcps, tcpOutDataBytes, len);
+ tcp->tcp_cs.tcp_out_data_segs++;
+ tcp->tcp_cs.tcp_out_data_bytes += len;
if (*tail_unsent) {
/* Are the bytes above us in flight? */
@@ -2145,6 +2152,7 @@ tcp_send(tcp_t *tcp, const int mss, const int total_hdr_len,
*snxt += spill;
tcp->tcp_last_sent_len += spill;
TCPS_UPDATE_MIB(tcps, tcpOutDataBytes, spill);
+ tcp->tcp_cs.tcp_out_data_bytes += spill;
/*
* Adjust the checksum
*/
@@ -2193,7 +2201,7 @@ tcp_send(tcp_t *tcp, const int mss, const int total_hdr_len,
*/
ixa->ixa_fragsize = ixa->ixa_pmtu;
ixa->ixa_extra_ident = 0;
- tcp->tcp_obsegs += num_lso_seg;
+ TCPS_BUMP_MIB(tcps, tcpHCOutSegs);
TCP_STAT(tcps, tcp_lso_times);
TCP_STAT_UPDATE(tcps, tcp_lso_pkt_out, num_lso_seg);
} else {
@@ -2204,7 +2212,7 @@ tcp_send(tcp_t *tcp, const int mss, const int total_hdr_len,
*/
lso_info_cleanup(mp);
tcp_send_data(tcp, mp);
- BUMP_LOCAL(tcp->tcp_obsegs);
+ TCPS_BUMP_MIB(tcps, tcpHCOutSegs);
}
}
@@ -2420,7 +2428,7 @@ tcp_xmit_ctl(char *str, tcp_t *tcp, uint32_t seq, uint32_t ack, int ctl)
tcp->tcp_rack_cnt = 0;
TCPS_BUMP_MIB(tcps, tcpOutAck);
}
- BUMP_LOCAL(tcp->tcp_obsegs);
+ TCPS_BUMP_MIB(tcps, tcpHCOutSegs);
tcpha->tha_seq = htonl(seq);
tcpha->tha_ack = htonl(ack);
/*
@@ -3394,6 +3402,8 @@ tcp_sack_rexmit(tcp_t *tcp, uint_t *flags)
TCPS_BUMP_MIB(tcps, tcpRetransSegs);
TCPS_UPDATE_MIB(tcps, tcpRetransBytes, seg_len);
TCPS_BUMP_MIB(tcps, tcpOutSackRetransSegs);
+ tcp->tcp_cs.tcp_out_retrans_segs++;
+ tcp->tcp_cs.tcp_out_retrans_bytes += seg_len;
/*
* Update tcp_rexmit_max to extend this SACK recovery phase.
* This happens when new data sent during fast recovery is
@@ -3464,6 +3474,8 @@ tcp_ss_rexmit(tcp_t *tcp)
old_snxt_mp->b_prev = (mblk_t *)(intptr_t)gethrtime();
TCPS_BUMP_MIB(tcps, tcpRetransSegs);
TCPS_UPDATE_MIB(tcps, tcpRetransBytes, cnt);
+ tcp->tcp_cs.tcp_out_retrans_segs++;
+ tcp->tcp_cs.tcp_out_retrans_bytes += cnt;
tcp->tcp_rexmit_nxt = snxt;
}
diff --git a/usr/src/uts/common/inet/tcp/tcp_stats.c b/usr/src/uts/common/inet/tcp/tcp_stats.c
index e6b13fe6c9..dbf320d09d 100644
--- a/usr/src/uts/common/inet/tcp/tcp_stats.c
+++ b/usr/src/uts/common/inet/tcp/tcp_stats.c
@@ -22,6 +22,7 @@
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, Joyent Inc. All rights reserved.
+ * Copyright (c) 2015, 2016 by Delphix. All rights reserved.
*/
#include <sys/types.h>
@@ -86,6 +87,50 @@ tcp_snmp_state(tcp_t *tcp)
}
}
+static void
+tcp_set_conninfo(tcp_t *tcp, struct tcpConnEntryInfo_s *tcei, boolean_t ispriv)
+{
+ /* Don't want just anybody seeing these... */
+ if (ispriv) {
+ tcei->ce_snxt = tcp->tcp_snxt;
+ tcei->ce_suna = tcp->tcp_suna;
+ tcei->ce_rnxt = tcp->tcp_rnxt;
+ tcei->ce_rack = tcp->tcp_rack;
+ } else {
+ /*
+ * Netstat, unfortunately, uses this to get send/receive queue
+ * sizes. How to fix? Why not compute the difference only?
+ */
+ tcei->ce_snxt = tcp->tcp_snxt - tcp->tcp_suna;
+ tcei->ce_suna = 0;
+ tcei->ce_rnxt = tcp->tcp_rnxt - tcp->tcp_rack;
+ tcei->ce_rack = 0;
+ }
+
+ tcei->ce_in_data_inorder_bytes = tcp->tcp_cs.tcp_in_data_inorder_bytes;
+ tcei->ce_in_data_inorder_segs = tcp->tcp_cs.tcp_in_data_inorder_segs;
+ tcei->ce_in_data_unorder_bytes = tcp->tcp_cs.tcp_in_data_unorder_bytes;
+ tcei->ce_in_data_unorder_segs = tcp->tcp_cs.tcp_in_data_unorder_segs;
+ tcei->ce_in_zwnd_probes = tcp->tcp_cs.tcp_in_zwnd_probes;
+
+ tcei->ce_out_data_bytes = tcp->tcp_cs.tcp_out_data_bytes;
+ tcei->ce_out_data_segs = tcp->tcp_cs.tcp_out_data_segs;
+ tcei->ce_out_retrans_bytes = tcp->tcp_cs.tcp_out_retrans_bytes;
+ tcei->ce_out_retrans_segs = tcp->tcp_cs.tcp_out_retrans_segs;
+ tcei->ce_out_zwnd_probes = tcp->tcp_cs.tcp_out_zwnd_probes;
+
+ tcei->ce_unsent = tcp->tcp_unsent;
+ tcei->ce_swnd = tcp->tcp_swnd;
+ tcei->ce_cwnd = tcp->tcp_cwnd;
+ tcei->ce_rwnd = tcp->tcp_rwnd;
+ tcei->ce_rto = tcp->tcp_rto;
+ tcei->ce_mss = tcp->tcp_mss;
+ tcei->ce_state = tcp->tcp_state;
+ tcei->ce_rtt_sa = NSEC2USEC(tcp->tcp_rtt_sa >> 3);
+ tcei->ce_rtt_sum = NSEC2USEC(tcp->tcp_rtt_sum);
+ tcei->ce_rtt_cnt = tcp->tcp_rtt_cnt;
+}
+
/*
* Return SNMP stuff in buffer in mpdata.
*/
@@ -183,11 +228,6 @@ tcp_snmp_get(queue_t *q, mblk_t *mpctl, boolean_t legacy_req)
continue; /* not in this zone */
tcp = connp->conn_tcp;
- TCPS_UPDATE_MIB(tcps, tcpHCInSegs, tcp->tcp_ibsegs);
- tcp->tcp_ibsegs = 0;
- TCPS_UPDATE_MIB(tcps, tcpHCOutSegs, tcp->tcp_obsegs);
- tcp->tcp_obsegs = 0;
-
tce6.tcp6ConnState = tce.tcpConnState =
tcp_snmp_state(tcp);
if (tce.tcpConnState == MIB2_TCP_established ||
@@ -243,35 +283,9 @@ tcp_snmp_get(queue_t *q, mblk_t *mpctl, boolean_t legacy_req)
} else {
tce6.tcp6ConnIfIndex = connp->conn_bound_if;
}
- /* Don't want just anybody seeing these... */
- if (ispriv) {
- tce6.tcp6ConnEntryInfo.ce_snxt =
- tcp->tcp_snxt;
- tce6.tcp6ConnEntryInfo.ce_suna =
- tcp->tcp_suna;
- tce6.tcp6ConnEntryInfo.ce_rnxt =
- tcp->tcp_rnxt;
- tce6.tcp6ConnEntryInfo.ce_rack =
- tcp->tcp_rack;
- } else {
- /*
- * Netstat, unfortunately, uses this to
- * get send/receive queue sizes. How to fix?
- * Why not compute the difference only?
- */
- tce6.tcp6ConnEntryInfo.ce_snxt =
- tcp->tcp_snxt - tcp->tcp_suna;
- tce6.tcp6ConnEntryInfo.ce_suna = 0;
- tce6.tcp6ConnEntryInfo.ce_rnxt =
- tcp->tcp_rnxt - tcp->tcp_rack;
- tce6.tcp6ConnEntryInfo.ce_rack = 0;
- }
- tce6.tcp6ConnEntryInfo.ce_swnd = tcp->tcp_swnd;
- tce6.tcp6ConnEntryInfo.ce_rwnd = tcp->tcp_rwnd;
- tce6.tcp6ConnEntryInfo.ce_rto = tcp->tcp_rto;
- tce6.tcp6ConnEntryInfo.ce_mss = tcp->tcp_mss;
- tce6.tcp6ConnEntryInfo.ce_state = tcp->tcp_state;
+ tcp_set_conninfo(tcp, &tce6.tcp6ConnEntryInfo,
+ ispriv);
tce6.tcp6ConnCreationProcess =
(connp->conn_cpid < 0) ? MIB2_UNKNOWN_PROCESS :
@@ -307,37 +321,9 @@ tcp_snmp_get(queue_t *q, mblk_t *mpctl, boolean_t legacy_req)
}
tce.tcpConnLocalPort = ntohs(connp->conn_lport);
tce.tcpConnRemPort = ntohs(connp->conn_fport);
- /* Don't want just anybody seeing these... */
- if (ispriv) {
- tce.tcpConnEntryInfo.ce_snxt =
- tcp->tcp_snxt;
- tce.tcpConnEntryInfo.ce_suna =
- tcp->tcp_suna;
- tce.tcpConnEntryInfo.ce_rnxt =
- tcp->tcp_rnxt;
- tce.tcpConnEntryInfo.ce_rack =
- tcp->tcp_rack;
- } else {
- /*
- * Netstat, unfortunately, uses this to
- * get send/receive queue sizes. How
- * to fix?
- * Why not compute the difference only?
- */
- tce.tcpConnEntryInfo.ce_snxt =
- tcp->tcp_snxt - tcp->tcp_suna;
- tce.tcpConnEntryInfo.ce_suna = 0;
- tce.tcpConnEntryInfo.ce_rnxt =
- tcp->tcp_rnxt - tcp->tcp_rack;
- tce.tcpConnEntryInfo.ce_rack = 0;
- }
- tce.tcpConnEntryInfo.ce_swnd = tcp->tcp_swnd;
- tce.tcpConnEntryInfo.ce_rwnd = tcp->tcp_rwnd;
- tce.tcpConnEntryInfo.ce_rto = tcp->tcp_rto;
- tce.tcpConnEntryInfo.ce_mss = tcp->tcp_mss;
- tce.tcpConnEntryInfo.ce_state =
- tcp->tcp_state;
+ tcp_set_conninfo(tcp, &tce.tcpConnEntryInfo,
+ ispriv);
tce.tcpConnCreationProcess =
(connp->conn_cpid < 0) ?
diff --git a/usr/src/uts/common/inet/tcp/tcp_time_wait.c b/usr/src/uts/common/inet/tcp/tcp_time_wait.c
index 72997de24a..caf7aeda50 100644
--- a/usr/src/uts/common/inet/tcp/tcp_time_wait.c
+++ b/usr/src/uts/common/inet/tcp/tcp_time_wait.c
@@ -608,7 +608,7 @@ tcp_time_wait_processing(tcp_t *tcp, mblk_t *mp, uint32_t seg_seq,
conn_t *connp = tcp->tcp_connp;
tcp_stack_t *tcps = tcp->tcp_tcps;
- BUMP_LOCAL(tcp->tcp_ibsegs);
+ TCPS_BUMP_MIB(tcps, tcpHCInSegs);
DTRACE_PROBE2(tcp__trace__recv, mblk_t *, mp, tcp_t *, tcp);
flags = (unsigned int)tcpha->tha_flags & 0xFF;
@@ -794,6 +794,8 @@ tcp_time_wait_processing(tcp_t *tcp, mblk_t *mp, uint32_t seg_seq,
TCPS_BUMP_MIB(tcps, tcpInClosed);
TCPS_BUMP_MIB(tcps, tcpInDataInorderSegs);
TCPS_UPDATE_MIB(tcps, tcpInDataInorderBytes, seg_len);
+ tcp->tcp_cs.tcp_in_data_inorder_segs++;
+ tcp->tcp_cs.tcp_in_data_inorder_bytes += seg_len;
}
if (flags & TH_RST) {
(void) tcp_clean_death(tcp, 0);
diff --git a/usr/src/uts/common/inet/tcp/tcp_timers.c b/usr/src/uts/common/inet/tcp/tcp_timers.c
index b890bf6142..81cf5c57a5 100644
--- a/usr/src/uts/common/inet/tcp/tcp_timers.c
+++ b/usr/src/uts/common/inet/tcp/tcp_timers.c
@@ -594,7 +594,7 @@ tcp_ack_timer(void *arg)
mp = tcp_ack_mp(tcp);
if (mp != NULL) {
- BUMP_LOCAL(tcp->tcp_obsegs);
+ TCPS_BUMP_MIB(tcps, tcpHCOutSegs);
TCPS_BUMP_MIB(tcps, tcpOutAck);
TCPS_BUMP_MIB(tcps, tcpOutAckDelayed);
tcp_send_data(tcp, mp);
@@ -853,6 +853,7 @@ tcp_timer(void *arg)
tcp->tcp_swnd++;
tcp->tcp_zero_win_probe = B_TRUE;
TCPS_BUMP_MIB(tcps, tcpOutWinProbe);
+ tcp->tcp_cs.tcp_out_zwnd_probes++;
} else {
/*
* Handle timeout from sender SWS avoidance.
@@ -1081,6 +1082,8 @@ timer_rexmit:
tcp->tcp_csuna = tcp->tcp_snxt;
TCPS_BUMP_MIB(tcps, tcpRetransSegs);
TCPS_UPDATE_MIB(tcps, tcpRetransBytes, mss);
+ tcp->tcp_cs.tcp_out_retrans_segs++;
+ tcp->tcp_cs.tcp_out_retrans_bytes += mss;
tcp_send_data(tcp, mp);
}