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>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/inet/tcp/tcp_fusion.c
          +++ new/usr/src/uts/common/inet/tcp/tcp_fusion.c
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
       23 + * Copyright (c) 2015 by Delphix. All rights reserved.
  23   24   */
  24   25  
  25   26  #include <sys/types.h>
  26   27  #include <sys/stream.h>
  27   28  #include <sys/strsun.h>
  28   29  #include <sys/strsubr.h>
  29   30  #include <sys/debug.h>
  30   31  #include <sys/sdt.h>
  31   32  #include <sys/cmn_err.h>
  32   33  #include <sys/tihdr.h>
↓ open down ↓ 605 lines elided ↑ open up ↑
 638  639          tcp->tcp_last_sent_len = send_size;
 639  640  
 640  641          /* Need to adjust the following SNMP MIB-related variables */
 641  642          tcp->tcp_snxt += send_size;
 642  643          tcp->tcp_suna = tcp->tcp_snxt;
 643  644          peer_tcp->tcp_rnxt += recv_size;
 644  645          peer_tcp->tcp_last_recv_len = recv_size;
 645  646          peer_tcp->tcp_rack = peer_tcp->tcp_rnxt;
 646  647  
 647  648          TCPS_BUMP_MIB(tcps, tcpOutDataSegs);
      649 +        TCPS_BUMP_MIB(tcps, tcpHCOutSegs);
 648  650          TCPS_UPDATE_MIB(tcps, tcpOutDataBytes, send_size);
      651 +        tcp->tcp_cs.tcp_out_data_bytes += send_size;
      652 +        tcp->tcp_cs.tcp_out_data_segs++;
 649  653  
 650  654          TCPS_BUMP_MIB(tcps, tcpHCInSegs);
 651  655          TCPS_BUMP_MIB(tcps, tcpInDataInorderSegs);
 652  656          TCPS_UPDATE_MIB(tcps, tcpInDataInorderBytes, send_size);
      657 +        peer_tcp->tcp_cs.tcp_in_data_inorder_bytes += send_size;
      658 +        peer_tcp->tcp_cs.tcp_in_data_inorder_segs++;
 653  659  
 654      -        BUMP_LOCAL(tcp->tcp_obsegs);
 655      -        BUMP_LOCAL(peer_tcp->tcp_ibsegs);
 656      -
 657  660          DTRACE_TCP5(send, void, NULL, ip_xmit_attr_t *, connp->conn_ixa,
 658  661              __dtrace_tcp_void_ip_t *, NULL, tcp_t *, tcp,
 659  662              __dtrace_tcp_tcph_t *, NULL);
 660  663          DTRACE_TCP5(receive, void, NULL, ip_xmit_attr_t *,
 661  664              peer_connp->conn_ixa, __dtrace_tcp_void_ip_t *, NULL,
 662  665              tcp_t *, peer_tcp, __dtrace_tcp_tcph_t *, NULL);
 663  666  
 664  667          if (!IPCL_IS_NONSTR(peer_tcp->tcp_connp) &&
 665  668              !TCP_IS_DETACHED(peer_tcp)) {
 666  669                  /*
↓ open down ↓ 222 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX