]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
tc: pie: change maximum integer value of tc_pie_xstats->prob
authorLeslie Monis <lesliemonis@gmail.com>
Thu, 5 Mar 2020 16:25:40 +0000 (21:55 +0530)
committerDavid Ahern <dsahern@gmail.com>
Mon, 9 Mar 2020 02:46:45 +0000 (02:46 +0000)
Kernel commit 105e808c1da2 ("pie: remove pie_vars->accu_prob_overflows"),
changes the maximum value of tc_pie_xstats->prob from (2^64 - 1) to
(2^56 - 1).

Signed-off-by: Mohit P. Tahiliani <tahiliani@nitk.edu.in>
Signed-off-by: Gautam Ramakrishnan <gautamramk@gmail.com>
Signed-off-by: Leslie Monis <lesliemonis@gmail.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
tc/q_pie.c

index 709a78b4c7c47f58226c20a0d677583039c137e9..e693965263d98155a3a66d4e893cb58c0a4dd5f3 100644 (file)
@@ -223,9 +223,9 @@ static int pie_print_xstats(struct qdisc_util *qu, FILE *f,
 
        st = RTA_DATA(xstats);
 
-       /* prob is returned as a fracion of maximum integer value */
+       /* prob is returned as a fracion of (2^56 - 1) */
        print_float(PRINT_ANY, "prob", "  prob %lg",
-                   (double)st->prob / (double)UINT64_MAX);
+                   (double)st->prob / (double)(UINT64_MAX >> 8));
        print_uint(PRINT_JSON, "delay", NULL, st->delay);
        print_string(PRINT_FP, NULL, " delay %s", sprint_time(st->delay, b1));