netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sch: add missing u64 in psched_ratecfg_precompute()
@ 2013-03-27 15:41 Sergey Popovich
  2013-03-27 15:56 ` Eric Dumazet
  2013-03-27 18:11 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Sergey Popovich @ 2013-03-27 15:41 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: vger.kernel.org 

It seems that commit

commit 292f1c7ff6cc10516076ceeea45ed11833bb71c7
Author: Jiri Pirko <jiri@resnulli.us>
Date:   Tue Feb 12 00:12:03 2013 +0000

    sch: make htb_rate_cfg and functions around that generic

adds little regression.

Before:

# tc qdisc add dev eth0 root handle 1: htb default ffff
# tc class add dev eth0 classid 1:ffff htb rate 5Gbit
# tc -s class show dev eth0
class htb 1:ffff root prio 0 rate 5000Mbit ceil 5000Mbit burst 625b cburst 
625b 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 rate 0bit 0pps backlog 0b 0p requeues 0 
 lended: 0 borrowed: 0 giants: 0
 tokens: 31 ctokens: 31

After:

# tc qdisc add dev eth0 root handle 1: htb default ffff
# tc class add dev eth0 classid 1:ffff htb rate 5Gbit
# tc -s class show dev eth0
class htb 1:ffff root prio 0 rate 1544Mbit ceil 1544Mbit burst 625b cburst 
625b
 Sent 5073 bytes 41 pkt (dropped 0, overlimits 0 requeues 0)
 rate 1976bit 2pps backlog 0b 0p requeues 0
 lended: 41 borrowed: 0 giants: 0
 tokens: 1802 ctokens: 1802

This probably due to lost u64 cast of rate parameter in 
psched_ratecfg_precompute() (net/sched/sch_generic.c).

Signed-off-by: Sergey Popovich <popovich_sergei@mail.ru>

---
diff -uprN a/net/sched/sch_generic.c b/net/sched/sch_generic.c
--- a/net/sched/sch_generic.c	2013-03-27 14:52:27.419643015 +0200
+++ b/net/sched/sch_generic.c	2013-03-20 12:02:08.569366312 +0200
@@ -921,7 +921,7 @@ void psched_ratecfg_precompute(struct ps
 	u64 mult;
 	int shift;
 
-	r->rate_bps = rate << 3;
+	r->rate_bps = (u64)rate << 3;
 	r->shift = 0;
 	r->mult = 1;
 	/*

-- 
SP5474-RIPE
Sergey Popovich

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

* Re: [PATCH] sch: add missing u64 in psched_ratecfg_precompute()
  2013-03-27 15:41 [PATCH] sch: add missing u64 in psched_ratecfg_precompute() Sergey Popovich
@ 2013-03-27 15:56 ` Eric Dumazet
  2013-03-27 18:11 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Dumazet @ 2013-03-27 15:56 UTC (permalink / raw)
  To: Sergey Popovich; +Cc: vger.kernel.org

On Wed, 2013-03-27 at 17:41 +0200, Sergey Popovich wrote:
> It seems that commit
> 
> commit 292f1c7ff6cc10516076ceeea45ed11833bb71c7
> Author: Jiri Pirko <jiri@resnulli.us>
> Date:   Tue Feb 12 00:12:03 2013 +0000
> 
>     sch: make htb_rate_cfg and functions around that generic
> 
> adds little regression.

Acked-by: Eric Dumazet <edumazet@google.com>

Thanks

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

* Re: [PATCH] sch: add missing u64 in psched_ratecfg_precompute()
  2013-03-27 15:41 [PATCH] sch: add missing u64 in psched_ratecfg_precompute() Sergey Popovich
  2013-03-27 15:56 ` Eric Dumazet
@ 2013-03-27 18:11 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2013-03-27 18:11 UTC (permalink / raw)
  To: popovich_sergei; +Cc: eric.dumazet, netdev

From: Sergey Popovich <popovich_sergei@mail.ru>
Date: Wed, 27 Mar 2013 17:41:59 +0200

> It seems that commit
> 
> commit 292f1c7ff6cc10516076ceeea45ed11833bb71c7
> Author: Jiri Pirko <jiri@resnulli.us>
> Date:   Tue Feb 12 00:12:03 2013 +0000
> 
>     sch: make htb_rate_cfg and functions around that generic
> 
> adds little regression.
 ...
> Signed-off-by: Sergey Popovich <popovich_sergei@mail.ru>

Applied.

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

end of thread, other threads:[~2013-03-27 18:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-27 15:41 [PATCH] sch: add missing u64 in psched_ratecfg_precompute() Sergey Popovich
2013-03-27 15:56 ` Eric Dumazet
2013-03-27 18:11 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).