aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorstephen hemminger <shemminger@vyatta.com>2011-03-14 03:52:13 -0400
committerDavid S. Miller <davem@davemloft.net>2011-03-14 18:54:38 -0400
commitc54b4b7655447c1f24f6d50779c22eba9ee0fd24 (patch)
tree42178e794fafe36de1a00607b28363e1fe8da3f2 /net
parentfebf081987ec445f071ed10b73e9707a88cc5cc4 (diff)
tcp_cubic: fix comparison of jiffies
Jiffies wraps around therefore the correct way to compare is to use cast to signed value. Note: cubic is not using full jiffies value on 64 bit arch because using full unsigned long makes struct bictcp grow too large for the available ca_priv area. Includes correction from Sangtae Ha to improve ack train detection. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/tcp_cubic.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/ipv4/tcp_cubic.c b/net/ipv4/tcp_cubic.c
index 71d5f2f29fa6..43bb34c9b8bf 100644
--- a/net/ipv4/tcp_cubic.c
+++ b/net/ipv4/tcp_cubic.c
@@ -342,9 +342,11 @@ static void hystart_update(struct sock *sk, u32 delay)
342 u32 curr_jiffies = jiffies; 342 u32 curr_jiffies = jiffies;
343 343
344 /* first detection parameter - ack-train detection */ 344 /* first detection parameter - ack-train detection */
345 if (curr_jiffies - ca->last_jiffies <= msecs_to_jiffies(2)) { 345 if ((s32)(curr_jiffies - ca->last_jiffies) <=
346 msecs_to_jiffies(2)) {
346 ca->last_jiffies = curr_jiffies; 347 ca->last_jiffies = curr_jiffies;
347 if (curr_jiffies - ca->round_start >= ca->delay_min>>4) 348 if ((s32) (curr_jiffies - ca->round_start) >
349 ca->delay_min >> 4)
348 ca->found |= HYSTART_ACK_TRAIN; 350 ca->found |= HYSTART_ACK_TRAIN;
349 } 351 }
350 352