Skip to contentSkip to conversation

net: sched: pie: change tc_pie_xstats->prob

PATCH Applied Leslie Monis 3 participants 3 messages Mar 9, 2020 – Mar 10, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: sched: pie: change tc_pie_xstats->prob

Commit 105e808c1da2 ("pie: remove pie_vars->accu_prob_overflows") changes the scale of probability values in PIE from (2^64 - 1) to (2^56 - 1). This affects the precision of tc_pie_xstats->prob in user space.

This patch ensures user space is unaffected.

---
 net/sched/sch_pie.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/sched/sch_pie.c +1 -1
index f52442d39bf5..c65077f0c0f3 100644
@@ -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,
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 9 lines · On Tue, 10 Mar 2020 00:40:33 +0530 Leslie Monis wrote:

Commit 105e808c1da2 ("pie: remove pie_vars->accu_prob_overflows") changes the scale of probability values in PIE from (2^64 - 1) to (2^56 - 1). This affects the precision of tc_pie_xstats->prob in user space.

This patch ensures user space is unaffected.

Thanks, I was looking out for user space changes during review but it was too hard to catch this until the iproute2 patch surfaced :(

I'd be good to post the user space changes along the kernel side. iproute2 maintainers just wait for the kernel part to land in that case.

maintainer Applied
#2 lore raw
In reply to Leslie Monis

From: Leslie Monis <[email protected]>
Date: Tue, 10 Mar 2020 00:40:33 +0530

Quoted 9 lines

Commit 105e808c1da2 ("pie: remove pie_vars->accu_prob_overflows") changes the scale of probability values in PIE from (2^64 - 1) to (2^56 - 1). This affects the precision of tc_pie_xstats->prob in user space.

This patch ensures user space is unaffected.

Applied, thanks.