]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv4/tcp_cubic.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-fixes-2.6
[linux-2.6-omap-h63xx.git] / net / ipv4 / tcp_cubic.c
index 2be27980ca7854cd535555d6849746d4d499289e..6ad184802266b7e06fde04235104ca9ba40a6c61 100644 (file)
@@ -190,7 +190,7 @@ static inline void bictcp_update(struct bictcp *ca, u32 cwnd)
          */
 
        /* change the unit from HZ to bictcp_HZ */
-        t = ((tcp_time_stamp + ca->delay_min - ca->epoch_start)
+        t = ((tcp_time_stamp + (ca->delay_min>>3) - ca->epoch_start)
             << BICTCP_HZ) / HZ;
 
         if (t < ca->bic_K)             /* t - K */
@@ -259,7 +259,7 @@ static inline void measure_delay(struct sock *sk)
            (s32)(tcp_time_stamp - ca->epoch_start) < HZ)
                return;
 
-       delay = tcp_time_stamp - tp->rx_opt.rcv_tsecr;
+       delay = (tcp_time_stamp - tp->rx_opt.rcv_tsecr)<<3;
        if (delay == 0)
                delay = 1;
 
@@ -358,7 +358,7 @@ static struct tcp_congestion_ops cubictcp = {
 
 static int __init cubictcp_register(void)
 {
-       BUG_ON(sizeof(struct bictcp) > ICSK_CA_PRIV_SIZE);
+       BUILD_BUG_ON(sizeof(struct bictcp) > ICSK_CA_PRIV_SIZE);
 
        /* Precompute a bunch of the scaling factors that are used per-packet
         * based on SRTT of 100ms
@@ -366,7 +366,7 @@ static int __init cubictcp_register(void)
 
        beta_scale = 8*(BICTCP_BETA_SCALE+beta)/ 3 / (BICTCP_BETA_SCALE - beta);
 
-       cube_rtt_scale = (bic_scale << 3) / 10; /* 1024*c/rtt */
+       cube_rtt_scale = (bic_scale * 10);      /* 1024*c/rtt */
 
        /* calculate the "K" for (wmax-cwnd) = c/rtt * K^3
         *  so K = cubic_root( (wmax-cwnd)*rtt/c )