Stephen Hemminger wrote: >I noticed that the netem delay values are off if using >CONFIG_NET_SCH_CKL_CPU. For example, if the latency is set to 500ms > a ping reports the time as much less (343ms). > >Requested JIFFIES GETTIMEODAY CPU >0 .1 .1 .1 >1 2 2 1 >5 5 6 4 >10 10 11 7 >100 98 101 69 >500 489 500 343 >1000 976 1000 685 > >The 1ms value is affected by the clock granularity. Larger jiffie values >are inaccurate due to the optimization of using shift to do divide (ie 1024 > 1000). > >With CLK_CPU /proc/net/psched is: >000005d9 00000400 000f4240 000003e8 > > sch_netem's interface is in us, but it doesn't convert the values to psched_us. psched_us differ from us with CLK_CPU or CLK_JIFFIES for most values of HZ. This patch fixes the problem, but the best solution is to change the interface and pass the time values as psched_us from userspace, as done with rate-tables and I think CBQ. I should have done this for HFSC too, but unlike for sch_netem, I think it's too late to change the interface. Regards Patrick