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>

@@ -21,10 +21,11 @@
 
 /*
  * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2011, Joyent Inc. All rights reserved.
  * Copyright (c) 2011 Nexenta Systems, Inc. All rights reserved.
+ * Copyright (c) 2013 by Delphix. All rights reserved.
  */
 /* Copyright (c) 1990 Mentat Inc. */
 
 #include <sys/types.h>
 #include <sys/stream.h>

@@ -230,15 +231,10 @@
  * To prevent memory hog, limit the number of entries in tcp_free_list
  * to 1% of available memory / number of cpus
  */
 uint_t tcp_free_list_max_cnt = 0;
 
-#define TCP_XMIT_LOWATER        4096
-#define TCP_XMIT_HIWATER        49152
-#define TCP_RECV_LOWATER        2048
-#define TCP_RECV_HIWATER        128000
-
 #define TIDUSZ  4096    /* transport interface data unit size */
 
 /*
  * Size of acceptor hash list.  It has to be a power of 2 for hashing.
  */

@@ -2716,11 +2712,16 @@
                 tcp->tcp_issocket = 1;
         }
 
         connp->conn_rcvbuf = tcps->tcps_recv_hiwat;
         connp->conn_sndbuf = tcps->tcps_xmit_hiwat;
+        if (tcps->tcps_snd_lowat_fraction != 0) {
+                connp->conn_sndlowat = connp->conn_sndbuf /
+                    tcps->tcps_snd_lowat_fraction;
+        } else {
         connp->conn_sndlowat = tcps->tcps_xmit_lowat;
+        }
         connp->conn_so_type = SOCK_STREAM;
         connp->conn_wroff = connp->conn_ht_iphc_allocated +
             tcps->tcps_wroff_xtra;
 
         SOCK_CONNID_INIT(tcp->tcp_connid);