[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200309191033.2975-1-lesliemonis@gmail.com>
Date: Tue, 10 Mar 2020 00:40:33 +0530
From: Leslie Monis <lesliemonis@...il.com>
To: Linux NetDev <netdev@...r.kernel.org>
Cc: David Miller <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
"Mohit P . Tahiliani" <tahiliani@...k.edu.in>,
Gautam Ramakrishnan <gautamramk@...il.com>,
Eric Dumazet <edumazet@...gle.com>
Subject: [PATCH net-next] 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.
Suggested-by: Eric Dumazet <edumazet@...gle.com>
Signed-off-by: Leslie Monis <lesliemonis@...il.com>
---
net/sched/sch_pie.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/sched/sch_pie.c b/net/sched/sch_pie.c
index f52442d39bf5..c65077f0c0f3 100644
--- a/net/sched/sch_pie.c
+++ b/net/sched/sch_pie.c
@@ -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,
--
2.17.1
Powered by blists - more mailing lists