aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/ccids/ccid2.c
diff options
context:
space:
mode:
authorGerrit Renker <gerrit@erg.abdn.ac.uk>2010-08-29 15:23:13 -0400
committerDavid S. Miller <davem@davemloft.net>2010-08-30 16:45:27 -0400
commit4886fcad6e12572afbd230dfab1b268eace20d6d (patch)
treec0ac7dc930a8de315083ec3882ff78a325747e70 /net/dccp/ccids/ccid2.c
parent22b71c8f4f3db8df92f5e7b081c265bc56c0bd2f (diff)
dccp ccid-2: Share TCP's minimum RTO code
Using a fixed RTO_MIN of 0.2 seconds was found to cause problems for CCID-2 over 802.11g: at least once per session there was a spurious timeout. It helped to then increase the the value of RTO_MIN over this link. Since the problem is the same as in TCP, this patch makes the solution from commit "05bb1fad1cde025a864a90cfeb98dcbefe78a44a" "[TCP]: Allow minimum RTO to be configurable via routing metrics." available to DCCP. This avoids reinventing the wheel, so that e.g. the following works in the expected way now also for CCID-2: > ip route change 10.0.0.2 rto_min 800 dev ath0 Luckily this useful rto_min function was recently moved to net/tcp.h, which simplifies sharing code originating from TCP. Documentation also updated (plus minor whitespace fixes). Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/ccids/ccid2.c')
-rw-r--r--net/dccp/ccids/ccid2.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c
index b9c942a09c98..dc18172b1e59 100644
--- a/net/dccp/ccids/ccid2.c
+++ b/net/dccp/ccids/ccid2.c
@@ -325,8 +325,9 @@ static void ccid2_rtt_estimator(struct sock *sk, const long mrtt)
325 hc->tx_srtt = m << 3; 325 hc->tx_srtt = m << 3;
326 hc->tx_mdev = m << 1; 326 hc->tx_mdev = m << 1;
327 327
328 hc->tx_mdev_max = max(TCP_RTO_MIN, hc->tx_mdev); 328 hc->tx_mdev_max = max(hc->tx_mdev, tcp_rto_min(sk));
329 hc->tx_rttvar = hc->tx_mdev_max; 329 hc->tx_rttvar = hc->tx_mdev_max;
330
330 hc->tx_rtt_seq = dccp_sk(sk)->dccps_gss; 331 hc->tx_rtt_seq = dccp_sk(sk)->dccps_gss;
331 } else { 332 } else {
332 /* Update scaled SRTT as SRTT += 1/8 * (m - SRTT) */ 333 /* Update scaled SRTT as SRTT += 1/8 * (m - SRTT) */
@@ -367,7 +368,7 @@ static void ccid2_rtt_estimator(struct sock *sk, const long mrtt)
367 hc->tx_rttvar -= (hc->tx_rttvar - 368 hc->tx_rttvar -= (hc->tx_rttvar -
368 hc->tx_mdev_max) >> 2; 369 hc->tx_mdev_max) >> 2;
369 hc->tx_rtt_seq = dccp_sk(sk)->dccps_gss; 370 hc->tx_rtt_seq = dccp_sk(sk)->dccps_gss;
370 hc->tx_mdev_max = TCP_RTO_MIN; 371 hc->tx_mdev_max = tcp_rto_min(sk);
371 } 372 }
372 } 373 }
373 374