diff options
author | Vlad Yasevich <vladislav.yasevich@hp.com> | 2005-06-28 16:24:23 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-06-28 16:24:23 -0400 |
commit | 2f85a42964dd43fed3a339701db046bee5a8b903 (patch) | |
tree | c482ebfb01fb90ba48f20e8f6c871b00ea8e351a | |
parent | 7a1af5d7bb94af16b980a53330436b9fadc12435 (diff) |
[SCTP] Make init & delayed sack timeouts configurable by user.
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/linux/sysctl.h | 1 | ||||
-rw-r--r-- | include/net/sctp/constants.h | 18 | ||||
-rw-r--r-- | include/net/sctp/structs.h | 4 | ||||
-rw-r--r-- | net/sctp/endpointola.c | 13 | ||||
-rw-r--r-- | net/sctp/protocol.c | 5 | ||||
-rw-r--r-- | net/sctp/sysctl.c | 13 | ||||
-rw-r--r-- | net/sctp/transport.c | 1 |
7 files changed, 30 insertions, 25 deletions
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index ebfe1250f0a4..5b5f434ac9a0 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -641,6 +641,7 @@ enum { | |||
641 | NET_SCTP_ADDIP_ENABLE = 13, | 641 | NET_SCTP_ADDIP_ENABLE = 13, |
642 | NET_SCTP_PRSCTP_ENABLE = 14, | 642 | NET_SCTP_PRSCTP_ENABLE = 14, |
643 | NET_SCTP_SNDBUF_POLICY = 15, | 643 | NET_SCTP_SNDBUF_POLICY = 15, |
644 | NET_SCTP_SACK_TIMEOUT = 16, | ||
644 | }; | 645 | }; |
645 | 646 | ||
646 | /* /proc/sys/net/bridge */ | 647 | /* /proc/sys/net/bridge */ |
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h index 4868c7f7749d..5999e5684bbf 100644 --- a/include/net/sctp/constants.h +++ b/include/net/sctp/constants.h | |||
@@ -263,23 +263,11 @@ enum { SCTP_MIN_PMTU = 576 }; | |||
263 | enum { SCTP_MAX_DUP_TSNS = 16 }; | 263 | enum { SCTP_MAX_DUP_TSNS = 16 }; |
264 | enum { SCTP_MAX_GABS = 16 }; | 264 | enum { SCTP_MAX_GABS = 16 }; |
265 | 265 | ||
266 | /* Here we define the default timers. */ | 266 | /* Heartbeat interval - 30 secs */ |
267 | #define SCTP_DEFAULT_TIMEOUT_HEARTBEAT (30 * HZ) | ||
267 | 268 | ||
268 | /* cookie timer def = ? seconds */ | 269 | /* Delayed sack timer - 200ms */ |
269 | #define SCTP_DEFAULT_TIMEOUT_T1_COOKIE (3 * HZ) | ||
270 | |||
271 | /* init timer def = 3 seconds */ | ||
272 | #define SCTP_DEFAULT_TIMEOUT_T1_INIT (3 * HZ) | ||
273 | |||
274 | /* shutdown timer def = 300 ms */ | ||
275 | #define SCTP_DEFAULT_TIMEOUT_T2_SHUTDOWN ((300 * HZ) / 1000) | ||
276 | |||
277 | /* 0 seconds + RTO */ | ||
278 | #define SCTP_DEFAULT_TIMEOUT_HEARTBEAT (10 * HZ) | ||
279 | |||
280 | /* recv timer def = 200ms (in usec) */ | ||
281 | #define SCTP_DEFAULT_TIMEOUT_SACK ((200 * HZ) / 1000) | 270 | #define SCTP_DEFAULT_TIMEOUT_SACK ((200 * HZ) / 1000) |
282 | #define SCTP_DEFAULT_TIMEOUT_SACK_MAX ((500 * HZ) / 1000) /* 500 ms */ | ||
283 | 271 | ||
284 | /* RTO.Initial - 3 seconds | 272 | /* RTO.Initial - 3 seconds |
285 | * RTO.Min - 1 second | 273 | * RTO.Min - 1 second |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index dfad4d3c581c..47727c7cc628 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -161,6 +161,9 @@ extern struct sctp_globals { | |||
161 | */ | 161 | */ |
162 | int sndbuf_policy; | 162 | int sndbuf_policy; |
163 | 163 | ||
164 | /* Delayed SACK timeout 200ms default*/ | ||
165 | int sack_timeout; | ||
166 | |||
164 | /* HB.interval - 30 seconds */ | 167 | /* HB.interval - 30 seconds */ |
165 | int hb_interval; | 168 | int hb_interval; |
166 | 169 | ||
@@ -217,6 +220,7 @@ extern struct sctp_globals { | |||
217 | #define sctp_sndbuf_policy (sctp_globals.sndbuf_policy) | 220 | #define sctp_sndbuf_policy (sctp_globals.sndbuf_policy) |
218 | #define sctp_max_retrans_path (sctp_globals.max_retrans_path) | 221 | #define sctp_max_retrans_path (sctp_globals.max_retrans_path) |
219 | #define sctp_max_retrans_init (sctp_globals.max_retrans_init) | 222 | #define sctp_max_retrans_init (sctp_globals.max_retrans_init) |
223 | #define sctp_sack_timeout (sctp_globals.sack_timeout) | ||
220 | #define sctp_hb_interval (sctp_globals.hb_interval) | 224 | #define sctp_hb_interval (sctp_globals.hb_interval) |
221 | #define sctp_max_instreams (sctp_globals.max_instreams) | 225 | #define sctp_max_instreams (sctp_globals.max_instreams) |
222 | #define sctp_max_outstreams (sctp_globals.max_outstreams) | 226 | #define sctp_max_outstreams (sctp_globals.max_outstreams) |
diff --git a/net/sctp/endpointola.c b/net/sctp/endpointola.c index 2ec0320fac3b..c44bf4165c6e 100644 --- a/net/sctp/endpointola.c +++ b/net/sctp/endpointola.c | |||
@@ -102,9 +102,9 @@ static struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep, | |||
102 | /* Set up the base timeout information. */ | 102 | /* Set up the base timeout information. */ |
103 | ep->timeouts[SCTP_EVENT_TIMEOUT_NONE] = 0; | 103 | ep->timeouts[SCTP_EVENT_TIMEOUT_NONE] = 0; |
104 | ep->timeouts[SCTP_EVENT_TIMEOUT_T1_COOKIE] = | 104 | ep->timeouts[SCTP_EVENT_TIMEOUT_T1_COOKIE] = |
105 | SCTP_DEFAULT_TIMEOUT_T1_COOKIE; | 105 | msecs_to_jiffies(sp->rtoinfo.srto_initial); |
106 | ep->timeouts[SCTP_EVENT_TIMEOUT_T1_INIT] = | 106 | ep->timeouts[SCTP_EVENT_TIMEOUT_T1_INIT] = |
107 | SCTP_DEFAULT_TIMEOUT_T1_INIT; | 107 | msecs_to_jiffies(sp->rtoinfo.srto_initial); |
108 | ep->timeouts[SCTP_EVENT_TIMEOUT_T2_SHUTDOWN] = | 108 | ep->timeouts[SCTP_EVENT_TIMEOUT_T2_SHUTDOWN] = |
109 | msecs_to_jiffies(sp->rtoinfo.srto_initial); | 109 | msecs_to_jiffies(sp->rtoinfo.srto_initial); |
110 | ep->timeouts[SCTP_EVENT_TIMEOUT_T3_RTX] = 0; | 110 | ep->timeouts[SCTP_EVENT_TIMEOUT_T3_RTX] = 0; |
@@ -117,12 +117,9 @@ static struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep, | |||
117 | ep->timeouts[SCTP_EVENT_TIMEOUT_T5_SHUTDOWN_GUARD] | 117 | ep->timeouts[SCTP_EVENT_TIMEOUT_T5_SHUTDOWN_GUARD] |
118 | = 5 * msecs_to_jiffies(sp->rtoinfo.srto_max); | 118 | = 5 * msecs_to_jiffies(sp->rtoinfo.srto_max); |
119 | 119 | ||
120 | ep->timeouts[SCTP_EVENT_TIMEOUT_HEARTBEAT] = | 120 | ep->timeouts[SCTP_EVENT_TIMEOUT_HEARTBEAT] = 0; |
121 | SCTP_DEFAULT_TIMEOUT_HEARTBEAT; | 121 | ep->timeouts[SCTP_EVENT_TIMEOUT_SACK] = sctp_sack_timeout; |
122 | ep->timeouts[SCTP_EVENT_TIMEOUT_SACK] = | 122 | ep->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE] = sp->autoclose * HZ; |
123 | SCTP_DEFAULT_TIMEOUT_SACK; | ||
124 | ep->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE] = | ||
125 | sp->autoclose * HZ; | ||
126 | 123 | ||
127 | /* Use SCTP specific send buffer space queues. */ | 124 | /* Use SCTP specific send buffer space queues. */ |
128 | ep->sndbuf_policy = sctp_sndbuf_policy; | 125 | ep->sndbuf_policy = sctp_sndbuf_policy; |
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index 5135e1a25d25..e7f37faba7c0 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c | |||
@@ -1050,7 +1050,10 @@ SCTP_STATIC __init int sctp_init(void) | |||
1050 | sctp_sndbuf_policy = 0; | 1050 | sctp_sndbuf_policy = 0; |
1051 | 1051 | ||
1052 | /* HB.interval - 30 seconds */ | 1052 | /* HB.interval - 30 seconds */ |
1053 | sctp_hb_interval = 30 * HZ; | 1053 | sctp_hb_interval = SCTP_DEFAULT_TIMEOUT_HEARTBEAT; |
1054 | |||
1055 | /* delayed SACK timeout */ | ||
1056 | sctp_sack_timeout = SCTP_DEFAULT_TIMEOUT_SACK; | ||
1054 | 1057 | ||
1055 | /* Implementation specific variables. */ | 1058 | /* Implementation specific variables. */ |
1056 | 1059 | ||
diff --git a/net/sctp/sysctl.c b/net/sctp/sysctl.c index 7fc31849312b..dc4893474f18 100644 --- a/net/sctp/sysctl.c +++ b/net/sctp/sysctl.c | |||
@@ -47,6 +47,8 @@ | |||
47 | static ctl_handler sctp_sysctl_jiffies_ms; | 47 | static ctl_handler sctp_sysctl_jiffies_ms; |
48 | static long rto_timer_min = 1; | 48 | static long rto_timer_min = 1; |
49 | static long rto_timer_max = 86400000; /* One day */ | 49 | static long rto_timer_max = 86400000; /* One day */ |
50 | static long sack_timer_min = 1; | ||
51 | static long sack_timer_max = 500; | ||
50 | 52 | ||
51 | static ctl_table sctp_table[] = { | 53 | static ctl_table sctp_table[] = { |
52 | { | 54 | { |
@@ -187,6 +189,17 @@ static ctl_table sctp_table[] = { | |||
187 | .mode = 0644, | 189 | .mode = 0644, |
188 | .proc_handler = &proc_dointvec | 190 | .proc_handler = &proc_dointvec |
189 | }, | 191 | }, |
192 | { | ||
193 | .ctl_name = NET_SCTP_SACK_TIMEOUT, | ||
194 | .procname = "sack_timeout", | ||
195 | .data = &sctp_sack_timeout, | ||
196 | .maxlen = sizeof(long), | ||
197 | .mode = 0644, | ||
198 | .proc_handler = &proc_doulongvec_ms_jiffies_minmax, | ||
199 | .strategy = &sctp_sysctl_jiffies_ms, | ||
200 | .extra1 = &sack_timer_min, | ||
201 | .extra2 = &sack_timer_max, | ||
202 | }, | ||
190 | { .ctl_name = 0 } | 203 | { .ctl_name = 0 } |
191 | }; | 204 | }; |
192 | 205 | ||
diff --git a/net/sctp/transport.c b/net/sctp/transport.c index 0ec0fde6e6c5..a63b69179607 100644 --- a/net/sctp/transport.c +++ b/net/sctp/transport.c | |||
@@ -103,7 +103,6 @@ static struct sctp_transport *sctp_transport_init(struct sctp_transport *peer, | |||
103 | 103 | ||
104 | /* Set up the heartbeat timer. */ | 104 | /* Set up the heartbeat timer. */ |
105 | init_timer(&peer->hb_timer); | 105 | init_timer(&peer->hb_timer); |
106 | peer->hb_interval = SCTP_DEFAULT_TIMEOUT_HEARTBEAT; | ||
107 | peer->hb_timer.function = sctp_generate_heartbeat_event; | 106 | peer->hb_timer.function = sctp_generate_heartbeat_event; |
108 | peer->hb_timer.data = (unsigned long)peer; | 107 | peer->hb_timer.data = (unsigned long)peer; |
109 | 108 | ||