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>


   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  23  * Copyright (c) 2011, Joyent Inc. All rights reserved.
  24  * Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.

  25  */
  26 
  27 #ifndef _INET_TCP_IMPL_H
  28 #define _INET_TCP_IMPL_H
  29 
  30 /*
  31  * TCP implementation private declarations.  These interfaces are
  32  * used to build the IP module and are not meant to be accessed
  33  * by any modules except IP itself.  They are undocumented and are
  34  * subject to change without notice.
  35  */
  36 
  37 #ifdef  __cplusplus
  38 extern "C" {
  39 #endif
  40 
  41 #ifdef _KERNEL
  42 
  43 #include <sys/cpuvar.h>
  44 #include <sys/clock_impl.h>       /* For LBOLT_FASTPATH{,64} */
  45 #include <inet/optcom.h>
  46 #include <inet/tcp.h>
  47 #include <inet/tunables.h>
  48 
  49 #define TCP_MOD_ID      5105
  50 
  51 extern struct qinit     tcp_sock_winit;
  52 extern struct qinit     tcp_winit;
  53 
  54 extern sock_downcalls_t sock_tcp_downcalls;
  55 
  56 /*











  57  * Bind hash list size and has function.  It has to be a power of 2 for
  58  * hashing.
  59  */
  60 #define TCP_BIND_FANOUT_SIZE    1024
  61 #define TCP_BIND_HASH(lport) (ntohs(lport) & (TCP_BIND_FANOUT_SIZE - 1))
  62 
  63 /*
  64  * This implementation follows the 4.3BSD interpretation of the urgent
  65  * pointer and not RFC 1122. Switching to RFC 1122 behavior would cause
  66  * incompatible changes in protocols like telnet and rlogin.
  67  */
  68 #define TCP_OLD_URP_INTERPRETATION      1
  69 
  70 /* TCP option length */
  71 #define TCPOPT_NOP_LEN          1
  72 #define TCPOPT_MAXSEG_LEN       4
  73 #define TCPOPT_WS_LEN           3
  74 #define TCPOPT_REAL_WS_LEN      (TCPOPT_WS_LEN+1)
  75 #define TCPOPT_TSTAMP_LEN       10
  76 #define TCPOPT_REAL_TS_LEN      (TCPOPT_TSTAMP_LEN+2)




   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  23  * Copyright (c) 2011, Joyent Inc. All rights reserved.
  24  * Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
  25  * Copyright (c) 2013 by Delphix. All rights reserved.
  26  */
  27 
  28 #ifndef _INET_TCP_IMPL_H
  29 #define _INET_TCP_IMPL_H
  30 
  31 /*
  32  * TCP implementation private declarations.  These interfaces are
  33  * used to build the IP module and are not meant to be accessed
  34  * by any modules except IP itself.  They are undocumented and are
  35  * subject to change without notice.
  36  */
  37 
  38 #ifdef  __cplusplus
  39 extern "C" {
  40 #endif
  41 
  42 #ifdef _KERNEL
  43 
  44 #include <sys/cpuvar.h>
  45 #include <sys/clock_impl.h>       /* For LBOLT_FASTPATH{,64} */
  46 #include <inet/optcom.h>
  47 #include <inet/tcp.h>
  48 #include <inet/tunables.h>
  49 
  50 #define TCP_MOD_ID      5105
  51 
  52 extern struct qinit     tcp_sock_winit;
  53 extern struct qinit     tcp_winit;
  54 
  55 extern sock_downcalls_t sock_tcp_downcalls;
  56 
  57 /*
  58  * Note that by default, the _snd_lowat_fraction tunable controls the value of
  59  * the transmit low water mark.  TCP_XMIT_LOWATER (and thus the _xmit_lowat
  60  * property) is only used if the administrator has disabled _snd_lowat_fraction
  61  * by setting it to 0.
  62  */
  63 #define TCP_XMIT_LOWATER        4096
  64 #define TCP_XMIT_HIWATER        49152
  65 #define TCP_RECV_LOWATER        2048
  66 #define TCP_RECV_HIWATER        128000
  67 
  68 /*
  69  * Bind hash list size and has function.  It has to be a power of 2 for
  70  * hashing.
  71  */
  72 #define TCP_BIND_FANOUT_SIZE    1024
  73 #define TCP_BIND_HASH(lport) (ntohs(lport) & (TCP_BIND_FANOUT_SIZE - 1))
  74 
  75 /*
  76  * This implementation follows the 4.3BSD interpretation of the urgent
  77  * pointer and not RFC 1122. Switching to RFC 1122 behavior would cause
  78  * incompatible changes in protocols like telnet and rlogin.
  79  */
  80 #define TCP_OLD_URP_INTERPRETATION      1
  81 
  82 /* TCP option length */
  83 #define TCPOPT_NOP_LEN          1
  84 #define TCPOPT_MAXSEG_LEN       4
  85 #define TCPOPT_WS_LEN           3
  86 #define TCPOPT_REAL_WS_LEN      (TCPOPT_WS_LEN+1)
  87 #define TCPOPT_TSTAMP_LEN       10
  88 #define TCPOPT_REAL_TS_LEN      (TCPOPT_TSTAMP_LEN+2)