summaryrefslogtreecommitdiffstats
path: root/net/dccp/ccids
diff options
context:
space:
mode:
Diffstat (limited to 'net/dccp/ccids')
-rw-r--r--net/dccp/ccids/ccid3.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c
index 0d406f82e433..f566eb76aeb2 100644
--- a/net/dccp/ccids/ccid3.c
+++ b/net/dccp/ccids/ccid3.c
@@ -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);