author | Garrett D'Amore <garrett@nexenta.com> |
Wed, 17 Aug 2011 16:31:10 -0700 | |
changeset 13435 | 3185061eadee |
parent 12644 | 4f9a0cd40c5f |
child 13436 | a6bc41319a2d |
permissions | -rw-r--r-- |
0 | 1 |
/* |
2 |
* CDDL HEADER START |
|
3 |
* |
|
4 |
* The contents of this file are subject to the terms of the |
|
1676 | 5 |
* Common Development and Distribution License (the "License"). |
6 |
* You may not use this file except in compliance with the License. |
|
0 | 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 |
/* |
|
12056
4811a59c20b7
6935348 tcp_sack_info should always be there
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11754
diff
changeset
|
22 |
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. |
13435
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
23 |
* Copyright (c) 2011 Nexenta Systems, Inc. All rights reserved. |
0 | 24 |
*/ |
25 |
||
26 |
#include <sys/types.h> |
|
27 |
#include <sys/stream.h> |
|
28 |
#define _SUN_TPI_VERSION 2 |
|
29 |
#include <sys/tihdr.h> |
|
30 |
#include <sys/socket.h> |
|
31 |
#include <sys/xti_xtiopt.h> |
|
32 |
#include <sys/xti_inet.h> |
|
11754
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
33 |
#include <sys/policy.h> |
0 | 34 |
|
35 |
#include <inet/common.h> |
|
36 |
#include <netinet/ip6.h> |
|
37 |
#include <inet/ip.h> |
|
38 |
||
39 |
#include <netinet/in.h> |
|
40 |
#include <netinet/tcp.h> |
|
41 |
#include <inet/optcom.h> |
|
11754
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
42 |
#include <inet/proto_set.h> |
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
43 |
#include <inet/tcp_impl.h> |
0 | 44 |
|
45 |
/* |
|
46 |
* Table of all known options handled on a TCP protocol stack. |
|
47 |
* |
|
48 |
* Note: This table contains options processed by both TCP and IP levels |
|
49 |
* and is the superset of options that can be performed on a TCP over IP |
|
50 |
* stack. |
|
51 |
*/ |
|
52 |
opdes_t tcp_opt_arr[] = { |
|
53 |
||
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
54 |
{ SO_LINGER, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, |
0 | 55 |
sizeof (struct linger), 0 }, |
56 |
||
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
57 |
{ SO_DEBUG, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 }, |
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
58 |
{ SO_KEEPALIVE, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 }, |
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
59 |
{ SO_DONTROUTE, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 }, |
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
60 |
{ SO_USELOOPBACK, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 |
0 | 61 |
}, |
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
62 |
{ SO_BROADCAST, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 }, |
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
63 |
{ SO_REUSEADDR, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 }, |
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
64 |
{ SO_OOBINLINE, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 }, |
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
65 |
{ SO_TYPE, SOL_SOCKET, OA_R, OA_R, OP_NP, 0, sizeof (int), 0 }, |
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
66 |
{ SO_SNDBUF, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 }, |
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
67 |
{ SO_RCVBUF, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 }, |
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
68 |
{ SO_SNDTIMEO, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, |
8612
2f5577acc4a9
6796699 iscsi client broken: failed to receive login response
anders <Anders.Persson@Sun.COM>
parents:
8485
diff
changeset
|
69 |
sizeof (struct timeval), 0 }, |
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
70 |
{ SO_RCVTIMEO, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, |
8612
2f5577acc4a9
6796699 iscsi client broken: failed to receive login response
anders <Anders.Persson@Sun.COM>
parents:
8485
diff
changeset
|
71 |
sizeof (struct timeval), 0 }, |
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
72 |
{ SO_DGRAM_ERRIND, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 |
0 | 73 |
}, |
74 |
{ SO_SND_COPYAVOID, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 }, |
|
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
75 |
{ SO_ANON_MLP, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), |
2263
fd48046384d0
PSARC 2006/073 PF_ROUTE: Include interface name with RTM_NEWADDR/RTM_DELADDR
sommerfe
parents:
1676
diff
changeset
|
76 |
0 }, |
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
77 |
{ SO_MAC_EXEMPT, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), |
2263
fd48046384d0
PSARC 2006/073 PF_ROUTE: Include interface name with RTM_NEWADDR/RTM_DELADDR
sommerfe
parents:
1676
diff
changeset
|
78 |
0 }, |
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
79 |
{ SO_MAC_IMPLICIT, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), |
10934
e209937a4f19
PSARC/2008/252 Labeled IPsec phase 1
Bill Sommerfeld <sommerfeld@sun.com>
parents:
8612
diff
changeset
|
80 |
0 }, |
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
81 |
{ SO_ALLZONES, SOL_SOCKET, OA_R, OA_RW, OP_CONFIG, 0, sizeof (int), |
2263
fd48046384d0
PSARC 2006/073 PF_ROUTE: Include interface name with RTM_NEWADDR/RTM_DELADDR
sommerfe
parents:
1676
diff
changeset
|
82 |
0 }, |
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
83 |
{ SO_EXCLBIND, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 }, |
2429
d2b380bdc797
PSARC 2006/407 SO_EXCLBIND, socket exclusive binding
kcpoon
parents:
2263
diff
changeset
|
84 |
|
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
85 |
{ SO_DOMAIN, SOL_SOCKET, OA_R, OA_R, OP_NP, 0, sizeof (int), 0 }, |
3388 | 86 |
|
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
87 |
{ SO_PROTOTYPE, SOL_SOCKET, OA_R, OA_R, OP_NP, 0, sizeof (int), 0 }, |
3388 | 88 |
|
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
89 |
{ TCP_NODELAY, IPPROTO_TCP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 |
0 | 90 |
}, |
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
91 |
{ TCP_MAXSEG, IPPROTO_TCP, OA_R, OA_R, OP_NP, 0, sizeof (uint_t), |
0 | 92 |
536 }, |
93 |
||
94 |
{ TCP_NOTIFY_THRESHOLD, IPPROTO_TCP, OA_RW, OA_RW, OP_NP, |
|
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
95 |
OP_DEF_FN, sizeof (int), -1 /* not initialized */ }, |
0 | 96 |
|
97 |
{ TCP_ABORT_THRESHOLD, IPPROTO_TCP, OA_RW, OA_RW, OP_NP, |
|
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
98 |
OP_DEF_FN, sizeof (int), -1 /* not initialized */ }, |
0 | 99 |
|
100 |
{ TCP_CONN_NOTIFY_THRESHOLD, IPPROTO_TCP, OA_RW, OA_RW, OP_NP, |
|
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
101 |
OP_DEF_FN, sizeof (int), -1 /* not initialized */ }, |
0 | 102 |
|
103 |
{ TCP_CONN_ABORT_THRESHOLD, IPPROTO_TCP, OA_RW, OA_RW, OP_NP, |
|
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
104 |
OP_DEF_FN, sizeof (int), -1 /* not initialized */ }, |
0 | 105 |
|
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
106 |
{ TCP_RECVDSTADDR, IPPROTO_TCP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), |
0 | 107 |
0 }, |
108 |
||
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
109 |
{ TCP_ANONPRIVBIND, IPPROTO_TCP, OA_R, OA_RW, OP_PRIVPORT, 0, |
0 | 110 |
sizeof (int), 0 }, |
111 |
||
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
112 |
{ TCP_EXCLBIND, IPPROTO_TCP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 |
0 | 113 |
}, |
114 |
||
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
115 |
{ TCP_INIT_CWND, IPPROTO_TCP, OA_RW, OA_RW, OP_CONFIG, 0, |
0 | 116 |
sizeof (int), 0 }, |
117 |
||
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
118 |
{ TCP_KEEPALIVE_THRESHOLD, IPPROTO_TCP, OA_RW, OA_RW, OP_NP, 0, |
0 | 119 |
sizeof (int), 0 }, |
120 |
||
13435
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
121 |
{ TCP_KEEPIDLE, IPPROTO_TCP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 }, |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
122 |
|
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
123 |
{ TCP_KEEPCNT, IPPROTO_TCP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 }, |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
124 |
|
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
125 |
{ TCP_KEEPINTVL, IPPROTO_TCP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 }, |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
126 |
|
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
127 |
{ TCP_KEEPALIVE_ABORT_THRESHOLD, IPPROTO_TCP, OA_RW, OA_RW, OP_NP, 0, |
0 | 128 |
sizeof (int), 0 }, |
129 |
||
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
130 |
{ TCP_CORK, IPPROTO_TCP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 }, |
0 | 131 |
|
12544
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
132 |
{ TCP_RTO_INITIAL, IPPROTO_TCP, OA_RW, OA_RW, OP_NP, 0, sizeof (uint32_t), 0 }, |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
133 |
|
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
134 |
{ TCP_RTO_MIN, IPPROTO_TCP, OA_RW, OA_RW, OP_NP, 0, sizeof (uint32_t), 0 }, |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
135 |
|
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
136 |
{ TCP_RTO_MAX, IPPROTO_TCP, OA_RW, OA_RW, OP_NP, 0, sizeof (uint32_t), 0 }, |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
137 |
|
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
138 |
{ TCP_LINGER2, IPPROTO_TCP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 }, |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
139 |
|
0 | 140 |
{ IP_OPTIONS, IPPROTO_IP, OA_RW, OA_RW, OP_NP, |
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
141 |
(OP_VARLEN|OP_NODEFAULT), |
8348
4137e18bfaf0
PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents:
3448
diff
changeset
|
142 |
IP_MAX_OPT_LENGTH + IP_ADDR_LEN, -1 /* not initialized */ }, |
0 | 143 |
{ T_IP_OPTIONS, IPPROTO_IP, OA_RW, OA_RW, OP_NP, |
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
144 |
(OP_VARLEN|OP_NODEFAULT), |
8348
4137e18bfaf0
PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents:
3448
diff
changeset
|
145 |
IP_MAX_OPT_LENGTH + IP_ADDR_LEN, -1 /* not initialized */ }, |
0 | 146 |
|
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
147 |
{ IP_TOS, IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 }, |
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
148 |
{ T_IP_TOS, IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 }, |
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
149 |
{ IP_TTL, IPPROTO_IP, OA_RW, OA_RW, OP_NP, OP_DEF_FN, |
0 | 150 |
sizeof (int), -1 /* not initialized */ }, |
151 |
||
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
152 |
{ IP_SEC_OPT, IPPROTO_IP, OA_RW, OA_RW, OP_NP, OP_NODEFAULT, |
0 | 153 |
sizeof (ipsec_req_t), -1 /* not initialized */ }, |
154 |
||
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
155 |
{ IP_BOUND_IF, IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, |
0 | 156 |
sizeof (int), 0 /* no ifindex */ }, |
157 |
||
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
158 |
{ IP_UNSPEC_SRC, IPPROTO_IP, OA_R, OA_RW, OP_RAW, 0, |
0 | 159 |
sizeof (int), 0 }, |
160 |
||
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
161 |
{ IPV6_UNICAST_HOPS, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, OP_DEF_FN, |
0 | 162 |
sizeof (int), -1 /* not initialized */ }, |
163 |
||
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
164 |
{ IPV6_BOUND_IF, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0, |
0 | 165 |
sizeof (int), 0 /* no ifindex */ }, |
166 |
||
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
167 |
{ IP_DONTFRAG, IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 }, |
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
168 |
|
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
169 |
{ IP_NEXTHOP, IPPROTO_IP, OA_R, OA_RW, OP_CONFIG, 0, |
1095 | 170 |
sizeof (in_addr_t), -1 /* not initialized */ }, |
171 |
||
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
172 |
{ IPV6_UNSPEC_SRC, IPPROTO_IPV6, OA_R, OA_RW, OP_RAW, 0, |
0 | 173 |
sizeof (int), 0 }, |
174 |
||
175 |
{ IPV6_PKTINFO, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, |
|
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
176 |
(OP_NODEFAULT|OP_VARLEN), |
0 | 177 |
sizeof (struct in6_pktinfo), -1 /* not initialized */ }, |
178 |
{ IPV6_NEXTHOP, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, |
|
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
179 |
OP_NODEFAULT, |
0 | 180 |
sizeof (sin6_t), -1 /* not initialized */ }, |
181 |
{ IPV6_HOPOPTS, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, |
|
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
182 |
(OP_VARLEN|OP_NODEFAULT), 255*8, |
0 | 183 |
-1 /* not initialized */ }, |
184 |
{ IPV6_DSTOPTS, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, |
|
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
185 |
(OP_VARLEN|OP_NODEFAULT), 255*8, |
0 | 186 |
-1 /* not initialized */ }, |
187 |
{ IPV6_RTHDRDSTOPTS, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, |
|
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
188 |
(OP_VARLEN|OP_NODEFAULT), 255*8, |
0 | 189 |
-1 /* not initialized */ }, |
190 |
{ IPV6_RTHDR, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, |
|
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
191 |
(OP_VARLEN|OP_NODEFAULT), 255*8, |
0 | 192 |
-1 /* not initialized */ }, |
193 |
{ IPV6_TCLASS, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, |
|
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
194 |
OP_NODEFAULT, |
0 | 195 |
sizeof (int), -1 /* not initialized */ }, |
196 |
{ IPV6_PATHMTU, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, |
|
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
197 |
OP_NODEFAULT, |
0 | 198 |
sizeof (struct ip6_mtuinfo), -1 /* not initialized */ }, |
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
199 |
{ IPV6_DONTFRAG, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0, |
0 | 200 |
sizeof (int), 0 }, |
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
201 |
{ IPV6_USE_MIN_MTU, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0, |
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
202 |
sizeof (int), 0 }, |
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
203 |
{ IPV6_V6ONLY, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0, |
0 | 204 |
sizeof (int), 0 }, |
205 |
||
206 |
/* Enable receipt of ancillary data */ |
|
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
207 |
{ IPV6_RECVPKTINFO, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0, |
0 | 208 |
sizeof (int), 0 }, |
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
209 |
{ IPV6_RECVHOPLIMIT, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0, |
0 | 210 |
sizeof (int), 0 }, |
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
211 |
{ IPV6_RECVHOPOPTS, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0, |
0 | 212 |
sizeof (int), 0 }, |
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
213 |
{ _OLD_IPV6_RECVDSTOPTS, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0, |
0 | 214 |
sizeof (int), 0 }, |
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
215 |
{ IPV6_RECVDSTOPTS, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0, |
0 | 216 |
sizeof (int), 0 }, |
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
217 |
{ IPV6_RECVRTHDR, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0, |
0 | 218 |
sizeof (int), 0 }, |
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
219 |
{ IPV6_RECVRTHDRDSTOPTS, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0, |
0 | 220 |
sizeof (int), 0 }, |
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
221 |
{ IPV6_RECVTCLASS, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0, |
0 | 222 |
sizeof (int), 0 }, |
223 |
||
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
224 |
{ IPV6_SEC_OPT, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, OP_NODEFAULT, |
0 | 225 |
sizeof (ipsec_req_t), -1 /* not initialized */ }, |
11042
2d6e217af1b4
PSARC/2009/331 IP Datapath Refactoring
Erik Nordmark <Erik.Nordmark@Sun.COM>
parents:
10934
diff
changeset
|
226 |
{ IPV6_SRC_PREFERENCES, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0, |
0 | 227 |
sizeof (uint32_t), IPV6_PREFER_SRC_DEFAULT }, |
228 |
}; |
|
229 |
||
230 |
/* |
|
231 |
* Table of all supported levels |
|
232 |
* Note: Some levels (e.g. XTI_GENERIC) may be valid but may not have |
|
233 |
* any supported options so we need this info separately. |
|
234 |
* |
|
235 |
* This is needed only for topmost tpi providers and is used only by |
|
236 |
* XTI interfaces. |
|
237 |
*/ |
|
238 |
optlevel_t tcp_valid_levels_arr[] = { |
|
239 |
XTI_GENERIC, |
|
240 |
SOL_SOCKET, |
|
241 |
IPPROTO_TCP, |
|
242 |
IPPROTO_IP, |
|
243 |
IPPROTO_IPV6 |
|
244 |
}; |
|
245 |
||
246 |
||
247 |
#define TCP_OPT_ARR_CNT A_CNT(tcp_opt_arr) |
|
248 |
#define TCP_VALID_LEVELS_CNT A_CNT(tcp_valid_levels_arr) |
|
249 |
||
250 |
uint_t tcp_max_optsize; /* initialized when TCP driver is loaded */ |
|
251 |
||
252 |
/* |
|
253 |
* Initialize option database object for TCP |
|
254 |
* |
|
255 |
* This object represents database of options to search passed to |
|
256 |
* {sock,tpi}optcom_req() interface routine to take care of option |
|
257 |
* management and associated methods. |
|
258 |
*/ |
|
259 |
||
260 |
optdb_obj_t tcp_opt_obj = { |
|
261 |
tcp_opt_default, /* TCP default value function pointer */ |
|
8348
4137e18bfaf0
PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents:
3448
diff
changeset
|
262 |
tcp_tpi_opt_get, /* TCP get function pointer */ |
4137e18bfaf0
PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents:
3448
diff
changeset
|
263 |
tcp_tpi_opt_set, /* TCP set function pointer */ |
0 | 264 |
TCP_OPT_ARR_CNT, /* TCP option database count of entries */ |
265 |
tcp_opt_arr, /* TCP option database */ |
|
266 |
TCP_VALID_LEVELS_CNT, /* TCP valid level count of entries */ |
|
267 |
tcp_valid_levels_arr /* TCP valid level array */ |
|
268 |
}; |
|
11754
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
269 |
|
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
270 |
/* Maximum TCP initial cwin (start/restart). */ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
271 |
#define TCP_MAX_INIT_CWND 16 |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
272 |
|
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
273 |
static int tcp_max_init_cwnd = TCP_MAX_INIT_CWND; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
274 |
|
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
275 |
/* |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
276 |
* Some TCP options can be "set" by requesting them in the option |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
277 |
* buffer. This is needed for XTI feature test though we do not |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
278 |
* allow it in general. We interpret that this mechanism is more |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
279 |
* applicable to OSI protocols and need not be allowed in general. |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
280 |
* This routine filters out options for which it is not allowed (most) |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
281 |
* and lets through those (few) for which it is. [ The XTI interface |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
282 |
* test suite specifics will imply that any XTI_GENERIC level XTI_* if |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
283 |
* ever implemented will have to be allowed here ]. |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
284 |
*/ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
285 |
static boolean_t |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
286 |
tcp_allow_connopt_set(int level, int name) |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
287 |
{ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
288 |
|
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
289 |
switch (level) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
290 |
case IPPROTO_TCP: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
291 |
switch (name) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
292 |
case TCP_NODELAY: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
293 |
return (B_TRUE); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
294 |
default: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
295 |
return (B_FALSE); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
296 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
297 |
/*NOTREACHED*/ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
298 |
default: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
299 |
return (B_FALSE); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
300 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
301 |
/*NOTREACHED*/ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
302 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
303 |
|
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
304 |
/* |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
305 |
* This routine gets default values of certain options whose default |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
306 |
* values are maintained by protocol specific code |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
307 |
*/ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
308 |
/* ARGSUSED */ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
309 |
int |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
310 |
tcp_opt_default(queue_t *q, int level, int name, uchar_t *ptr) |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
311 |
{ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
312 |
int32_t *i1 = (int32_t *)ptr; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
313 |
tcp_stack_t *tcps = Q_TO_TCP(q)->tcp_tcps; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
314 |
|
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
315 |
switch (level) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
316 |
case IPPROTO_TCP: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
317 |
switch (name) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
318 |
case TCP_NOTIFY_THRESHOLD: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
319 |
*i1 = tcps->tcps_ip_notify_interval; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
320 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
321 |
case TCP_ABORT_THRESHOLD: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
322 |
*i1 = tcps->tcps_ip_abort_interval; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
323 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
324 |
case TCP_CONN_NOTIFY_THRESHOLD: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
325 |
*i1 = tcps->tcps_ip_notify_cinterval; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
326 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
327 |
case TCP_CONN_ABORT_THRESHOLD: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
328 |
*i1 = tcps->tcps_ip_abort_cinterval; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
329 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
330 |
default: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
331 |
return (-1); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
332 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
333 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
334 |
case IPPROTO_IP: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
335 |
switch (name) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
336 |
case IP_TTL: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
337 |
*i1 = tcps->tcps_ipv4_ttl; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
338 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
339 |
default: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
340 |
return (-1); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
341 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
342 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
343 |
case IPPROTO_IPV6: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
344 |
switch (name) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
345 |
case IPV6_UNICAST_HOPS: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
346 |
*i1 = tcps->tcps_ipv6_hoplimit; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
347 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
348 |
default: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
349 |
return (-1); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
350 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
351 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
352 |
default: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
353 |
return (-1); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
354 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
355 |
return (sizeof (int)); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
356 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
357 |
|
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
358 |
/* |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
359 |
* TCP routine to get the values of options. |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
360 |
*/ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
361 |
int |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
362 |
tcp_opt_get(conn_t *connp, int level, int name, uchar_t *ptr) |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
363 |
{ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
364 |
int *i1 = (int *)ptr; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
365 |
tcp_t *tcp = connp->conn_tcp; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
366 |
conn_opt_arg_t coas; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
367 |
int retval; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
368 |
|
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
369 |
coas.coa_connp = connp; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
370 |
coas.coa_ixa = connp->conn_ixa; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
371 |
coas.coa_ipp = &connp->conn_xmit_ipp; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
372 |
coas.coa_ancillary = B_FALSE; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
373 |
coas.coa_changed = 0; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
374 |
|
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
375 |
switch (level) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
376 |
case SOL_SOCKET: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
377 |
switch (name) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
378 |
case SO_SND_COPYAVOID: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
379 |
*i1 = tcp->tcp_snd_zcopy_on ? |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
380 |
SO_SND_COPYAVOID : 0; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
381 |
return (sizeof (int)); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
382 |
case SO_ACCEPTCONN: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
383 |
*i1 = (tcp->tcp_state == TCPS_LISTEN); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
384 |
return (sizeof (int)); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
385 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
386 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
387 |
case IPPROTO_TCP: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
388 |
switch (name) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
389 |
case TCP_NODELAY: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
390 |
*i1 = (tcp->tcp_naglim == 1) ? TCP_NODELAY : 0; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
391 |
return (sizeof (int)); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
392 |
case TCP_MAXSEG: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
393 |
*i1 = tcp->tcp_mss; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
394 |
return (sizeof (int)); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
395 |
case TCP_NOTIFY_THRESHOLD: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
396 |
*i1 = (int)tcp->tcp_first_timer_threshold; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
397 |
return (sizeof (int)); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
398 |
case TCP_ABORT_THRESHOLD: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
399 |
*i1 = tcp->tcp_second_timer_threshold; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
400 |
return (sizeof (int)); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
401 |
case TCP_CONN_NOTIFY_THRESHOLD: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
402 |
*i1 = tcp->tcp_first_ctimer_threshold; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
403 |
return (sizeof (int)); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
404 |
case TCP_CONN_ABORT_THRESHOLD: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
405 |
*i1 = tcp->tcp_second_ctimer_threshold; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
406 |
return (sizeof (int)); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
407 |
case TCP_INIT_CWND: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
408 |
*i1 = tcp->tcp_init_cwnd; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
409 |
return (sizeof (int)); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
410 |
case TCP_KEEPALIVE_THRESHOLD: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
411 |
*i1 = tcp->tcp_ka_interval; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
412 |
return (sizeof (int)); |
13435
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
413 |
|
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
414 |
/* |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
415 |
* TCP_KEEPIDLE expects value in seconds, but |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
416 |
* tcp_ka_interval is in milliseconds. |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
417 |
*/ |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
418 |
case TCP_KEEPIDLE: |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
419 |
*i1 = tcp->tcp_ka_interval / 1000; |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
420 |
return (sizeof (int)); |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
421 |
case TCP_KEEPCNT: |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
422 |
*i1 = tcp->tcp_ka_cnt; |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
423 |
return (sizeof (int)); |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
424 |
|
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
425 |
/* |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
426 |
* TCP_KEEPINTVL expects value in seconds, but |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
427 |
* tcp_ka_rinterval is in milliseconds. |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
428 |
*/ |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
429 |
case TCP_KEEPINTVL: |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
430 |
*i1 = tcp->tcp_ka_rinterval / 1000; |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
431 |
return (sizeof (int)); |
11754
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
432 |
case TCP_KEEPALIVE_ABORT_THRESHOLD: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
433 |
*i1 = tcp->tcp_ka_abort_thres; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
434 |
return (sizeof (int)); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
435 |
case TCP_CORK: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
436 |
*i1 = tcp->tcp_cork; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
437 |
return (sizeof (int)); |
12544
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
438 |
case TCP_RTO_INITIAL: |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
439 |
*i1 = tcp->tcp_rto_initial; |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
440 |
return (sizeof (uint32_t)); |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
441 |
case TCP_RTO_MIN: |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
442 |
*i1 = tcp->tcp_rto_min; |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
443 |
return (sizeof (uint32_t)); |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
444 |
case TCP_RTO_MAX: |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
445 |
*i1 = tcp->tcp_rto_max; |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
446 |
return (sizeof (uint32_t)); |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
447 |
case TCP_LINGER2: |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
448 |
*i1 = tcp->tcp_fin_wait_2_flush_interval / SECONDS; |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
449 |
return (sizeof (int)); |
11754
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
450 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
451 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
452 |
case IPPROTO_IP: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
453 |
if (connp->conn_family != AF_INET) |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
454 |
return (-1); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
455 |
switch (name) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
456 |
case IP_OPTIONS: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
457 |
case T_IP_OPTIONS: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
458 |
/* Caller ensures enough space */ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
459 |
return (ip_opt_get_user(connp, ptr)); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
460 |
default: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
461 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
462 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
463 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
464 |
|
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
465 |
case IPPROTO_IPV6: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
466 |
/* |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
467 |
* IPPROTO_IPV6 options are only supported for sockets |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
468 |
* that are using IPv6 on the wire. |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
469 |
*/ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
470 |
if (connp->conn_ipversion != IPV6_VERSION) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
471 |
return (-1); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
472 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
473 |
switch (name) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
474 |
case IPV6_PATHMTU: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
475 |
if (tcp->tcp_state < TCPS_ESTABLISHED) |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
476 |
return (-1); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
477 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
478 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
479 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
480 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
481 |
mutex_enter(&connp->conn_lock); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
482 |
retval = conn_opt_get(&coas, level, name, ptr); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
483 |
mutex_exit(&connp->conn_lock); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
484 |
return (retval); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
485 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
486 |
|
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
487 |
/* |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
488 |
* We declare as 'int' rather than 'void' to satisfy pfi_t arg requirements. |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
489 |
* Parameters are assumed to be verified by the caller. |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
490 |
*/ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
491 |
/* ARGSUSED */ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
492 |
int |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
493 |
tcp_opt_set(conn_t *connp, uint_t optset_context, int level, int name, |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
494 |
uint_t inlen, uchar_t *invalp, uint_t *outlenp, uchar_t *outvalp, |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
495 |
void *thisdg_attrs, cred_t *cr) |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
496 |
{ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
497 |
tcp_t *tcp = connp->conn_tcp; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
498 |
int *i1 = (int *)invalp; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
499 |
boolean_t onoff = (*i1 == 0) ? 0 : 1; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
500 |
boolean_t checkonly; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
501 |
int reterr; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
502 |
tcp_stack_t *tcps = tcp->tcp_tcps; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
503 |
conn_opt_arg_t coas; |
12544
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
504 |
uint32_t val = *((uint32_t *)invalp); |
11754
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
505 |
|
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
506 |
coas.coa_connp = connp; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
507 |
coas.coa_ixa = connp->conn_ixa; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
508 |
coas.coa_ipp = &connp->conn_xmit_ipp; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
509 |
coas.coa_ancillary = B_FALSE; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
510 |
coas.coa_changed = 0; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
511 |
|
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
512 |
switch (optset_context) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
513 |
case SETFN_OPTCOM_CHECKONLY: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
514 |
checkonly = B_TRUE; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
515 |
/* |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
516 |
* Note: Implies T_CHECK semantics for T_OPTCOM_REQ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
517 |
* inlen != 0 implies value supplied and |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
518 |
* we have to "pretend" to set it. |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
519 |
* inlen == 0 implies that there is no |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
520 |
* value part in T_CHECK request and just validation |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
521 |
* done elsewhere should be enough, we just return here. |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
522 |
*/ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
523 |
if (inlen == 0) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
524 |
*outlenp = 0; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
525 |
return (0); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
526 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
527 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
528 |
case SETFN_OPTCOM_NEGOTIATE: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
529 |
checkonly = B_FALSE; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
530 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
531 |
case SETFN_UD_NEGOTIATE: /* error on conn-oriented transports ? */ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
532 |
case SETFN_CONN_NEGOTIATE: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
533 |
checkonly = B_FALSE; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
534 |
/* |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
535 |
* Negotiating local and "association-related" options |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
536 |
* from other (T_CONN_REQ, T_CONN_RES,T_UNITDATA_REQ) |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
537 |
* primitives is allowed by XTI, but we choose |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
538 |
* to not implement this style negotiation for Internet |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
539 |
* protocols (We interpret it is a must for OSI world but |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
540 |
* optional for Internet protocols) for all options. |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
541 |
* [ Will do only for the few options that enable test |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
542 |
* suites that our XTI implementation of this feature |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
543 |
* works for transports that do allow it ] |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
544 |
*/ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
545 |
if (!tcp_allow_connopt_set(level, name)) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
546 |
*outlenp = 0; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
547 |
return (EINVAL); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
548 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
549 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
550 |
default: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
551 |
/* |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
552 |
* We should never get here |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
553 |
*/ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
554 |
*outlenp = 0; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
555 |
return (EINVAL); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
556 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
557 |
|
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
558 |
ASSERT((optset_context != SETFN_OPTCOM_CHECKONLY) || |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
559 |
(optset_context == SETFN_OPTCOM_CHECKONLY && inlen != 0)); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
560 |
|
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
561 |
/* |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
562 |
* For TCP, we should have no ancillary data sent down |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
563 |
* (sendmsg isn't supported for SOCK_STREAM), so thisdg_attrs |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
564 |
* has to be zero. |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
565 |
*/ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
566 |
ASSERT(thisdg_attrs == NULL); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
567 |
|
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
568 |
/* |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
569 |
* For fixed length options, no sanity check |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
570 |
* of passed in length is done. It is assumed *_optcom_req() |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
571 |
* routines do the right thing. |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
572 |
*/ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
573 |
switch (level) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
574 |
case SOL_SOCKET: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
575 |
switch (name) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
576 |
case SO_KEEPALIVE: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
577 |
if (checkonly) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
578 |
/* check only case */ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
579 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
580 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
581 |
|
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
582 |
if (!onoff) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
583 |
if (connp->conn_keepalive) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
584 |
if (tcp->tcp_ka_tid != 0) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
585 |
(void) TCP_TIMER_CANCEL(tcp, |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
586 |
tcp->tcp_ka_tid); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
587 |
tcp->tcp_ka_tid = 0; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
588 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
589 |
connp->conn_keepalive = 0; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
590 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
591 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
592 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
593 |
if (!connp->conn_keepalive) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
594 |
/* Crank up the keepalive timer */ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
595 |
tcp->tcp_ka_last_intrvl = 0; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
596 |
tcp->tcp_ka_tid = TCP_TIMER(tcp, |
12056
4811a59c20b7
6935348 tcp_sack_info should always be there
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11754
diff
changeset
|
597 |
tcp_keepalive_timer, tcp->tcp_ka_interval); |
11754
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
598 |
connp->conn_keepalive = 1; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
599 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
600 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
601 |
case SO_SNDBUF: { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
602 |
if (*i1 > tcps->tcps_max_buf) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
603 |
*outlenp = 0; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
604 |
return (ENOBUFS); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
605 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
606 |
if (checkonly) |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
607 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
608 |
|
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
609 |
connp->conn_sndbuf = *i1; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
610 |
if (tcps->tcps_snd_lowat_fraction != 0) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
611 |
connp->conn_sndlowat = connp->conn_sndbuf / |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
612 |
tcps->tcps_snd_lowat_fraction; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
613 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
614 |
(void) tcp_maxpsz_set(tcp, B_TRUE); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
615 |
/* |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
616 |
* If we are flow-controlled, recheck the condition. |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
617 |
* There are apps that increase SO_SNDBUF size when |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
618 |
* flow-controlled (EWOULDBLOCK), and expect the flow |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
619 |
* control condition to be lifted right away. |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
620 |
*/ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
621 |
mutex_enter(&tcp->tcp_non_sq_lock); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
622 |
if (tcp->tcp_flow_stopped && |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
623 |
TCP_UNSENT_BYTES(tcp) < connp->conn_sndbuf) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
624 |
tcp_clrqfull(tcp); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
625 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
626 |
mutex_exit(&tcp->tcp_non_sq_lock); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
627 |
*outlenp = inlen; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
628 |
return (0); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
629 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
630 |
case SO_RCVBUF: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
631 |
if (*i1 > tcps->tcps_max_buf) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
632 |
*outlenp = 0; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
633 |
return (ENOBUFS); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
634 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
635 |
/* Silently ignore zero */ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
636 |
if (!checkonly && *i1 != 0) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
637 |
*i1 = MSS_ROUNDUP(*i1, tcp->tcp_mss); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
638 |
(void) tcp_rwnd_set(tcp, *i1); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
639 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
640 |
/* |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
641 |
* XXX should we return the rwnd here |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
642 |
* and tcp_opt_get ? |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
643 |
*/ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
644 |
*outlenp = inlen; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
645 |
return (0); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
646 |
case SO_SND_COPYAVOID: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
647 |
if (!checkonly) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
648 |
if (tcp->tcp_loopback || |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
649 |
(onoff != 1) || !tcp_zcopy_check(tcp)) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
650 |
*outlenp = 0; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
651 |
return (EOPNOTSUPP); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
652 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
653 |
tcp->tcp_snd_zcopy_aware = 1; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
654 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
655 |
*outlenp = inlen; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
656 |
return (0); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
657 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
658 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
659 |
case IPPROTO_TCP: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
660 |
switch (name) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
661 |
case TCP_NODELAY: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
662 |
if (!checkonly) |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
663 |
tcp->tcp_naglim = *i1 ? 1 : tcp->tcp_mss; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
664 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
665 |
case TCP_NOTIFY_THRESHOLD: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
666 |
if (!checkonly) |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
667 |
tcp->tcp_first_timer_threshold = *i1; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
668 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
669 |
case TCP_ABORT_THRESHOLD: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
670 |
if (!checkonly) |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
671 |
tcp->tcp_second_timer_threshold = *i1; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
672 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
673 |
case TCP_CONN_NOTIFY_THRESHOLD: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
674 |
if (!checkonly) |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
675 |
tcp->tcp_first_ctimer_threshold = *i1; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
676 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
677 |
case TCP_CONN_ABORT_THRESHOLD: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
678 |
if (!checkonly) |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
679 |
tcp->tcp_second_ctimer_threshold = *i1; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
680 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
681 |
case TCP_RECVDSTADDR: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
682 |
if (tcp->tcp_state > TCPS_LISTEN) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
683 |
*outlenp = 0; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
684 |
return (EOPNOTSUPP); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
685 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
686 |
/* Setting done in conn_opt_set */ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
687 |
break; |
12544
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
688 |
case TCP_INIT_CWND: |
11754
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
689 |
if (checkonly) |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
690 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
691 |
|
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
692 |
/* |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
693 |
* Only allow socket with network configuration |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
694 |
* privilege to set the initial cwnd to be larger |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
695 |
* than allowed by RFC 3390. |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
696 |
*/ |
12544
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
697 |
if (val <= MIN(4, MAX(2, 4380 / tcp->tcp_mss))) { |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
698 |
tcp->tcp_init_cwnd = val; |
11754
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
699 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
700 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
701 |
if ((reterr = secpolicy_ip_config(cr, B_TRUE)) != 0) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
702 |
*outlenp = 0; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
703 |
return (reterr); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
704 |
} |
12544
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
705 |
if (val > tcp_max_init_cwnd) { |
11754
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
706 |
*outlenp = 0; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
707 |
return (EINVAL); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
708 |
} |
12544
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
709 |
tcp->tcp_init_cwnd = val; |
11754
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
710 |
break; |
13435
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
711 |
|
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
712 |
/* |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
713 |
* TCP_KEEPIDLE is in seconds but TCP_KEEPALIVE_THRESHOLD |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
714 |
* is in milliseconds. TCP_KEEPIDLE is introduced for |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
715 |
* compatibility with other Unix flavors. |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
716 |
* We can fall through TCP_KEEPALIVE_THRESHOLD logic after |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
717 |
* converting the input to milliseconds. |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
718 |
*/ |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
719 |
case TCP_KEEPIDLE: |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
720 |
*i1 *= 1000; |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
721 |
/* fall through */ |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
722 |
|
11754
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
723 |
case TCP_KEEPALIVE_THRESHOLD: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
724 |
if (checkonly) |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
725 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
726 |
|
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
727 |
if (*i1 < tcps->tcps_keepalive_interval_low || |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
728 |
*i1 > tcps->tcps_keepalive_interval_high) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
729 |
*outlenp = 0; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
730 |
return (EINVAL); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
731 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
732 |
if (*i1 != tcp->tcp_ka_interval) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
733 |
tcp->tcp_ka_interval = *i1; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
734 |
/* |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
735 |
* Check if we need to restart the |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
736 |
* keepalive timer. |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
737 |
*/ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
738 |
if (tcp->tcp_ka_tid != 0) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
739 |
ASSERT(connp->conn_keepalive); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
740 |
(void) TCP_TIMER_CANCEL(tcp, |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
741 |
tcp->tcp_ka_tid); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
742 |
tcp->tcp_ka_last_intrvl = 0; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
743 |
tcp->tcp_ka_tid = TCP_TIMER(tcp, |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
744 |
tcp_keepalive_timer, |
12056
4811a59c20b7
6935348 tcp_sack_info should always be there
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11754
diff
changeset
|
745 |
tcp->tcp_ka_interval); |
11754
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
746 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
747 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
748 |
break; |
13435
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
749 |
|
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
750 |
/* |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
751 |
* tcp_ka_abort_thres = tcp_ka_rinterval * tcp_ka_cnt. |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
752 |
* So setting TCP_KEEPCNT or TCP_KEEPINTVL can affect all the |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
753 |
* three members - tcp_ka_abort_thres, tcp_ka_rinterval and |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
754 |
* tcp_ka_cnt. |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
755 |
*/ |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
756 |
case TCP_KEEPCNT: |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
757 |
if (checkonly) |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
758 |
break; |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
759 |
|
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
760 |
if (*i1 == 0) { |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
761 |
return (EINVAL); |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
762 |
} else if (tcp->tcp_ka_rinterval == 0) { |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
763 |
if ((tcp->tcp_ka_abort_thres / *i1) < |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
764 |
tcp->tcp_rto_min || |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
765 |
(tcp->tcp_ka_abort_thres / *i1) > |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
766 |
tcp->tcp_rto_max) |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
767 |
return (EINVAL); |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
768 |
|
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
769 |
tcp->tcp_ka_rinterval = |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
770 |
tcp->tcp_ka_abort_thres / *i1; |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
771 |
} else { |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
772 |
if ((*i1 * tcp->tcp_ka_rinterval) < |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
773 |
tcps->tcps_keepalive_abort_interval_low || |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
774 |
(*i1 * tcp->tcp_ka_rinterval) > |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
775 |
tcps->tcps_keepalive_abort_interval_high) |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
776 |
return (EINVAL); |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
777 |
tcp->tcp_ka_abort_thres = |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
778 |
(*i1 * tcp->tcp_ka_rinterval); |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
779 |
} |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
780 |
tcp->tcp_ka_cnt = *i1; |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
781 |
break; |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
782 |
case TCP_KEEPINTVL: |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
783 |
/* |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
784 |
* TCP_KEEPINTVL is specified in seconds, but |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
785 |
* tcp_ka_rinterval is in milliseconds. |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
786 |
*/ |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
787 |
|
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
788 |
if (checkonly) |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
789 |
break; |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
790 |
|
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
791 |
if ((*i1 * 1000) < tcp->tcp_rto_min || |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
792 |
(*i1 * 1000) > tcp->tcp_rto_max) |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
793 |
return (EINVAL); |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
794 |
|
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
795 |
if (tcp->tcp_ka_cnt == 0) { |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
796 |
tcp->tcp_ka_cnt = |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
797 |
tcp->tcp_ka_abort_thres / (*i1 * 1000); |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
798 |
} else { |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
799 |
if ((*i1 * tcp->tcp_ka_cnt * 1000) < |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
800 |
tcps->tcps_keepalive_abort_interval_low || |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
801 |
(*i1 * tcp->tcp_ka_cnt * 1000) > |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
802 |
tcps->tcps_keepalive_abort_interval_high) |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
803 |
return (EINVAL); |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
804 |
tcp->tcp_ka_abort_thres = |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
805 |
(*i1 * tcp->tcp_ka_cnt * 1000); |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
806 |
} |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
807 |
tcp->tcp_ka_rinterval = *i1 * 1000; |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
808 |
break; |
11754
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
809 |
case TCP_KEEPALIVE_ABORT_THRESHOLD: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
810 |
if (!checkonly) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
811 |
if (*i1 < |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
812 |
tcps->tcps_keepalive_abort_interval_low || |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
813 |
*i1 > |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
814 |
tcps->tcps_keepalive_abort_interval_high) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
815 |
*outlenp = 0; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
816 |
return (EINVAL); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
817 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
818 |
tcp->tcp_ka_abort_thres = *i1; |
13435
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
819 |
tcp->tcp_ka_cnt = 0; |
3185061eadee
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Garrett D'Amore <garrett@nexenta.com>
parents:
12644
diff
changeset
|
820 |
tcp->tcp_ka_rinterval = 0; |
11754
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
821 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
822 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
823 |
case TCP_CORK: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
824 |
if (!checkonly) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
825 |
/* |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
826 |
* if tcp->tcp_cork was set and is now |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
827 |
* being unset, we have to make sure that |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
828 |
* the remaining data gets sent out. Also |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
829 |
* unset tcp->tcp_cork so that tcp_wput_data() |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
830 |
* can send data even if it is less than mss |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
831 |
*/ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
832 |
if (tcp->tcp_cork && onoff == 0 && |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
833 |
tcp->tcp_unsent > 0) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
834 |
tcp->tcp_cork = B_FALSE; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
835 |
tcp_wput_data(tcp, NULL, B_FALSE); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
836 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
837 |
tcp->tcp_cork = onoff; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
838 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
839 |
break; |
12544
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
840 |
case TCP_RTO_INITIAL: { |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
841 |
clock_t rto; |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
842 |
|
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
843 |
if (checkonly || val == 0) |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
844 |
break; |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
845 |
|
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
846 |
/* |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
847 |
* Sanity checks |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
848 |
* |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
849 |
* The initial RTO should be bounded by the minimum |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
850 |
* and maximum RTO. And it should also be smaller |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
851 |
* than the connect attempt abort timeout. Otherwise, |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
852 |
* the connection won't be aborted in a period |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
853 |
* reasonably close to that timeout. |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
854 |
*/ |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
855 |
if (val < tcp->tcp_rto_min || val > tcp->tcp_rto_max || |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
856 |
val > tcp->tcp_second_ctimer_threshold || |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
857 |
val < tcps->tcps_rexmit_interval_initial_low || |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
858 |
val > tcps->tcps_rexmit_interval_initial_high) { |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
859 |
*outlenp = 0; |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
860 |
return (EINVAL); |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
861 |
} |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
862 |
tcp->tcp_rto_initial = val; |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
863 |
|
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
864 |
/* |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
865 |
* If TCP has not sent anything, need to re-calculate |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
866 |
* tcp_rto. Otherwise, this option change does not |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
867 |
* really affect anything. |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
868 |
*/ |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
869 |
if (tcp->tcp_state >= TCPS_SYN_SENT) |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
870 |
break; |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
871 |
|
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
872 |
tcp->tcp_rtt_sa = tcp->tcp_rto_initial << 2; |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
873 |
tcp->tcp_rtt_sd = tcp->tcp_rto_initial >> 1; |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
874 |
rto = (tcp->tcp_rtt_sa >> 3) + tcp->tcp_rtt_sd + |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
875 |
tcps->tcps_rexmit_interval_extra + |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
876 |
(tcp->tcp_rtt_sa >> 5) + |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
877 |
tcps->tcps_conn_grace_period; |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
878 |
TCP_SET_RTO(tcp, rto); |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
879 |
break; |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
880 |
} |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
881 |
case TCP_RTO_MIN: |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
882 |
if (checkonly || val == 0) |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
883 |
break; |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
884 |
|
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
885 |
if (val < tcps->tcps_rexmit_interval_min_low || |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
886 |
val > tcps->tcps_rexmit_interval_min_high || |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
887 |
val > tcp->tcp_rto_max) { |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
888 |
*outlenp = 0; |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
889 |
return (EINVAL); |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
890 |
} |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
891 |
tcp->tcp_rto_min = val; |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
892 |
if (tcp->tcp_rto < val) |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
893 |
tcp->tcp_rto = val; |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
894 |
break; |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
895 |
case TCP_RTO_MAX: |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
896 |
if (checkonly || val == 0) |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
897 |
break; |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
898 |
|
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
899 |
/* |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
900 |
* Sanity checks |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
901 |
* |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
902 |
* The maximum RTO should not be larger than the |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
903 |
* connection abort timeout. Otherwise, the |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
904 |
* connection won't be aborted in a period reasonably |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
905 |
* close to that timeout. |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
906 |
*/ |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
907 |
if (val < tcps->tcps_rexmit_interval_max_low || |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
908 |
val > tcps->tcps_rexmit_interval_max_high || |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
909 |
val < tcp->tcp_rto_min || |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
910 |
val > tcp->tcp_second_timer_threshold) { |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
911 |
*outlenp = 0; |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
912 |
return (EINVAL); |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
913 |
} |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
914 |
tcp->tcp_rto_max = val; |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
915 |
if (tcp->tcp_rto > val) |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
916 |
tcp->tcp_rto = val; |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
917 |
break; |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
918 |
case TCP_LINGER2: |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
919 |
if (checkonly || *i1 == 0) |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
920 |
break; |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
921 |
|
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
922 |
/* |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
923 |
* Note that the option value's unit is second. And |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
924 |
* the value should be bigger than the private |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
925 |
* parameter tcp_fin_wait_2_flush_interval's lower |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
926 |
* bound and smaller than the current value of that |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
927 |
* parameter. It should be smaller than the current |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
928 |
* value to avoid an app setting TCP_LINGER2 to a big |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
929 |
* value, causing resource to be held up too long in |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
930 |
* FIN-WAIT-2 state. |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
931 |
*/ |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
932 |
if (*i1 < 0 || |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
933 |
tcps->tcps_fin_wait_2_flush_interval_low/SECONDS > |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
934 |
*i1 || |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
935 |
tcps->tcps_fin_wait_2_flush_interval/SECONDS < |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
936 |
*i1) { |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
937 |
*outlenp = 0; |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
938 |
return (EINVAL); |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
939 |
} |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
940 |
tcp->tcp_fin_wait_2_flush_interval = *i1 * SECONDS; |
88a11088cbce
PSARC 2010/151 new socket options for TCP timers
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
12056
diff
changeset
|
941 |
break; |
11754
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
942 |
default: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
943 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
944 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
945 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
946 |
case IPPROTO_IP: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
947 |
if (connp->conn_family != AF_INET) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
948 |
*outlenp = 0; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
949 |
return (EINVAL); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
950 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
951 |
switch (name) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
952 |
case IP_SEC_OPT: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
953 |
/* |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
954 |
* We should not allow policy setting after |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
955 |
* we start listening for connections. |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
956 |
*/ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
957 |
if (tcp->tcp_state == TCPS_LISTEN) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
958 |
return (EINVAL); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
959 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
960 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
961 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
962 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
963 |
case IPPROTO_IPV6: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
964 |
/* |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
965 |
* IPPROTO_IPV6 options are only supported for sockets |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
966 |
* that are using IPv6 on the wire. |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
967 |
*/ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
968 |
if (connp->conn_ipversion != IPV6_VERSION) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
969 |
*outlenp = 0; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
970 |
return (EINVAL); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
971 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
972 |
|
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
973 |
switch (name) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
974 |
case IPV6_RECVPKTINFO: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
975 |
if (!checkonly) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
976 |
/* Force it to be sent up with the next msg */ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
977 |
tcp->tcp_recvifindex = 0; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
978 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
979 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
980 |
case IPV6_RECVTCLASS: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
981 |
if (!checkonly) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
982 |
/* Force it to be sent up with the next msg */ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
983 |
tcp->tcp_recvtclass = 0xffffffffU; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
984 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
985 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
986 |
case IPV6_RECVHOPLIMIT: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
987 |
if (!checkonly) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
988 |
/* Force it to be sent up with the next msg */ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
989 |
tcp->tcp_recvhops = 0xffffffffU; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
990 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
991 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
992 |
case IPV6_PKTINFO: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
993 |
/* This is an extra check for TCP */ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
994 |
if (inlen == sizeof (struct in6_pktinfo)) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
995 |
struct in6_pktinfo *pkti; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
996 |
|
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
997 |
pkti = (struct in6_pktinfo *)invalp; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
998 |
/* |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
999 |
* RFC 3542 states that ipi6_addr must be |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1000 |
* the unspecified address when setting the |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1001 |
* IPV6_PKTINFO sticky socket option on a |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1002 |
* TCP socket. |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1003 |
*/ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1004 |
if (!IN6_IS_ADDR_UNSPECIFIED(&pkti->ipi6_addr)) |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1005 |
return (EINVAL); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1006 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1007 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1008 |
case IPV6_SEC_OPT: |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1009 |
/* |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1010 |
* We should not allow policy setting after |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1011 |
* we start listening for connections. |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1012 |
*/ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1013 |
if (tcp->tcp_state == TCPS_LISTEN) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1014 |
return (EINVAL); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1015 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1016 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1017 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1018 |
break; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1019 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1020 |
reterr = conn_opt_set(&coas, level, name, inlen, invalp, |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1021 |
checkonly, cr); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1022 |
if (reterr != 0) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1023 |
*outlenp = 0; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1024 |
return (reterr); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1025 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1026 |
|
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1027 |
/* |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1028 |
* Common case of OK return with outval same as inval |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1029 |
*/ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1030 |
if (invalp != outvalp) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1031 |
/* don't trust bcopy for identical src/dst */ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1032 |
(void) bcopy(invalp, outvalp, inlen); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1033 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1034 |
*outlenp = inlen; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1035 |
|
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1036 |
if (coas.coa_changed & COA_HEADER_CHANGED) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1037 |
/* If we are connected we rebuilt the headers */ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1038 |
if (!IN6_IS_ADDR_UNSPECIFIED(&connp->conn_faddr_v6) && |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1039 |
!IN6_IS_ADDR_V4MAPPED_ANY(&connp->conn_faddr_v6)) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1040 |
reterr = tcp_build_hdrs(tcp); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1041 |
if (reterr != 0) |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1042 |
return (reterr); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1043 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1044 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1045 |
if (coas.coa_changed & COA_ROUTE_CHANGED) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1046 |
in6_addr_t nexthop; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1047 |
|
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1048 |
/* |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1049 |
* If we are connected we re-cache the information. |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1050 |
* We ignore errors to preserve BSD behavior. |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1051 |
* Note that we don't redo IPsec policy lookup here |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1052 |
* since the final destination (or source) didn't change. |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1053 |
*/ |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1054 |
ip_attr_nexthop(&connp->conn_xmit_ipp, connp->conn_ixa, |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1055 |
&connp->conn_faddr_v6, &nexthop); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1056 |
|
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1057 |
if (!IN6_IS_ADDR_UNSPECIFIED(&connp->conn_faddr_v6) && |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1058 |
!IN6_IS_ADDR_V4MAPPED_ANY(&connp->conn_faddr_v6)) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1059 |
(void) ip_attr_connect(connp, connp->conn_ixa, |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1060 |
&connp->conn_laddr_v6, &connp->conn_faddr_v6, |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1061 |
&nexthop, connp->conn_fport, NULL, NULL, |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1062 |
IPDF_VERIFY_DST); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1063 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1064 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1065 |
if ((coas.coa_changed & COA_SNDBUF_CHANGED) && !IPCL_IS_NONSTR(connp)) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1066 |
connp->conn_wq->q_hiwat = connp->conn_sndbuf; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1067 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1068 |
if (coas.coa_changed & COA_WROFF_CHANGED) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1069 |
connp->conn_wroff = connp->conn_ht_iphc_allocated + |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1070 |
tcps->tcps_wroff_xtra; |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1071 |
(void) proto_set_tx_wroff(connp->conn_rq, connp, |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1072 |
connp->conn_wroff); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1073 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1074 |
if (coas.coa_changed & COA_OOBINLINE_CHANGED) { |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1075 |
if (IPCL_IS_NONSTR(connp)) |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1076 |
proto_set_rx_oob_opt(connp, onoff); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1077 |
} |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1078 |
return (0); |
251da8f4caaa
PSARC 2010/042 increase max TCP_INIT_CWND
Kacheong Poon <Kacheong.Poon@Sun.COM>
parents:
11042
diff
changeset
|
1079 |
} |