From b4ec51c274add6d653d8fae94036a17e022e243d Mon Sep 17 00:00:00 2001 From: Gerrit Renker Date: Tue, 27 May 2008 06:33:54 -0700 Subject: [PATCH] --- yaml --- r: 97471 b: refs/heads/master c: 825de27d9e40b3117b29a79d412b7a4b78c5d815 h: refs/heads/master i: 97469: 35c2e31083faaa4eb6b5de345681f06c6fa7650e 97467: dadbf29d6a9eb906a27b78df3f614b854bf1f210 97463: b159df4077c6fb5ed4abc18dc4653792936dbc8b 97455: 88c4a787e496ad0f20e4450d2c413bc4c18ee79f 97439: 1009ceb7e5bdcd101c6f45bb6460b24a5262f7cc 97407: 9b62f7c11a931020aebfdb80b7d4545f017b1113 v: v3 --- [refs] | 2 +- trunk/net/dccp/ccids/ccid3.c | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/[refs] b/[refs] index 52fee369102f..71d880d49a0f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6079a463cf95fafcc704a4e5e92a4da12444bd3c +refs/heads/master: 825de27d9e40b3117b29a79d412b7a4b78c5d815 diff --git a/trunk/net/dccp/ccids/ccid3.c b/trunk/net/dccp/ccids/ccid3.c index cd61dea2eea1..f813077234b7 100644 --- a/trunk/net/dccp/ccids/ccid3.c +++ b/trunk/net/dccp/ccids/ccid3.c @@ -193,22 +193,17 @@ static inline void ccid3_hc_tx_update_s(struct ccid3_hc_tx_sock *hctx, int len) /* * Update Window Counter using the algorithm from [RFC 4342, 8.1]. - * The algorithm is not applicable if RTT < 4 microseconds. + * As elsewhere, RTT > 0 is assumed by using dccp_sample_rtt(). */ static inline void ccid3_hc_tx_update_win_count(struct ccid3_hc_tx_sock *hctx, ktime_t now) { - u32 quarter_rtts; - - if (unlikely(hctx->ccid3hctx_rtt < 4)) /* avoid divide-by-zero */ - return; - - quarter_rtts = ktime_us_delta(now, hctx->ccid3hctx_t_last_win_count); - quarter_rtts /= hctx->ccid3hctx_rtt / 4; + u32 delta = ktime_us_delta(now, hctx->ccid3hctx_t_last_win_count), + quarter_rtts = (4 * delta) / hctx->ccid3hctx_rtt; if (quarter_rtts > 0) { hctx->ccid3hctx_t_last_win_count = now; - hctx->ccid3hctx_last_win_count += min_t(u32, quarter_rtts, 5); + hctx->ccid3hctx_last_win_count += min(quarter_rtts, 5U); hctx->ccid3hctx_last_win_count &= 0xF; /* mod 16 */ } }