From: Vlad Yasevich <vladislav.yasevich@hp.com>
To: linux-sctp@vger.kernel.org
Subject: Re: [PATCH] Error in calculation of RTTvar
Date: Tue, 05 Oct 2010 13:23:30 +0000 [thread overview]
Message-ID: <4CAB26D2.10007@hp.com> (raw)
In-Reply-To: <20101005063636.4x0vgeefesckcs0s@webmail.tuwien.ac.at>
On 10/05/2010 12:36 AM, Christian Schoch wrote:
> The problem is inside the calculation of RTTVAR, which could last in very high values for RTO. This wrong result exists when RTT is rising and is bigger than SRTT (the subtraction goes negative).
> With this patch it should be possible to set RTOmin = 1 and the RTO has its minimum of 4 times the clock granularity - if the connection is fast enough like a LAN connection.
>
> abs() takes two long as argument and the output is long.
> srtt, rtt and rttvar are __u32.
>
> Subtraction of two unsigned values results in a value, that is not the same as it would be if the arguments are two signed values and the casted back.
> Without typecasting the result is the one's complement +1 for carry.
>
> This patch should eliminate the problem.
All that missing is a sign off. Can you add
Signed-off-by: name <email>
to this patch, or reply with your sign-off.
Thanks
-vlad
>
> Schoch Christian
>
> -----------------------------------------------------------------------
>
> --- a/net/sctp/transport.c 2010-10-05 06:04:17.000000000 +0200
> +++ b/net/sctp/transport.c 2010-10-05 06:09:09.000000000 +0200
> @@ -334,7 +334,7 @@
> * 1/8, rto_alpha would be expressed as 3.
> */
> tp->rttvar = tp->rttvar - (tp->rttvar >> sctp_rto_beta)
> - + ((abs(tp->srtt - rtt)) >> sctp_rto_beta);
> + + (((__u32)abs((long)tp->srtt - (long)rtt)) >> sctp_rto_beta);
> tp->srtt = tp->srtt - (tp->srtt >> sctp_rto_alpha)
> + (rtt >> sctp_rto_alpha);
> } else {
>
> ---------------------------------------------
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2010-10-05 13:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-05 4:36 [PATCH] Error in calculation of RTTvar Christian Schoch
2010-10-05 13:23 ` Vlad Yasevich [this message]
2010-10-05 13:53 ` Christian Schoch
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=4CAB26D2.10007@hp.com \
--to=vladislav.yasevich@hp.com \
--cc=linux-sctp@vger.kernel.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 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.