6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * CDDL HEADER START
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * The contents of this file are subject to the terms of the
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * Common Development and Distribution License (the "License").
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * You may not use this file except in compliance with the License.
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * or http://www.opensolaris.org/os/licensing.
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * See the License for the specific language governing permissions
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * and limitations under the License.
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * When distributing Covered Code, include this CDDL HEADER in each
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * If applicable, add the following below this CDDL HEADER, with the
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * fields enclosed by brackets "[]" replaced with your own identifying
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * information: Portions Copyright [yyyy] [name of copyright owner]
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * CDDL HEADER END
5dd46ab5742d7db1cbb08dec7b64fa14930c02f7Kacheong Poon * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
299625c6492013aa7bd163862f0d181854f69b3cSebastien Roy * Copyright (c) 2013 by Delphix. All rights reserved.
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail/* Max size IP datagram is 64k - 1 */
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail#define SCTP_MSS_MAX_IPV4 (IP_MAXPACKET - (sizeof (ipha_t) + \
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail#define SCTP_MSS_MAX_IPV6 (IP_MAXPACKET - (sizeof (ip6_t) + \
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail/* Max of the above */
5dd46ab5742d7db1cbb08dec7b64fa14930c02f7Kacheong Poon * returns the current list of listener limit configuration.
5dd46ab5742d7db1cbb08dec7b64fa14930c02f7Kacheong Poon/* ARGSUSED */
299625c6492013aa7bd163862f0d181854f69b3cSebastien Roysctp_listener_conf_get(netstack_t *stack, mod_prop_info_t *pinfo,
299625c6492013aa7bd163862f0d181854f69b3cSebastien Roy const char *ifname, void *val, uint_t psize, uint_t flags)
5dd46ab5742d7db1cbb08dec7b64fa14930c02f7Kacheong Poon if (flags & (MOD_PROP_DEFAULT|MOD_PROP_PERM|MOD_PROP_POSSIBLE))
5dd46ab5742d7db1cbb08dec7b64fa14930c02f7Kacheong Poon mutex_enter(&sctps->sctps_listener_conf_lock);
5dd46ab5742d7db1cbb08dec7b64fa14930c02f7Kacheong Poon for (sl = list_head(&sctps->sctps_listener_conf); sl != NULL;
5dd46ab5742d7db1cbb08dec7b64fa14930c02f7Kacheong Poon sl = list_next(&sctps->sctps_listener_conf, sl)) {
5dd46ab5742d7db1cbb08dec7b64fa14930c02f7Kacheong Poon nbytes = snprintf(pval, size, "%d:%d", sl->sl_port,
5dd46ab5742d7db1cbb08dec7b64fa14930c02f7Kacheong Poon nbytes = snprintf(pval, size, ",%d:%d", sl->sl_port,
5dd46ab5742d7db1cbb08dec7b64fa14930c02f7Kacheong Poon /* Buffer overflow, stop copying information */
5dd46ab5742d7db1cbb08dec7b64fa14930c02f7Kacheong Poon * add a new listener limit configuration.
5dd46ab5742d7db1cbb08dec7b64fa14930c02f7Kacheong Poon/* ARGSUSED */
299625c6492013aa7bd163862f0d181854f69b3cSebastien Roysctp_listener_conf_add(netstack_t *stack, cred_t *cr, mod_prop_info_t *pinfo,
5dd46ab5742d7db1cbb08dec7b64fa14930c02f7Kacheong Poon const char *ifname, const void* pval, uint_t flags)
5dd46ab5742d7db1cbb08dec7b64fa14930c02f7Kacheong Poon if (ddi_strtol(pval, &colon, 10, &lport) != 0 || lport <= 0 ||
5dd46ab5742d7db1cbb08dec7b64fa14930c02f7Kacheong Poon if (ddi_strtol(colon + 1, NULL, 10, &ratio) != 0 || ratio <= 0)
5dd46ab5742d7db1cbb08dec7b64fa14930c02f7Kacheong Poon mutex_enter(&sctps->sctps_listener_conf_lock);
5dd46ab5742d7db1cbb08dec7b64fa14930c02f7Kacheong Poon for (sl = list_head(&sctps->sctps_listener_conf); sl != NULL;
5dd46ab5742d7db1cbb08dec7b64fa14930c02f7Kacheong Poon sl = list_next(&sctps->sctps_listener_conf, sl)) {
5dd46ab5742d7db1cbb08dec7b64fa14930c02f7Kacheong Poon /* There is an existing entry, so update its ratio value. */
5dd46ab5742d7db1cbb08dec7b64fa14930c02f7Kacheong Poon if ((new_sl = kmem_alloc(sizeof (sctp_listener_t), KM_NOSLEEP)) ==
5dd46ab5742d7db1cbb08dec7b64fa14930c02f7Kacheong Poon list_insert_tail(&sctps->sctps_listener_conf, new_sl);
5dd46ab5742d7db1cbb08dec7b64fa14930c02f7Kacheong Poon * remove a listener limit configuration.
5dd46ab5742d7db1cbb08dec7b64fa14930c02f7Kacheong Poon/* ARGSUSED */
299625c6492013aa7bd163862f0d181854f69b3cSebastien Roysctp_listener_conf_del(netstack_t *stack, cred_t *cr, mod_prop_info_t *pinfo,
5dd46ab5742d7db1cbb08dec7b64fa14930c02f7Kacheong Poon const char *ifname, const void* pval, uint_t flags)
5dd46ab5742d7db1cbb08dec7b64fa14930c02f7Kacheong Poon if (ddi_strtol(pval, NULL, 10, &lport) != 0 || lport <= 0 ||
5dd46ab5742d7db1cbb08dec7b64fa14930c02f7Kacheong Poon mutex_enter(&sctps->sctps_listener_conf_lock);
5dd46ab5742d7db1cbb08dec7b64fa14930c02f7Kacheong Poon for (sl = list_head(&sctps->sctps_listener_conf); sl != NULL;
5dd46ab5742d7db1cbb08dec7b64fa14930c02f7Kacheong Poon sl = list_next(&sctps->sctps_listener_conf, sl)) {
299625c6492013aa7bd163862f0d181854f69b3cSebastien Roysctp_set_buf_prop(netstack_t *stack, cred_t *cr, mod_prop_info_t *pinfo,
299625c6492013aa7bd163862f0d181854f69b3cSebastien Roy const char *ifname, const void *pval, uint_t flags)
299625c6492013aa7bd163862f0d181854f69b3cSebastien Roy return (mod_set_buf_prop(stack->netstack_sctp->sctps_propinfo_tbl,
299625c6492013aa7bd163862f0d181854f69b3cSebastien Roysctp_get_buf_prop(netstack_t *stack, mod_prop_info_t *pinfo, const char *ifname,
299625c6492013aa7bd163862f0d181854f69b3cSebastien Roy return (mod_get_buf_prop(stack->netstack_sctp->sctps_propinfo_tbl,
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * All of these are alterable, within the min/max values given, at run time.
8887b57dc579de11464fc6c74163d2595ce073afGirish Moodalbail * Note: All those tunables which do not start with "_" are Committed and
8887b57dc579de11464fc6c74163d2595ce073afGirish Moodalbail * therefore are public. See PSARC 2010/080.
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail { "smallest_nonpriv_port", MOD_PROTO_SCTP,
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail /* tunable - 10 */
8887b57dc579de11464fc6c74163d2595ce073afGirish Moodalbail { "_deferred_ack_interval", MOD_PROTO_SCTP,
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail {0, 16, 0}, {0} },
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail {1024, UINT32_MAX, SCTP_RECV_HIWATER}, { SCTP_RECV_HIWATER} },
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail {1024, ULP_MAX_PORT, 32*1024}, {32*1024} },
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail {1024, ULP_MAX_PORT, ULP_MAX_PORT}, {ULP_MAX_PORT} },
299625c6492013aa7bd163862f0d181854f69b3cSebastien Roy {SCTP_XMIT_LOWATER, ULP_MAX_BUF, SCTP_XMIT_HIWATER},
299625c6492013aa7bd163862f0d181854f69b3cSebastien Roy {SCTP_XMIT_LOWATER, ULP_MAX_BUF, SCTP_XMIT_LOWATER},
299625c6492013aa7bd163862f0d181854f69b3cSebastien Roy {SCTP_RECV_LOWATER, ULP_MAX_BUF, SCTP_RECV_HIWATER},
299625c6492013aa7bd163862f0d181854f69b3cSebastien Roy {8192, ULP_MAX_BUF, 1024*1024}, {1024*1024} },
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail /* tunable - 20 */
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail {0, IPV6_MAX_HOPS, IPV6_DEFAULT_HOPS}, {IPV6_DEFAULT_HOPS} },
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail {500*MS, 60*SECONDS, 1*SECONDS}, {1*SECONDS} },
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail {1*SECONDS, 60000*SECONDS, 60*SECONDS}, {60*SECONDS} },
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail {1*SECONDS, 60000*SECONDS, 3*SECONDS}, {3*SECONDS} },
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail {10*MS, 60000*SECONDS, 60*SECONDS}, {60*SECONDS} },
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail {0, 300*SECONDS, 60*SECONDS}, {60*SECONDS} },
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail /* tunable - 30 */
8887b57dc579de11464fc6c74163d2595ce073afGirish Moodalbail { "_slow_start_after_idle", MOD_PROTO_SCTP,
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * sctp_wroff_xtra is the extra space in front of SCTP/IP header
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * for link layer header. It has to be a multiple of 8.
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail mod_set_extra_privports, mod_get_extra_privports,
8887b57dc579de11464fc6c74163d2595ce073afGirish Moodalbail { "_listener_limit_conf_add", MOD_PROTO_SCTP,
8887b57dc579de11464fc6c74163d2595ce073afGirish Moodalbail { "_listener_limit_conf_del", MOD_PROTO_SCTP,
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail { "?", MOD_PROTO_SCTP, NULL, mod_get_allprop, {0}, {0} },