Print this page
3942 inject sanity into ipadm tcp buffer size properties
3943 _snd_lowat_fraction tcp tunable has no effect
Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Peng Dai <peng.dai@delphix.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/inet/tcp/tcp.c
          +++ new/usr/src/uts/common/inet/tcp/tcp.c
↓ open down ↓ 15 lines elided ↑ open up ↑
  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  /*
  23   23   * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
  24   24   * Copyright (c) 2011, Joyent Inc. All rights reserved.
  25   25   * Copyright (c) 2011 Nexenta Systems, Inc. All rights reserved.
       26 + * Copyright (c) 2013 by Delphix. All rights reserved.
  26   27   */
  27   28  /* Copyright (c) 1990 Mentat Inc. */
  28   29  
  29   30  #include <sys/types.h>
  30   31  #include <sys/stream.h>
  31   32  #include <sys/strsun.h>
  32   33  #include <sys/strsubr.h>
  33   34  #include <sys/stropts.h>
  34   35  #include <sys/strlog.h>
  35   36  #define _SUN_TPI_VERSION 2
↓ open down ↓ 189 lines elided ↑ open up ↑
 225  226   */
 226  227  int tcp_squeue_wput = 2;        /* /etc/systems */
 227  228  int tcp_squeue_flag;
 228  229  
 229  230  /*
 230  231   * To prevent memory hog, limit the number of entries in tcp_free_list
 231  232   * to 1% of available memory / number of cpus
 232  233   */
 233  234  uint_t tcp_free_list_max_cnt = 0;
 234  235  
 235      -#define TCP_XMIT_LOWATER        4096
 236      -#define TCP_XMIT_HIWATER        49152
 237      -#define TCP_RECV_LOWATER        2048
 238      -#define TCP_RECV_HIWATER        128000
 239      -
 240  236  #define TIDUSZ  4096    /* transport interface data unit size */
 241  237  
 242  238  /*
 243  239   * Size of acceptor hash list.  It has to be a power of 2 for hashing.
 244  240   */
 245  241  #define TCP_ACCEPTOR_FANOUT_SIZE                512
 246  242  
 247  243  #ifdef  _ILP32
 248  244  #define TCP_ACCEPTOR_HASH(accid)                                        \
 249  245                  (((uint_t)(accid) >> 8) & (TCP_ACCEPTOR_FANOUT_SIZE - 1))
↓ open down ↓ 2461 lines elided ↑ open up ↑
2711 2707                  connp->conn_mac_mode = CONN_MAC_AWARE;
2712 2708  
2713 2709          connp->conn_zone_is_global = (crgetzoneid(credp) == GLOBAL_ZONEID);
2714 2710  
2715 2711          if (issocket) {
2716 2712                  tcp->tcp_issocket = 1;
2717 2713          }
2718 2714  
2719 2715          connp->conn_rcvbuf = tcps->tcps_recv_hiwat;
2720 2716          connp->conn_sndbuf = tcps->tcps_xmit_hiwat;
2721      -        connp->conn_sndlowat = tcps->tcps_xmit_lowat;
     2717 +        if (tcps->tcps_snd_lowat_fraction != 0) {
     2718 +                connp->conn_sndlowat = connp->conn_sndbuf /
     2719 +                    tcps->tcps_snd_lowat_fraction;
     2720 +        } else {
     2721 +                connp->conn_sndlowat = tcps->tcps_xmit_lowat;
     2722 +        }
2722 2723          connp->conn_so_type = SOCK_STREAM;
2723 2724          connp->conn_wroff = connp->conn_ht_iphc_allocated +
2724 2725              tcps->tcps_wroff_xtra;
2725 2726  
2726 2727          SOCK_CONNID_INIT(tcp->tcp_connid);
2727 2728          /* DTrace ignores this - it isn't a tcp:::state-change */
2728 2729          tcp->tcp_state = TCPS_IDLE;
2729 2730          tcp_init_values(tcp, NULL);
2730 2731          return (connp);
2731 2732  }
↓ open down ↓ 1743 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX