[NETFILTER]: ip_tables: revision support for compat code
[safe/jmp/linux-2.6] / net / ipv4 / tcp_vegas.c
index 4376814..a3b7aa0 100644 (file)
@@ -31,7 +31,6 @@
  *     assumed senders never went idle.
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/module.h>
 #include <linux/skbuff.h>
@@ -215,14 +214,6 @@ static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack,
                vegas->beg_snd_nxt  = tp->snd_nxt;
                vegas->beg_snd_cwnd = tp->snd_cwnd;
 
-               /* Take into account the current RTT sample too, to
-                * decrease the impact of delayed acks. This double counts
-                * this sample since we count it for the next window as well,
-                * but that's not too awful, since we're taking the min,
-                * rather than averaging.
-                */
-               tcp_vegas_rtt_calc(sk, seq_rtt * 1000);
-
                /* We do the Vegas calculations only if we got enough RTT
                 * samples that we can be reasonably sure that we got
                 * at least one RTT sample that wasn't from a delayed ACK.
@@ -236,7 +227,7 @@ static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack,
                        /* We don't have enough RTT samples to do the Vegas
                         * calculation, so we'll behave like Reno.
                         */
-                       tcp_reno_cong_avoid(sk, ack, seq_rtt, in_flight, cnt);
+                       tcp_reno_cong_avoid(sk, ack, seq_rtt, in_flight, flag);
                } else {
                        u32 rtt, target_cwnd, diff;
 
@@ -333,11 +324,15 @@ static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack,
                        else if (tp->snd_cwnd > tp->snd_cwnd_clamp)
                                tp->snd_cwnd = tp->snd_cwnd_clamp;
                }
-       }
 
-       /* Wipe the slate clean for the next RTT. */
-       vegas->cntRTT = 0;
-       vegas->minRTT = 0x7fffffff;
+               /* Wipe the slate clean for the next RTT. */
+               vegas->cntRTT = 0;
+               vegas->minRTT = 0x7fffffff;
+       }
+       /* Use normal slow start */
+       else if (tp->snd_cwnd <= tp->snd_ssthresh) 
+               tcp_slow_start(tp);
+       
 }
 
 /* Extract info for Tcp socket info provided via netlink. */
@@ -375,7 +370,7 @@ static struct tcp_congestion_ops tcp_vegas = {
 
 static int __init tcp_vegas_register(void)
 {
-       BUG_ON(sizeof(struct vegas) > ICSK_CA_PRIV_SIZE);
+       BUILD_BUG_ON(sizeof(struct vegas) > ICSK_CA_PRIV_SIZE);
        tcp_register_congestion_control(&tcp_vegas);
        return 0;
 }