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 /*
23 * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Copyright (c) 2011, Joyent Inc. All rights reserved.
25 * Copyright (c) 2011 Nexenta Systems, Inc. All rights reserved.
26 * Copyright (c) 2013 by Delphix. All rights reserved.
27 * Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved.
28 */
29 /* Copyright (c) 1990 Mentat Inc. */
30
31 #include <sys/types.h>
32 #include <sys/stream.h>
33 #include <sys/strsun.h>
34 #include <sys/strsubr.h>
35 #include <sys/stropts.h>
36 #include <sys/strlog.h>
37 #define _SUN_TPI_VERSION 2
38 #include <sys/tihdr.h>
39 #include <sys/timod.h>
40 #include <sys/ddi.h>
41 #include <sys/sunddi.h>
42 #include <sys/suntpi.h>
43 #include <sys/xti_inet.h>
44 #include <sys/cmn_err.h>
45 #include <sys/debug.h>
46 #include <sys/sdt.h>
2399
2400 /*
2401 * Initialize tcp_rtt_sa and tcp_rtt_sd so that the calculated RTO
2402 * will be close to tcp_rexmit_interval_initial. By doing this, we
2403 * allow the algorithm to adjust slowly to large fluctuations of RTT
2404 * during first few transmissions of a connection as seen in slow
2405 * links.
2406 */
2407 tcp->tcp_rtt_sa = tcp->tcp_rto_initial << 2;
2408 tcp->tcp_rtt_sd = tcp->tcp_rto_initial >> 1;
2409 rto = (tcp->tcp_rtt_sa >> 3) + tcp->tcp_rtt_sd +
2410 tcps->tcps_rexmit_interval_extra + (tcp->tcp_rtt_sa >> 5) +
2411 tcps->tcps_conn_grace_period;
2412 TCP_SET_RTO(tcp, rto);
2413
2414 tcp->tcp_timer_backoff = 0;
2415 tcp->tcp_ms_we_have_waited = 0;
2416 tcp->tcp_last_recv_time = ddi_get_lbolt();
2417 tcp->tcp_cwnd_max = tcps->tcps_cwnd_max_;
2418 tcp->tcp_cwnd_ssthresh = TCP_MAX_LARGEWIN;
2419 tcp->tcp_snd_burst = TCP_CWND_INFINITE;
2420
2421 tcp->tcp_maxpsz_multiplier = tcps->tcps_maxpsz_multiplier;
2422
2423 /* NOTE: ISS is now set in tcp_set_destination(). */
2424
2425 /* Reset fusion-related fields */
2426 tcp->tcp_fused = B_FALSE;
2427 tcp->tcp_unfusable = B_FALSE;
2428 tcp->tcp_fused_sigurg = B_FALSE;
2429 tcp->tcp_loopback_peer = NULL;
2430
2431 /* We rebuild the header template on the next connect/conn_request */
2432
2433 connp->conn_mlp_type = mlptSingle;
2434
2435 /*
2436 * Init the window scale to the max so tcp_rwnd_set() won't pare
2437 * down tcp_rwnd. tcp_set_destination() will set the right value later.
2438 */
2439 tcp->tcp_rcv_ws = TCP_MAX_WINSHIFT;
|
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 /*
23 * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Copyright (c) 2011, Joyent Inc. All rights reserved.
25 * Copyright (c) 2011 Nexenta Systems, Inc. All rights reserved.
26 * Copyright (c) 2013,2014 by Delphix. All rights reserved.
27 * Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved.
28 */
29 /* Copyright (c) 1990 Mentat Inc. */
30
31 #include <sys/types.h>
32 #include <sys/stream.h>
33 #include <sys/strsun.h>
34 #include <sys/strsubr.h>
35 #include <sys/stropts.h>
36 #include <sys/strlog.h>
37 #define _SUN_TPI_VERSION 2
38 #include <sys/tihdr.h>
39 #include <sys/timod.h>
40 #include <sys/ddi.h>
41 #include <sys/sunddi.h>
42 #include <sys/suntpi.h>
43 #include <sys/xti_inet.h>
44 #include <sys/cmn_err.h>
45 #include <sys/debug.h>
46 #include <sys/sdt.h>
2399
2400 /*
2401 * Initialize tcp_rtt_sa and tcp_rtt_sd so that the calculated RTO
2402 * will be close to tcp_rexmit_interval_initial. By doing this, we
2403 * allow the algorithm to adjust slowly to large fluctuations of RTT
2404 * during first few transmissions of a connection as seen in slow
2405 * links.
2406 */
2407 tcp->tcp_rtt_sa = tcp->tcp_rto_initial << 2;
2408 tcp->tcp_rtt_sd = tcp->tcp_rto_initial >> 1;
2409 rto = (tcp->tcp_rtt_sa >> 3) + tcp->tcp_rtt_sd +
2410 tcps->tcps_rexmit_interval_extra + (tcp->tcp_rtt_sa >> 5) +
2411 tcps->tcps_conn_grace_period;
2412 TCP_SET_RTO(tcp, rto);
2413
2414 tcp->tcp_timer_backoff = 0;
2415 tcp->tcp_ms_we_have_waited = 0;
2416 tcp->tcp_last_recv_time = ddi_get_lbolt();
2417 tcp->tcp_cwnd_max = tcps->tcps_cwnd_max_;
2418 tcp->tcp_cwnd_ssthresh = TCP_MAX_LARGEWIN;
2419
2420 tcp->tcp_maxpsz_multiplier = tcps->tcps_maxpsz_multiplier;
2421
2422 /* NOTE: ISS is now set in tcp_set_destination(). */
2423
2424 /* Reset fusion-related fields */
2425 tcp->tcp_fused = B_FALSE;
2426 tcp->tcp_unfusable = B_FALSE;
2427 tcp->tcp_fused_sigurg = B_FALSE;
2428 tcp->tcp_loopback_peer = NULL;
2429
2430 /* We rebuild the header template on the next connect/conn_request */
2431
2432 connp->conn_mlp_type = mlptSingle;
2433
2434 /*
2435 * Init the window scale to the max so tcp_rwnd_set() won't pare
2436 * down tcp_rwnd. tcp_set_destination() will set the right value later.
2437 */
2438 tcp->tcp_rcv_ws = TCP_MAX_WINSHIFT;
|