Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 111533
b: refs/heads/master
c: f76fd32
h: refs/heads/master
i:
  111531: eabb314
v: v3
  • Loading branch information
Gerrit Renker committed Sep 4, 2008
1 parent 6945307 commit 344dc5d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 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: 7d1af6a8d935678248d057564e75e1452409a53c
refs/heads/master: f76fd327a8b32d3ad5b51639faf6f54d18be0981
13 changes: 13 additions & 0 deletions trunk/net/dccp/ccids/ccid3.c
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,19 @@ MODULE_PARM_DESC(ccid3_debug, "Enable debug messages");

static __init int ccid3_module_init(void)
{
struct timespec tp;

/*
* Without a fine-grained clock resolution, RTTs/X_recv are not sampled
* correctly and feedback is sent either too early or too late.
*/
hrtimer_get_res(CLOCK_MONOTONIC, &tp);
if (tp.tv_sec || tp.tv_nsec > DCCP_TIME_RESOLUTION * NSEC_PER_USEC) {
printk(KERN_ERR "%s: Timer too coarse (%ld usec), need %u-usec"
" resolution - check your clocksource.\n", __func__,
tp.tv_nsec/NSEC_PER_USEC, DCCP_TIME_RESOLUTION);
return -ESOCKTNOSUPPORT;
}
return ccid_register(&ccid3);
}
module_init(ccid3_module_init);
Expand Down
5 changes: 4 additions & 1 deletion trunk/net/dccp/dccp.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,13 @@ extern void dccp_time_wait(struct sock *sk, int state, int timeo);
*/
#define DCCP_RTO_MAX ((unsigned)(64 * HZ))

/* DCCP base time resolution - 10 microseconds (RFC 4340, 13.1 ... 13.3) */
#define DCCP_TIME_RESOLUTION 10

/*
* RTT sampling: sanity bounds and fallback RTT value from RFC 4340, section 3.4
*/
#define DCCP_SANE_RTT_MIN 100
#define DCCP_SANE_RTT_MIN (10 * DCCP_TIME_RESOLUTION)
#define DCCP_FALLBACK_RTT (USEC_PER_SEC / 5)
#define DCCP_SANE_RTT_MAX (3 * USEC_PER_SEC)

Expand Down
3 changes: 1 addition & 2 deletions trunk/net/dccp/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,7 @@ u32 dccp_timestamp(void)
{
s64 delta = ktime_us_delta(ktime_get_real(), dccp_timestamp_seed);

do_div(delta, 10);
return delta;
return div_u64(delta, DCCP_TIME_RESOLUTION);
}
EXPORT_SYMBOL_GPL(dccp_timestamp);

Expand Down

0 comments on commit 344dc5d

Please sign in to comment.