Print this page
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>

@@ -18,10 +18,11 @@
  *
  * CDDL HEADER END
  */
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015 by Delphix. All rights reserved.
  */
 
 #include <sys/types.h>
 #include <sys/stream.h>
 #include <sys/strsun.h>

@@ -643,19 +644,21 @@
         peer_tcp->tcp_rnxt += recv_size;
         peer_tcp->tcp_last_recv_len = recv_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);
+        peer_tcp->tcp_cs.tcp_in_data_inorder_bytes += send_size;
+        peer_tcp->tcp_cs.tcp_in_data_inorder_segs++;
 
-        BUMP_LOCAL(tcp->tcp_obsegs);
-        BUMP_LOCAL(peer_tcp->tcp_ibsegs);
-
         DTRACE_TCP5(send, void, NULL, ip_xmit_attr_t *, connp->conn_ixa,
             __dtrace_tcp_void_ip_t *, NULL, tcp_t *, tcp,
             __dtrace_tcp_tcph_t *, NULL);
         DTRACE_TCP5(receive, void, NULL, ip_xmit_attr_t *,
             peer_connp->conn_ixa, __dtrace_tcp_void_ip_t *, NULL,