tc: pie: change maximum integer value of tc_pie_xstats->prob
Subsystems (3)
PATCH 1/1 tc: pie: change maximum integer value of tc_pie_xstats->prob
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).
--- tc/q_pie.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tc/q_pie.c +2 -2
@@ -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));
Signature · 1 line
2.17.1
David Ahern
AppliedQuoted 11 lines · Leslie Monis
Kernel commit
105e808c1da2("pie: removepie_vars->accu_prob_overflows"), changes the maximum value oftc_pie_xstats->probfrom (2^64 - 1) to (2^56 - 1).Signed-off-by Mohit P. Tahiliani <[email protected]>Signed-off-by Gautam Ramakrishnan <[email protected]>Signed-off-by Leslie Monis <[email protected]>--- tc/q_pie.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
applied to iproute2-next. Thanks
Quoted 13 lines · David Ahern
Quoted 11 lines · Leslie Monis
Kernel commit
105e808c1da2("pie: removepie_vars->accu_prob_overflows"), changes the maximum value oftc_pie_xstats->probfrom (2^64 - 1) to (2^56 - 1).Signed-off-by Mohit P. Tahiliani <[email protected]>Signed-off-by Gautam Ramakrishnan <[email protected]>Signed-off-by Leslie Monis <[email protected]>--- tc/q_pie.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 3 lines
applied to iproute2-next. Thanks
This means that iproute2 is incompatible with old kernels.
commit 105e808c1da2 ("pie: remove pie_vars->accu_prob_overflows") was wrong, it should not have changed user ABI.
The rule is : iproute2 v-X should work with linux-<whatever-version>
Since pie MAX_PROB was implicitly in the user ABI, it can not be changed, at least from user point of view.
Quoted 22 lines · Eric Dumazet
Quoted 13 lines · David Ahern
Quoted 11 lines · Leslie Monis
Kernel commit
105e808c1da2("pie: removepie_vars->accu_prob_overflows"), changes the maximum value oftc_pie_xstats->probfrom (2^64 - 1) to (2^56 - 1).Signed-off-by Mohit P. Tahiliani <[email protected]>Signed-off-by Gautam Ramakrishnan <[email protected]>Signed-off-by Leslie Monis <[email protected]>--- tc/q_pie.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)Quoted 3 lines
applied to iproute2-next. Thanks
This means that iproute2 is incompatible with old kernels.
Quoted 8 lines
commit
105e808c1da2("pie: removepie_vars->accu_prob_overflows") was wrong, it should not have changed user ABI.The rule is : iproute2 v-X should work with linux-<whatever-version>
Since pie
MAX_PROBwas implicitly in the user ABI, it can not be changed, at least from user point of view.
So this kernel patch might be needed :
net/sched/sch_pie.c +1 -1
@@ -493,7 +493,7 @@ static int pie_dump_stats(struct Qdisc *sch, struct gnet_dump *d) {struct pie_sched_data *q =qdisc_priv (sch);struct tc_pie_xstats st = { - .prob = q->vars.prob, + .prob = q->vars.prob <<BITS_PER_BYTE , .delay = ((u32 )PSCHED_TICKS2NS (q->vars.qdelay)) /NSEC_PER_USEC , .packets_in = q->stats.packets_in,
Quoted 10 lines · Eric Dumazet
Quoted 8 lines · Eric Dumazet
This means that iproute2 is incompatible with old kernels.
commit
105e808c1da2("pie: removepie_vars->accu_prob_overflows") was wrong, it should not have changed user ABI.The rule is : iproute2 v-X should work with linux-<whatever-version>
I'm apologize. I wasn't aware of this rule.
Quoted 3 lines
Quoted 3 lines
Since pie
MAX_PROBwas implicitly in the user ABI, it can not be changed, at least from user point of view.
You're right. It shouldn't have affected user space.
But I'm afraid the value of MAX_PROB in the kernel did change in v5.1. commit 3f7ae5f3dc52 ("net: sched: pie: add more cases to auto-tune alpha and beta")
introduced that change. I'm not sure what to do about this. How can I fix it?
Quoted 8 lines
So this kernel patch might be needed :
net/sched/sch_pie.c +0
-0
net/sched/sch_pie.c static int pie_dump_stats(struct Qdisc *sch, struct gnet_dump *d) · line 499
Quoted 8 lines
net/sched/sch_pie.c +1
-1@@ -493,7 +493,7 @@ static int pie_dump_stats(struct Qdisc *sch, struct gnet_dump *d) {struct pie_sched_data *q =qdisc_priv (sch);struct tc_pie_xstats st = { - .prob = q->vars.prob, + .prob = q->vars.prob <<BITS_PER_BYTE , .delay = ((u32 )PSCHED_TICKS2NS (q->vars.qdelay)) /NSEC_PER_USEC , .packets_in = q->stats.packets_in,
Thanks. This is a much better solution.
Should I go ahead and submit this to net-next?
I guess the applied patch (topic of this thread) has to be reverted.
Quoted 27 lines · Leslie Monis
Quoted 10 lines · Eric Dumazet
Quoted 8 lines · Eric Dumazet
This means that iproute2 is incompatible with old kernels.
commit
105e808c1da2("pie: removepie_vars->accu_prob_overflows") was wrong, it should not have changed user ABI.The rule is : iproute2 v-X should work with linux-<whatever-version>
I'm apologize. I wasn't aware of this rule.
Quoted 3 lines
Quoted 3 lines
Since pie
MAX_PROBwas implicitly in the user ABI, it can not be changed, at least from user point of view.You're right. It shouldn't have affected user space.
But I'm afraid the value ofMAX_PROBin the kernel did change in v5.1. commit3f7ae5f3dc52("net: sched: pie: add more cases to auto-tune alpha and beta")
introduced that change. I'm not sure what to do about this. How can I fix it?Quoted 3 lines
So this kernel patch might be needed :
Quoted 16 lines
net/sched/sch_pie.c static int pie_dump_stats(struct Qdisc *sch, struct gnet_dump *d) · line 499
Quoted 13 lines
net/sched/sch_pie.c +1
-1@@ -493,7 +493,7 @@ static int pie_dump_stats(struct Qdisc *sch, struct gnet_dump *d) {struct pie_sched_data *q =qdisc_priv (sch);struct tc_pie_xstats st = { - .prob = q->vars.prob, + .prob = q->vars.prob <<BITS_PER_BYTE , .delay = ((u32 )PSCHED_TICKS2NS (q->vars.qdelay)) /NSEC_PER_USEC , .packets_in = q->stats.packets_in,Thanks. This is a much better solution.
Should I go ahead and submit this to net-next?
Sure, please go ahead !
Quoted 2 lines
I guess the applied patch (topic of this thread) has to be reverted.