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/ip/icmp.c
          +++ new/usr/src/uts/common/inet/ip/icmp.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) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
       23 + * Copyright (c) 2013 by Delphix. All rights reserved.
  23   24   */
  24   25  /* Copyright (c) 1990 Mentat Inc. */
  25   26  
  26   27  #include <sys/types.h>
  27   28  #include <sys/stream.h>
  28   29  #include <sys/stropts.h>
  29   30  #include <sys/strlog.h>
  30   31  #include <sys/strsun.h>
  31   32  #define _SUN_TPI_VERSION 2
  32   33  #include <sys/tihdr.h>
↓ open down ↓ 52 lines elided ↑ open up ↑
  85   86   * Synchronization notes:
  86   87   *
  87   88   * RAWIP is MT and uses the usual kernel synchronization primitives. We use
  88   89   * conn_lock to protect the icmp_t.
  89   90   *
  90   91   * Plumbing notes:
  91   92   * ICMP is always a device driver. For compatibility with mibopen() code
  92   93   * it is possible to I_PUSH "icmp", but that results in pushing a passthrough
  93   94   * dummy module.
  94   95   */
  95      -
  96   96  static void     icmp_addr_req(queue_t *q, mblk_t *mp);
  97   97  static void     icmp_tpi_bind(queue_t *q, mblk_t *mp);
  98   98  static void     icmp_bind_proto(icmp_t *icmp);
  99   99  static int      icmp_build_hdr_template(conn_t *, const in6_addr_t *,
 100  100      const in6_addr_t *, uint32_t);
 101  101  static void     icmp_capability_req(queue_t *q, mblk_t *mp);
 102  102  static int      icmp_close(queue_t *q, int flags);
 103  103  static void     icmp_close_free(conn_t *);
 104  104  static void     icmp_tpi_connect(queue_t *q, mblk_t *mp);
 105  105  static void     icmp_tpi_disconnect(queue_t *q, mblk_t *mp);
↓ open down ↓ 100 lines elided ↑ open up ↑
 206  206          T_INVALID,      /* CDATA_size. icmp does not support connect data. */
 207  207          T_INVALID,      /* DDATA_size. icmp does not support disconnect data. */
 208  208          0,              /* ADDR_size - filled in later. */
 209  209          0,              /* OPT_size - not initialized here */
 210  210          IP_MAXPACKET,   /* TIDU_size.  icmp allows maximum size messages. */
 211  211          T_CLTS,         /* SERV_type.  icmp supports connection-less. */
 212  212          TS_UNBND,       /* CURRENT_state.  This is set from icmp_state. */
 213  213          (XPG4_1|SENDZERO) /* PROVIDER_flag */
 214  214  };
 215  215  
      216 +static int
      217 +icmp_set_buf_prop(netstack_t *stack, cred_t *cr, mod_prop_info_t *pinfo,
      218 +    const char *ifname, const void *pval, uint_t flags)
      219 +{
      220 +        return (mod_set_buf_prop(stack->netstack_icmp->is_propinfo_tbl,
      221 +            stack, cr, pinfo, ifname, pval, flags));
      222 +}
      223 +
      224 +static int
      225 +icmp_get_buf_prop(netstack_t *stack, mod_prop_info_t *pinfo, const char *ifname,
      226 +    void *val, uint_t psize, uint_t flags)
      227 +{
      228 +        return (mod_get_buf_prop(stack->netstack_icmp->is_propinfo_tbl, stack,
      229 +            pinfo, ifname, val, psize, flags));
      230 +}
      231 +
 216  232  /*
 217  233   * All of these are alterable, within the min/max values given, at run time.
 218  234   *
 219  235   * Note: All those tunables which do not start with "icmp_" are Committed and
 220  236   * therefore are public. See PSARC 2010/080.
 221  237   */
 222  238  static mod_prop_info_t icmp_propinfo_tbl[] = {
 223  239          /* tunable - 0 */
 224  240          { "_wroff_extra", MOD_PROTO_RAWIP,
 225  241              mod_set_uint32, mod_get_uint32,
↓ open down ↓ 5 lines elided ↑ open up ↑
 231  247  
 232  248          { "_ipv6_hoplimit", MOD_PROTO_RAWIP,
 233  249              mod_set_uint32, mod_get_uint32,
 234  250              {0, IPV6_MAX_HOPS, IPV6_DEFAULT_HOPS},
 235  251              {IPV6_DEFAULT_HOPS} },
 236  252  
 237  253          { "_bsd_compat", MOD_PROTO_RAWIP,
 238  254              mod_set_boolean, mod_get_boolean,
 239  255              {B_TRUE}, {B_TRUE} },
 240  256  
 241      -        { "send_maxbuf", MOD_PROTO_RAWIP,
 242      -            mod_set_uint32, mod_get_uint32,
      257 +        { "send_buf", MOD_PROTO_RAWIP,
      258 +            icmp_set_buf_prop, icmp_get_buf_prop,
 243  259              {4096, 65536, 8192}, {8192} },
 244  260  
 245  261          { "_xmit_lowat", MOD_PROTO_RAWIP,
 246  262              mod_set_uint32, mod_get_uint32,
 247  263              {0, 65536, 1024}, {1024} },
 248  264  
 249      -        { "recv_maxbuf", MOD_PROTO_RAWIP,
 250      -            mod_set_uint32, mod_get_uint32,
      265 +        { "recv_buf", MOD_PROTO_RAWIP,
      266 +            icmp_set_buf_prop, icmp_get_buf_prop,
 251  267              {4096, 65536, 8192}, {8192} },
 252  268  
 253      -        { "_max_buf", MOD_PROTO_RAWIP,
      269 +        { "max_buf", MOD_PROTO_RAWIP,
 254  270              mod_set_uint32, mod_get_uint32,
 255      -            {65536, 1024*1024*1024, 256*1024}, {256 * 1024} },
      271 +            {65536, ULP_MAX_BUF, 256*1024}, {256*1024} },
 256  272  
 257  273          { "_pmtu_discovery", MOD_PROTO_RAWIP,
 258  274              mod_set_boolean, mod_get_boolean,
 259  275              {B_FALSE}, {B_FALSE} },
 260  276  
 261  277          { "_sendto_ignerr", MOD_PROTO_RAWIP,
 262  278              mod_set_boolean, mod_get_boolean,
 263  279              {B_FALSE}, {B_FALSE} },
 264  280  
 265  281          { "?", MOD_PROTO_RAWIP, NULL, mod_get_allprop, {0}, {0} },
↓ open down ↓ 5561 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX