From: Eric Dumazet <eric.dumazet@gmail.com>
To: Vimalkumar <j.vimal@gmail.com>
Cc: netdev@vger.kernel.org, shemminger@vyatta.com
Subject: Re: [PATCH] Rate should be u64 to avoid integer overflow at high speeds (>= ~35Gbit)
Date: Sat, 09 Mar 2013 20:03:49 -0800 [thread overview]
Message-ID: <1362888229.4051.2.camel@edumazet-glaptop> (raw)
In-Reply-To: <1362885604-14006-1-git-send-email-j.vimal@gmail.com>
On Sat, 2013-03-09 at 19:20 -0800, Vimalkumar wrote:
> Since rate values are passed around between kernel and tc
> in bytes/sec, 2**32 bytes/sec is around 34Gb/s. Beyond that
> rate, htb, tbf, hfsc, etc. can never be configured correctly.
>
> Signed-off-by: Vimalkumar <j.vimal@gmail.com>
> ---
> include/linux/gen_stats.h | 2 +-
> include/linux/pkt_sched.h | 10 +++++-----
> misc/ifstat.c | 4 ++--
> tc/m_police.c | 2 +-
> tc/q_cbq.c | 2 +-
> tc/q_choke.c | 2 +-
> tc/q_gred.c | 2 +-
> tc/q_hfsc.c | 6 ++++--
> tc/q_red.c | 2 +-
> tc/tc_cbq.c | 4 ++--
> tc/tc_cbq.h | 4 ++--
> tc/tc_core.c | 4 ++--
> tc/tc_core.h | 4 ++--
> tc/tc_util.c | 6 +++---
> tc/tc_util.h | 6 +++---
> 15 files changed, 31 insertions(+), 29 deletions(-)
>
> diff --git a/include/linux/gen_stats.h b/include/linux/gen_stats.h
> index 552c8a0..5ca6015 100644
> --- a/include/linux/gen_stats.h
> +++ b/include/linux/gen_stats.h
> @@ -33,7 +33,7 @@ struct gnet_stats_basic_packed {
> * @pps: current packet rate
> */
> struct gnet_stats_rate_est {
> - __u32 bps;
> + __u64 bps;
> __u32 pps;
> };
>
> diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h
> index 32aef0a..d6bc658 100644
> --- a/include/linux/pkt_sched.h
> +++ b/include/linux/pkt_sched.h
> @@ -35,7 +35,7 @@ struct tc_stats {
> __u32 drops; /* Packets dropped because of lack of resources */
> __u32 overlimits; /* Number of throttle events when this
> * flow goes out of allocated bandwidth */
> - __u32 bps; /* Current flow byte rate */
> + __u64 bps; /* Current flow byte rate */
> __u32 pps; /* Current flow packet rate */
> __u32 qlen;
> __u32 backlog;
> @@ -79,7 +79,7 @@ struct tc_ratespec {
> unsigned short overhead;
> short cell_align;
> unsigned short mpu;
> - __u32 rate;
> + __u64 rate;
> };
>
You cannot do that without breaking user land tools.
Not only tc, but all user applications as well.
We need to support compatibility, before considering adding such
changes.
next prev parent reply other threads:[~2013-03-10 4:03 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-10 3:20 [PATCH] Rate should be u64 to avoid integer overflow at high speeds (>= ~35Gbit) Vimalkumar
2013-03-10 4:03 ` Eric Dumazet [this message]
2013-03-10 4:53 ` Vimal
2013-03-10 5:05 ` Eric Dumazet
2013-03-10 5:49 ` Bill Fink
2013-03-10 5:54 ` Eric Dumazet
2013-03-12 14:29 ` Chris Friesen
2013-03-12 15:42 ` Thomas Graf
2013-03-12 15:44 ` Eric Dumazet
2013-03-12 15:53 ` Chris Friesen
2013-03-12 15:56 ` Chris Friesen
2013-03-13 6:01 ` Bill Fink
2013-03-13 6:13 ` Eric Dumazet
2013-03-13 15:29 ` Bill Fink
2013-03-13 15:34 ` Stephen Hemminger
2013-03-13 16:57 ` Chris Friesen
2013-03-14 4:08 ` Bill Fink
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1362888229.4051.2.camel@edumazet-glaptop \
--to=eric.dumazet@gmail.com \
--cc=j.vimal@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).