Commit 8116ffad authored by Vlad Yasevich's avatar Vlad Yasevich Committed by Sridhar Samudrala

[SCTP]: Fix bad sysctl formatting of SCTP timeout values on 64-bit m/cs.

Change all the structure members that hold jiffies to be of type
unsigned long.  This also corrects bad sysctl formating on 64 bit
architectures.
Signed-off-by: default avatarVlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: default avatarSridhar Samudrala <sri@us.ibm.com>
parent 38b0e42a
...@@ -127,9 +127,9 @@ extern struct sctp_globals { ...@@ -127,9 +127,9 @@ extern struct sctp_globals {
* RTO.Alpha - 1/8 (3 when converted to right shifts.) * RTO.Alpha - 1/8 (3 when converted to right shifts.)
* RTO.Beta - 1/4 (2 when converted to right shifts.) * RTO.Beta - 1/4 (2 when converted to right shifts.)
*/ */
__u32 rto_initial; unsigned long rto_initial;
__u32 rto_min; unsigned long rto_min;
__u32 rto_max; unsigned long rto_max;
/* Note: rto_alpha and rto_beta are really defined as inverse /* Note: rto_alpha and rto_beta are really defined as inverse
* powers of two to facilitate integer operations. * powers of two to facilitate integer operations.
...@@ -140,12 +140,18 @@ extern struct sctp_globals { ...@@ -140,12 +140,18 @@ extern struct sctp_globals {
/* Max.Burst - 4 */ /* Max.Burst - 4 */
int max_burst; int max_burst;
/* Valid.Cookie.Life - 60 seconds */
int valid_cookie_life;
/* Whether Cookie Preservative is enabled(1) or not(0) */ /* Whether Cookie Preservative is enabled(1) or not(0) */
int cookie_preserve_enable; int cookie_preserve_enable;
/* Valid.Cookie.Life - 60 seconds */
unsigned long valid_cookie_life;
/* Delayed SACK timeout 200ms default*/
unsigned long sack_timeout;
/* HB.interval - 30 seconds */
unsigned long hb_interval;
/* Association.Max.Retrans - 10 attempts /* Association.Max.Retrans - 10 attempts
* Path.Max.Retrans - 5 attempts (per destination address) * Path.Max.Retrans - 5 attempts (per destination address)
* Max.Init.Retransmits - 8 attempts * Max.Init.Retransmits - 8 attempts
...@@ -168,12 +174,6 @@ extern struct sctp_globals { ...@@ -168,12 +174,6 @@ extern struct sctp_globals {
*/ */
int rcvbuf_policy; int rcvbuf_policy;
/* Delayed SACK timeout 200ms default*/
int sack_timeout;
/* HB.interval - 30 seconds */
int hb_interval;
/* The following variables are implementation specific. */ /* The following variables are implementation specific. */
/* Default initialization values to be applied to new associations. */ /* Default initialization values to be applied to new associations. */
...@@ -828,7 +828,7 @@ struct sctp_transport { ...@@ -828,7 +828,7 @@ struct sctp_transport {
__u32 rtt; /* This is the most recent RTT. */ __u32 rtt; /* This is the most recent RTT. */
/* RTO : The current retransmission timeout value. */ /* RTO : The current retransmission timeout value. */
__u32 rto; unsigned long rto;
/* RTTVAR : The current RTT variation. */ /* RTTVAR : The current RTT variation. */
__u32 rttvar; __u32 rttvar;
...@@ -878,22 +878,10 @@ struct sctp_transport { ...@@ -878,22 +878,10 @@ struct sctp_transport {
/* Heartbeat interval: The endpoint sends out a Heartbeat chunk to /* Heartbeat interval: The endpoint sends out a Heartbeat chunk to
* the destination address every heartbeat interval. * the destination address every heartbeat interval.
*/ */
__u32 hbinterval; unsigned long hbinterval;
/* This is the max_retrans value for the transport and will
* be initialized from the assocs value. This can be changed
* using SCTP_SET_PEER_ADDR_PARAMS socket option.
*/
__u16 pathmaxrxt;
/* PMTU : The current known path MTU. */
__u32 pathmtu;
/* SACK delay timeout */ /* SACK delay timeout */
__u32 sackdelay; unsigned long sackdelay;
/* Flags controling Heartbeat, SACK delay, and Path MTU Discovery. */
__u32 param_flags;
/* When was the last time (in jiffies) that we heard from this /* When was the last time (in jiffies) that we heard from this
* transport? We use this to pick new active and retran paths. * transport? We use this to pick new active and retran paths.
...@@ -905,6 +893,18 @@ struct sctp_transport { ...@@ -905,6 +893,18 @@ struct sctp_transport {
*/ */
unsigned long last_time_ecne_reduced; unsigned long last_time_ecne_reduced;
/* This is the max_retrans value for the transport and will
* be initialized from the assocs value. This can be changed
* using SCTP_SET_PEER_ADDR_PARAMS socket option.
*/
__u16 pathmaxrxt;
/* PMTU : The current known path MTU. */
__u32 pathmtu;
/* Flags controling Heartbeat, SACK delay, and Path MTU Discovery. */
__u32 param_flags;
/* The number of times INIT has been sent on this transport. */ /* The number of times INIT has been sent on this transport. */
int init_sent_count; int init_sent_count;
...@@ -1500,9 +1500,9 @@ struct sctp_association { ...@@ -1500,9 +1500,9 @@ struct sctp_association {
* These values will be initialized by system defaults, but can * These values will be initialized by system defaults, but can
* be modified via the SCTP_RTOINFO socket option. * be modified via the SCTP_RTOINFO socket option.
*/ */
__u32 rto_initial; unsigned long rto_initial;
__u32 rto_max; unsigned long rto_max;
__u32 rto_min; unsigned long rto_min;
/* Maximum number of new data packets that can be sent in a burst. */ /* Maximum number of new data packets that can be sent in a burst. */
int max_burst; int max_burst;
...@@ -1520,13 +1520,13 @@ struct sctp_association { ...@@ -1520,13 +1520,13 @@ struct sctp_association {
__u16 init_retries; __u16 init_retries;
/* The largest timeout or RTO value to use in attempting an INIT */ /* The largest timeout or RTO value to use in attempting an INIT */
__u16 max_init_timeo; unsigned long max_init_timeo;
/* Heartbeat interval: The endpoint sends out a Heartbeat chunk to /* Heartbeat interval: The endpoint sends out a Heartbeat chunk to
* the destination address every heartbeat interval. This value * the destination address every heartbeat interval. This value
* will be inherited by all new transports. * will be inherited by all new transports.
*/ */
__u32 hbinterval; unsigned long hbinterval;
/* This is the max_retrans value for new transports in the /* This is the max_retrans value for new transports in the
* association. * association.
...@@ -1538,13 +1538,14 @@ struct sctp_association { ...@@ -1538,13 +1538,14 @@ struct sctp_association {
*/ */
__u32 pathmtu; __u32 pathmtu;
/* SACK delay timeout */
__u32 sackdelay;
/* Flags controling Heartbeat, SACK delay, and Path MTU Discovery. */ /* Flags controling Heartbeat, SACK delay, and Path MTU Discovery. */
__u32 param_flags; __u32 param_flags;
int timeouts[SCTP_NUM_TIMEOUT_TYPES]; /* SACK delay timeout */
unsigned long sackdelay;
unsigned long timeouts[SCTP_NUM_TIMEOUT_TYPES];
struct timer_list timers[SCTP_NUM_TIMEOUT_TYPES]; struct timer_list timers[SCTP_NUM_TIMEOUT_TYPES];
/* Transport to which SHUTDOWN chunk was last sent. */ /* Transport to which SHUTDOWN chunk was last sent. */
...@@ -1649,7 +1650,10 @@ struct sctp_association { ...@@ -1649,7 +1650,10 @@ struct sctp_association {
/* How many duplicated TSNs have we seen? */ /* How many duplicated TSNs have we seen? */
int numduptsns; int numduptsns;
/* Number of seconds of idle time before an association is closed. */ /* Number of seconds of idle time before an association is closed.
* In the association context, this is really used as a boolean
* since the real timeout is stored in the timeouts array
*/
__u32 autoclose; __u32 autoclose;
/* These are to support /* These are to support
......
...@@ -1300,7 +1300,7 @@ static int sctp_cmd_interpreter(sctp_event_t event_type, ...@@ -1300,7 +1300,7 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,
"T1 INIT Timeout adjustment" "T1 INIT Timeout adjustment"
" init_err_counter: %d" " init_err_counter: %d"
" cycle: %d" " cycle: %d"
" timeout: %d\n", " timeout: %ld\n",
asoc->init_err_counter, asoc->init_err_counter,
asoc->init_cycle, asoc->init_cycle,
asoc->timeouts[SCTP_EVENT_TIMEOUT_T1_INIT]); asoc->timeouts[SCTP_EVENT_TIMEOUT_T1_INIT]);
...@@ -1328,7 +1328,7 @@ static int sctp_cmd_interpreter(sctp_event_t event_type, ...@@ -1328,7 +1328,7 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,
SCTP_DEBUG_PRINTK( SCTP_DEBUG_PRINTK(
"T1 COOKIE Timeout adjustment" "T1 COOKIE Timeout adjustment"
" init_err_counter: %d" " init_err_counter: %d"
" timeout: %d\n", " timeout: %ld\n",
asoc->init_err_counter, asoc->init_err_counter,
asoc->timeouts[SCTP_EVENT_TIMEOUT_T1_COOKIE]); asoc->timeouts[SCTP_EVENT_TIMEOUT_T1_COOKIE]);
......
...@@ -2995,7 +2995,7 @@ SCTP_STATIC int sctp_init_sock(struct sock *sk) ...@@ -2995,7 +2995,7 @@ SCTP_STATIC int sctp_init_sock(struct sock *sk)
sp->hbinterval = jiffies_to_msecs(sctp_hb_interval); sp->hbinterval = jiffies_to_msecs(sctp_hb_interval);
sp->pathmaxrxt = sctp_max_retrans_path; sp->pathmaxrxt = sctp_max_retrans_path;
sp->pathmtu = 0; // allow default discovery sp->pathmtu = 0; // allow default discovery
sp->sackdelay = sctp_sack_timeout; sp->sackdelay = jiffies_to_msecs(sctp_sack_timeout);
sp->param_flags = SPP_HB_ENABLE | sp->param_flags = SPP_HB_ENABLE |
SPP_PMTUD_ENABLE | SPP_PMTUD_ENABLE |
SPP_SACKDELAY_ENABLE; SPP_SACKDELAY_ENABLE;
......
...@@ -159,12 +159,9 @@ static ctl_table sctp_table[] = { ...@@ -159,12 +159,9 @@ static ctl_table sctp_table[] = {
.ctl_name = NET_SCTP_PRESERVE_ENABLE, .ctl_name = NET_SCTP_PRESERVE_ENABLE,
.procname = "cookie_preserve_enable", .procname = "cookie_preserve_enable",
.data = &sctp_cookie_preserve_enable, .data = &sctp_cookie_preserve_enable,
.maxlen = sizeof(long), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_doulongvec_ms_jiffies_minmax, .proc_handler = &proc_dointvec
.strategy = &sctp_sysctl_jiffies_ms,
.extra1 = &rto_timer_min,
.extra2 = &rto_timer_max
}, },
{ {
.ctl_name = NET_SCTP_RTO_ALPHA, .ctl_name = NET_SCTP_RTO_ALPHA,
......
...@@ -350,7 +350,7 @@ void sctp_transport_update_rto(struct sctp_transport *tp, __u32 rtt) ...@@ -350,7 +350,7 @@ void sctp_transport_update_rto(struct sctp_transport *tp, __u32 rtt)
tp->rto_pending = 0; tp->rto_pending = 0;
SCTP_DEBUG_PRINTK("%s: transport: %p, rtt: %d, srtt: %d " SCTP_DEBUG_PRINTK("%s: transport: %p, rtt: %d, srtt: %d "
"rttvar: %d, rto: %d\n", __FUNCTION__, "rttvar: %d, rto: %ld\n", __FUNCTION__,
tp, rtt, tp->srtt, tp->rttvar, tp->rto); tp, rtt, tp->srtt, tp->rttvar, tp->rto);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment