From 319840b83b70b49705928687dcbd40653709e305 Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Fri, 30 Jan 2015 07:50:43 -0800 Subject: trafgen: disable timer slack linux has default time slack of 50 usec, which means that trafgen 'gap' option is unable to precisely control delays. Set the process timer slack to the minimum of 1 nsec. Signed-off-by: Eric Dumazet Signed-off-by: Daniel Borkmann --- trafgen.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/trafgen.c b/trafgen.c index 0a645d4..9151b5d 100644 --- a/trafgen.c +++ b/trafgen.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -957,6 +958,7 @@ int main(int argc, char **argv) case 't': slow = true; ptr = optarg; + prctl(PR_SET_TIMERSLACK, 1UL); gap = strtoul(optarg, NULL, 0); for (j = i = strlen(optarg); i > 0; --i) { -- cgit v1.2.3-54-g00ecf