netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Hannemann <hannemann@nets.rwth-aachen.de>
To: "shemminger@osdl.org" <shemminger@osdl.org>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Arnd Hannemann <Arnd.Hannemann@nets.rwth-aachen.de>
Subject: Re: [PATCH] iproute2: Avoid rounding errors for 100%.
Date: Tue, 03 Nov 2009 17:19:45 +0100	[thread overview]
Message-ID: <4AF05821.60303@nets.rwth-aachen.de> (raw)
In-Reply-To: <1257262694-16985-1-git-send-email-hannemann@nets.rwth-aachen.de>

Although the patch makes sense,
it does not fix the bug/effect we were seeing.
A netem reorder percentage of 100% will still get packets reordered.
(if the netem queue is not empty)


hannemann@nets.rwth-aachen.de wrote:
> From: Arnd Hannemann <hannemann@nets.rwth-aachen.de>
> 
> We noticed that a netem reorder percentage of 100% will still get packets reordered.
> This patch fixes that.
> 
> Signed-off-by: Arnd Hannemann <hannemann@nets.rwth-aachen.de>
> ---
>  tc/tc_util.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/tc/tc_util.c b/tc/tc_util.c
> index fe2c7eb..2641f2e 100644
> --- a/tc/tc_util.c
> +++ b/tc/tc_util.c
> @@ -363,8 +363,10 @@ int get_percent(__u32 *percent, const char *str)
>  		return -1;
>  	if (*p && strcmp(p, "%"))
>  		return -1;
> -
> -	*percent = (unsigned) rint(per * max_percent_value);
> +	if (per == 1.)
> +		*percent = max_percent_value;
> +	else
> +		*percent = (unsigned) rint(per * max_percent_value);
>  	return 0;
>  }
>  


-- 
Dipl.-Inform. Arnd Hannemann
RWTH Aachen University
Dept. of Computer Science, Informatik 4
Ahornstr. 55, D-52074 Aachen, Germany
Phone: (+49 241) 80-21423 Fax: (+49 241) 80-22220

  reply	other threads:[~2009-11-03 16:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-03 15:38 [PATCH] iproute2: Avoid rounding errors for 100% hannemann
2009-11-03 16:19 ` Arnd Hannemann [this message]
2009-11-03 17:07   ` Stephen Hemminger
2009-11-03 17:19     ` Arnd Hannemann
2009-11-03 18:05       ` 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=4AF05821.60303@nets.rwth-aachen.de \
    --to=hannemann@nets.rwth-aachen.de \
    --cc=Arnd.Hannemann@nets.rwth-aachen.de \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@osdl.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).