diff options
author | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2006-11-28 15:34:34 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-03 00:30:57 -0500 |
commit | 2a1fda6f6c01d7ac195c040f14edcf9f64a5451e (patch) | |
tree | 81fb2bf85277d1f686bd484c89bf9fc4777a2396 /net/dccp | |
parent | 4384260443efe90a2ec0d907568dbc58ae792cd0 (diff) |
[DCCP] ccid3: Set NoFeedback Timeout according to RFC 3448
This corrects the setting of the nofeedback timer with regard to RFC
3448 - previously it was not set to max(4*R, 2*s/X) as specified. Using
the maximum of 1 second as upper bound (as it was done before) can have
detrimental effects, especially if R is small.
Signed-off-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Diffstat (limited to 'net/dccp')
-rw-r--r-- | net/dccp/ccids/ccid3.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c index f0ed67c84a55..577fd0ef84e5 100644 --- a/net/dccp/ccids/ccid3.c +++ b/net/dccp/ccids/ccid3.c | |||
@@ -163,7 +163,7 @@ static void ccid3_hc_tx_no_feedback_timer(unsigned long data) | |||
163 | { | 163 | { |
164 | struct sock *sk = (struct sock *)data; | 164 | struct sock *sk = (struct sock *)data; |
165 | struct ccid3_hc_tx_sock *hctx = ccid3_hc_tx_sk(sk); | 165 | struct ccid3_hc_tx_sock *hctx = ccid3_hc_tx_sk(sk); |
166 | unsigned long next_tmout = USEC_PER_SEC / 5; | 166 | unsigned long t_nfb = USEC_PER_SEC / 5; |
167 | 167 | ||
168 | bh_lock_sock(sk); | 168 | bh_lock_sock(sk); |
169 | if (sock_owned_by_user(sk)) { | 169 | if (sock_owned_by_user(sk)) { |
@@ -191,7 +191,7 @@ static void ccid3_hc_tx_no_feedback_timer(unsigned long data) | |||
191 | hctx->ccid3hctx_x); | 191 | hctx->ccid3hctx_x); |
192 | /* The value of R is still undefined and so we can not recompute | 192 | /* The value of R is still undefined and so we can not recompute |
193 | * the timout value. Keep initial value as per [RFC 4342, 5]. */ | 193 | * the timout value. Keep initial value as per [RFC 4342, 5]. */ |
194 | next_tmout = TFRC_INITIAL_TIMEOUT; | 194 | t_nfb = TFRC_INITIAL_TIMEOUT; |
195 | ccid3_update_send_time(hctx); | 195 | ccid3_update_send_time(hctx); |
196 | break; | 196 | break; |
197 | case TFRC_SSTATE_FBACK: | 197 | case TFRC_SSTATE_FBACK: |
@@ -228,10 +228,9 @@ static void ccid3_hc_tx_no_feedback_timer(unsigned long data) | |||
228 | } | 228 | } |
229 | /* | 229 | /* |
230 | * Schedule no feedback timer to expire in | 230 | * Schedule no feedback timer to expire in |
231 | * max(4 * t_RTO, 2 * s/X) = max(4 * t_RTO, 2 * t_ipi) | 231 | * max(4 * R, 2 * s/X) = max(4 * R, 2 * t_ipi) |
232 | * XXX This is non-standard, RFC 3448, 4.3 uses 4 * R | ||
233 | */ | 232 | */ |
234 | next_tmout = max(hctx->ccid3hctx_t_rto, 2*hctx->ccid3hctx_t_ipi); | 233 | t_nfb = max(4 * hctx->ccid3hctx_rtt, 2 * hctx->ccid3hctx_t_ipi); |
235 | break; | 234 | break; |
236 | case TFRC_SSTATE_NO_SENT: | 235 | case TFRC_SSTATE_NO_SENT: |
237 | DCCP_BUG("Illegal %s state NO_SENT, sk=%p", dccp_role(sk), sk); | 236 | DCCP_BUG("Illegal %s state NO_SENT, sk=%p", dccp_role(sk), sk); |
@@ -244,7 +243,7 @@ static void ccid3_hc_tx_no_feedback_timer(unsigned long data) | |||
244 | 243 | ||
245 | restart_timer: | 244 | restart_timer: |
246 | sk_reset_timer(sk, &hctx->ccid3hctx_no_feedback_timer, | 245 | sk_reset_timer(sk, &hctx->ccid3hctx_no_feedback_timer, |
247 | jiffies + usecs_to_jiffies(next_tmout)); | 246 | jiffies + usecs_to_jiffies(t_nfb)); |
248 | out: | 247 | out: |
249 | bh_unlock_sock(sk); | 248 | bh_unlock_sock(sk); |
250 | sock_put(sk); | 249 | sock_put(sk); |
@@ -396,7 +395,7 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb) | |||
396 | struct ccid3_options_received *opt_recv; | 395 | struct ccid3_options_received *opt_recv; |
397 | struct dccp_tx_hist_entry *packet; | 396 | struct dccp_tx_hist_entry *packet; |
398 | struct timeval now; | 397 | struct timeval now; |
399 | unsigned long next_tmout; | 398 | unsigned long t_nfb; |
400 | u32 t_elapsed; | 399 | u32 t_elapsed; |
401 | u32 pinv; | 400 | u32 pinv; |
402 | u32 x_recv; | 401 | u32 x_recv; |
@@ -498,18 +497,17 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb) | |||
498 | USEC_PER_SEC ); | 497 | USEC_PER_SEC ); |
499 | /* | 498 | /* |
500 | * Schedule no feedback timer to expire in | 499 | * Schedule no feedback timer to expire in |
501 | * max(4 * t_RTO, 2 * s/X) = max(4 * t_RTO, 2 * t_ipi) | 500 | * max(4 * R, 2 * s/X) = max(4 * R, 2 * t_ipi) |
502 | * XXX This is non-standard, RFC 3448, 4.3 uses 4 * R | ||
503 | */ | 501 | */ |
504 | next_tmout = max(hctx->ccid3hctx_t_rto, 2*hctx->ccid3hctx_t_ipi); | 502 | t_nfb = max(4 * hctx->ccid3hctx_rtt, 2 * hctx->ccid3hctx_t_ipi); |
505 | 503 | ||
506 | ccid3_pr_debug("%s, sk=%p, Scheduled no feedback timer to " | 504 | ccid3_pr_debug("%s, sk=%p, Scheduled no feedback timer to " |
507 | "expire in %lu jiffies (%luus)\n", | 505 | "expire in %lu jiffies (%luus)\n", |
508 | dccp_role(sk), sk, | 506 | dccp_role(sk), sk, |
509 | usecs_to_jiffies(next_tmout), next_tmout); | 507 | usecs_to_jiffies(t_nfb), t_nfb); |
510 | 508 | ||
511 | sk_reset_timer(sk, &hctx->ccid3hctx_no_feedback_timer, | 509 | sk_reset_timer(sk, &hctx->ccid3hctx_no_feedback_timer, |
512 | jiffies + usecs_to_jiffies(next_tmout)); | 510 | jiffies + usecs_to_jiffies(t_nfb)); |
513 | 511 | ||
514 | /* set idle flag */ | 512 | /* set idle flag */ |
515 | hctx->ccid3hctx_idle = 1; | 513 | hctx->ccid3hctx_idle = 1; |