netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yang Yingliang <yangyingliang@huawei.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH iproute2] htb: support 64bit rates
Date: Thu, 14 Nov 2013 16:03:26 +0800	[thread overview]
Message-ID: <528483CE.6050100@huawei.com> (raw)
In-Reply-To: <1384352510.28458.105.camel@edumazet-glaptop2.roam.corp.google.com>

On 2013/11/13 22:21, Eric Dumazet wrote:
> On Wed, 2013-11-13 at 17:11 +0800, Yang Yingliang wrote:
>>> -	if (!buffer) buffer = opt.rate.rate / get_hz() + mtu;
>>> -	if (!cbuffer) cbuffer = opt.ceil.rate / get_hz() + mtu;
>>> +	if (!buffer)
>>> +		buffer = rate64 / get_hz() + mtu;
>>> +	if (!cbuffer)
>>> +		cbuffer = ceil64 / get_hz() + mtu;
>>
>> Hi,
>> It may overflow here if rate64 and mtu are big enough.
> 
> Not really.
> 
> get_hz() on current kernels is really huge : 1000000000

Yeah, in normal condition, it won't happen.
If user make a wrong input, such as "rate 0x800000000Gbit",
Overflow happens. Although it has no impact on the value of the "opt.buffer".
If it's better to have a judgement of the buffer's value. :)

Regards,
Yang

> 
> 
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 

  reply	other threads:[~2013-11-14  8:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-12 22:34 [PATCH iproute2] htb: support 64bit rates Eric Dumazet
2013-11-13  9:11 ` Yang Yingliang
2013-11-13 14:21   ` Eric Dumazet
2013-11-14  8:03     ` Yang Yingliang [this message]
2013-11-14 14:32       ` Eric Dumazet
2013-11-14  8:12 ` Yang Yingliang
2013-11-14 14:28   ` Eric Dumazet
2013-11-23  1:36 ` Stephen Hemminger

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=528483CE.6050100@huawei.com \
    --to=yangyingliang@huawei.com \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    /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).