diff options
author | Vladislav Yasevich <vladislav.yasevich@hp.com> | 2006-08-22 16:29:17 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-09-22 17:55:39 -0400 |
commit | 3fd091e73b81f131e1567c4d4a1ec042940bf2f7 (patch) | |
tree | c08ebbeee329bbc31cb578db1dddde7394431f5f /include/net | |
parent | ce556b3a591fff3bebf8c5590a86aa98e1b2f153 (diff) |
[SCTP]: Remove multiple levels of msecs to jiffies conversions.
The SCTP sysctl entries are displayed in milliseconds, but stored
internally in jiffies. This results in multiple levels of msecs to
jiffies conversion and as a result produces a truncation error. This
patch makes things consistent in that we store and display defaults
in milliseconds and only convert once for use by association.
This patch also adds some sane min/max values so that we don't go off
the deep end.
Signed-off-by: Vladislav Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/sctp/constants.h | 13 | ||||
-rw-r--r-- | include/net/sctp/structs.h | 12 |
2 files changed, 12 insertions, 13 deletions
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h index 57166bfdf8eb..6c632e26f72d 100644 --- a/include/net/sctp/constants.h +++ b/include/net/sctp/constants.h | |||
@@ -264,10 +264,10 @@ enum { SCTP_MAX_DUP_TSNS = 16 }; | |||
264 | enum { SCTP_MAX_GABS = 16 }; | 264 | enum { SCTP_MAX_GABS = 16 }; |
265 | 265 | ||
266 | /* Heartbeat interval - 30 secs */ | 266 | /* Heartbeat interval - 30 secs */ |
267 | #define SCTP_DEFAULT_TIMEOUT_HEARTBEAT (30 * HZ) | 267 | #define SCTP_DEFAULT_TIMEOUT_HEARTBEAT (30*1000) |
268 | 268 | ||
269 | /* Delayed sack timer - 200ms */ | 269 | /* Delayed sack timer - 200ms */ |
270 | #define SCTP_DEFAULT_TIMEOUT_SACK ((200 * HZ) / 1000) | 270 | #define SCTP_DEFAULT_TIMEOUT_SACK (200) |
271 | 271 | ||
272 | /* RTO.Initial - 3 seconds | 272 | /* RTO.Initial - 3 seconds |
273 | * RTO.Min - 1 second | 273 | * RTO.Min - 1 second |
@@ -275,9 +275,9 @@ enum { SCTP_MAX_GABS = 16 }; | |||
275 | * RTO.Alpha - 1/8 | 275 | * RTO.Alpha - 1/8 |
276 | * RTO.Beta - 1/4 | 276 | * RTO.Beta - 1/4 |
277 | */ | 277 | */ |
278 | #define SCTP_RTO_INITIAL (3 * HZ) | 278 | #define SCTP_RTO_INITIAL (3 * 1000) |
279 | #define SCTP_RTO_MIN (1 * HZ) | 279 | #define SCTP_RTO_MIN (1 * 1000) |
280 | #define SCTP_RTO_MAX (60 * HZ) | 280 | #define SCTP_RTO_MAX (60 * 1000) |
281 | 281 | ||
282 | #define SCTP_RTO_ALPHA 3 /* 1/8 when converted to right shifts. */ | 282 | #define SCTP_RTO_ALPHA 3 /* 1/8 when converted to right shifts. */ |
283 | #define SCTP_RTO_BETA 2 /* 1/4 when converted to right shifts. */ | 283 | #define SCTP_RTO_BETA 2 /* 1/4 when converted to right shifts. */ |
@@ -290,8 +290,7 @@ enum { SCTP_MAX_GABS = 16 }; | |||
290 | #define SCTP_DEF_MAX_INIT 6 | 290 | #define SCTP_DEF_MAX_INIT 6 |
291 | #define SCTP_DEF_MAX_SEND 10 | 291 | #define SCTP_DEF_MAX_SEND 10 |
292 | 292 | ||
293 | #define SCTP_DEFAULT_COOKIE_LIFE_SEC 60 /* seconds */ | 293 | #define SCTP_DEFAULT_COOKIE_LIFE (60 * 1000) /* 60 seconds */ |
294 | #define SCTP_DEFAULT_COOKIE_LIFE_USEC 0 /* microseconds */ | ||
295 | 294 | ||
296 | #define SCTP_DEFAULT_MINWINDOW 1500 /* default minimum rwnd size */ | 295 | #define SCTP_DEFAULT_MINWINDOW 1500 /* default minimum rwnd size */ |
297 | #define SCTP_DEFAULT_MAXWINDOW 65535 /* default rwnd size */ | 296 | #define SCTP_DEFAULT_MAXWINDOW 65535 /* default rwnd size */ |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 0412e730c765..c6d93bb0dcd2 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -128,9 +128,9 @@ extern struct sctp_globals { | |||
128 | * RTO.Alpha - 1/8 (3 when converted to right shifts.) | 128 | * RTO.Alpha - 1/8 (3 when converted to right shifts.) |
129 | * RTO.Beta - 1/4 (2 when converted to right shifts.) | 129 | * RTO.Beta - 1/4 (2 when converted to right shifts.) |
130 | */ | 130 | */ |
131 | unsigned long rto_initial; | 131 | unsigned int rto_initial; |
132 | unsigned long rto_min; | 132 | unsigned int rto_min; |
133 | unsigned long rto_max; | 133 | unsigned int rto_max; |
134 | 134 | ||
135 | /* Note: rto_alpha and rto_beta are really defined as inverse | 135 | /* Note: rto_alpha and rto_beta are really defined as inverse |
136 | * powers of two to facilitate integer operations. | 136 | * powers of two to facilitate integer operations. |
@@ -145,13 +145,13 @@ extern struct sctp_globals { | |||
145 | int cookie_preserve_enable; | 145 | int cookie_preserve_enable; |
146 | 146 | ||
147 | /* Valid.Cookie.Life - 60 seconds */ | 147 | /* Valid.Cookie.Life - 60 seconds */ |
148 | unsigned long valid_cookie_life; | 148 | unsigned int valid_cookie_life; |
149 | 149 | ||
150 | /* Delayed SACK timeout 200ms default*/ | 150 | /* Delayed SACK timeout 200ms default*/ |
151 | unsigned long sack_timeout; | 151 | unsigned int sack_timeout; |
152 | 152 | ||
153 | /* HB.interval - 30 seconds */ | 153 | /* HB.interval - 30 seconds */ |
154 | unsigned long hb_interval; | 154 | unsigned int hb_interval; |
155 | 155 | ||
156 | /* Association.Max.Retrans - 10 attempts | 156 | /* Association.Max.Retrans - 10 attempts |
157 | * Path.Max.Retrans - 5 attempts (per destination address) | 157 | * Path.Max.Retrans - 5 attempts (per destination address) |