Commit e20e6446 authored by Patrick McHardy's avatar Patrick McHardy Committed by Greg Kroah-Hartman

Fix advertised packet scheduler timer resolution

patch 3c0cfc13 in mainline

The fourth parameter of /proc/net/psched is supposed to show the timer
resultion and is used by HTB userspace to calculate the necessary
burst rate. Currently we show the clock resolution, which results in a
too low burst rate when the two differ.
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent d876cd16
...@@ -1225,10 +1225,13 @@ EXPORT_SYMBOL(tcf_destroy_chain); ...@@ -1225,10 +1225,13 @@ EXPORT_SYMBOL(tcf_destroy_chain);
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
static int psched_show(struct seq_file *seq, void *v) static int psched_show(struct seq_file *seq, void *v)
{ {
struct timespec ts;
hrtimer_get_res(CLOCK_MONOTONIC, &ts);
seq_printf(seq, "%08x %08x %08x %08x\n", seq_printf(seq, "%08x %08x %08x %08x\n",
(u32)NSEC_PER_USEC, (u32)PSCHED_US2NS(1), (u32)NSEC_PER_USEC, (u32)PSCHED_US2NS(1),
1000000, 1000000,
(u32)NSEC_PER_SEC/(u32)ktime_to_ns(KTIME_MONOTONIC_RES)); (u32)NSEC_PER_SEC/(u32)ktime_to_ns(timespec_to_ktime(ts)));
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment