Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 97471
b: refs/heads/master
c: 825de27
h: refs/heads/master
i:
  97469: 35c2e31
  97467: dadbf29
  97463: b159df4
  97455: 88c4a78
  97439: 1009ceb
  97407: 9b62f7c
v: v3
  • Loading branch information
Gerrit Renker authored and David S. Miller committed May 27, 2008
1 parent cd28901 commit b4ec51c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6079a463cf95fafcc704a4e5e92a4da12444bd3c
refs/heads/master: 825de27d9e40b3117b29a79d412b7a4b78c5d815
13 changes: 4 additions & 9 deletions trunk/net/dccp/ccids/ccid3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
}
}
Expand Down

0 comments on commit b4ec51c

Please sign in to comment.