All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: sched: pie: change tc_pie_xstats->prob
@ 2020-03-09 19:10 Leslie Monis
  2020-03-09 22:19 ` Jakub Kicinski
  2020-03-10  1:06 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Leslie Monis @ 2020-03-09 19:10 UTC (permalink / raw)
  To: Linux NetDev
  Cc: David Miller, Jakub Kicinski, Mohit P . Tahiliani,
	Gautam Ramakrishnan, Eric Dumazet

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@google.com>
Signed-off-by: Leslie Monis <lesliemonis@gmail.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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: sched: pie: change tc_pie_xstats->prob
  2020-03-09 19:10 [PATCH net-next] net: sched: pie: change tc_pie_xstats->prob Leslie Monis
@ 2020-03-09 22:19 ` Jakub Kicinski
  2020-03-10  1:06 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2020-03-09 22:19 UTC (permalink / raw)
  To: Leslie Monis
  Cc: Linux NetDev, David Miller, Mohit P . Tahiliani,
	Gautam Ramakrishnan, Eric Dumazet

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.
> 
> Suggested-by: Eric Dumazet <edumazet@google.com>
> Signed-off-by: Leslie Monis <lesliemonis@gmail.com>

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: sched: pie: change tc_pie_xstats->prob
  2020-03-09 19:10 [PATCH net-next] net: sched: pie: change tc_pie_xstats->prob Leslie Monis
  2020-03-09 22:19 ` Jakub Kicinski
@ 2020-03-10  1:06 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2020-03-10  1:06 UTC (permalink / raw)
  To: lesliemonis; +Cc: netdev, kuba, tahiliani, gautamramk, edumazet

From: Leslie Monis <lesliemonis@gmail.com>
Date: Tue, 10 Mar 2020 00:40:33 +0530

> 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@google.com>
> Signed-off-by: Leslie Monis <lesliemonis@gmail.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-10  1:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-09 19:10 [PATCH net-next] net: sched: pie: change tc_pie_xstats->prob Leslie Monis
2020-03-09 22:19 ` Jakub Kicinski
2020-03-10  1:06 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.