From: Schoch C. <e03...@st...> - 2011-03-16 05:38:48
|
Hi, some months ago I had the same problem. You can have a look at the following discussion: http://sourceforge.net/mailarchive/message.php?msg_id=25888601 > >> Hi, >> >> it seems to me that abs() is used incorrectly while calculating >> tp->rttvar in sctp_transport_update_rto(). Its parameter is unsigned, >> meaning it will never be negative. This quickly leads to RTO taking >> on extremely high values. I suggest changing the expression from: >> >> abs(tp->srtt - rtt) >> >> to: >> >> abs((long) tp->srtt - rtt) >> This patch should fix this problem: ----------------------------------------------------------------------- --- 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 { --------------------------------------------- >> or similar. This happens in Linux because abs() is a macro that >> behaves differently from the libc function. In libc, the implicit >> cast to int ensures this problem does not occur. > > abs() handles unsigned and signed longs, ints, shorts and chars. For all > input types abs() returns a signed long. > It does not. As you could see in the link above, I had the same behavior. There is a difference by using abs() with signed and unsigned values. In detail, the problem starts when rtt is larger than srtt and the result is a very large rttvar which pushes the RTO to maximum. I could not figure out where the problem exactly was situated, but after upgrading my system to Ubuntu 10.10 this problem has gone. I assumed it could be related to gcc or something like this. Regards, Christian > > > ------------------------------------------------------------------------------ > Colocation vs. Managed Hosting > A question and answer guide to determining the best fit > for your organization - today and in the future. > http://p.sf.net/sfu/internap-sfd2d > _______________________________________________ > Lksctp-developers mailing list > Lks...@li... > https://lists.sourceforge.net/lists/listinfo/lksctp-developers > |