aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/timer.c
diff options
context:
space:
mode:
authorGerrit Renker <gerrit@erg.abdn.ac.uk>2008-09-04 07:30:19 +0200
committerGerrit Renker <gerrit@erg.abdn.ac.uk>2008-09-04 07:45:40 +0200
commitf76fd327a8b32d3ad5b51639faf6f54d18be0981 (patch)
tree86de66d77206ff624cce7402f73f97ea3575a6c9 /net/dccp/timer.c
parentdccp qpolicy: Parameter checking of cmsg qpolicy parameters (diff)
downloadlinux-dev-f76fd327a8b32d3ad5b51639faf6f54d18be0981.tar.xz
linux-dev-f76fd327a8b32d3ad5b51639faf6f54d18be0981.zip
dccp ccid-3: Runtime verification of timer resolution
The DCCP base time resolution is 10 microseconds (RFC 4340, 13.1 ... 13.3). Using a timer with a lower resolution was found to trigger the following bug warnings/problems on high-speed networks (e.g. local loopback): * RTT samples are rounded down to 0 if below resolution; * in some cases, negative RTT samples were observed; * the CCID-3 feedback timer complains that the feedback interval is 0, since the feedback interval is in the order of 1 RTT or less and RTT measurement rounded this down to 0; On an Intel computer this will for instance happen when using a boot-time parameter of "clocksource=jiffies". The following system log messages were observed: 11:24:00 kernel: BUG: delta (0) <= 0 at ccid3_hc_rx_send_feedback() 11:26:12 kernel: BUG: delta (0) <= 0 at ccid3_hc_rx_send_feedback() 11:26:30 kernel: dccp_sample_rtt: unusable RTT sample 0, using min 11:26:30 last message repeated 5 times This patch defines a global constant for the time resolution, adds this in timer.c, and checks the available clock resolution at CCID-3 module load time. When the resolution is worse than 10 microseconds, module loading exits with a message "socket type not supported". Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Diffstat (limited to '')
-rw-r--r--net/dccp/timer.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/dccp/timer.c b/net/dccp/timer.c
index e02d5a94f4c0..16359e29e7f5 100644
--- a/net/dccp/timer.c
+++ b/net/dccp/timer.c
@@ -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);