Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-2.6
[safe/jmp/linux-2.6] / net / ipv4 / tcp_illinois.c
index ae62986..1eba160 100644 (file)
@@ -83,10 +83,16 @@ static void tcp_illinois_init(struct sock *sk)
 }
 
 /* Measure RTT for each ack. */
-static void tcp_illinois_rtt_sample(struct sock *sk, u32 rtt)
+static void tcp_illinois_acked(struct sock *sk, u32 pkts_acked, s32 rtt)
 {
        struct illinois *ca = inet_csk_ca(sk);
 
+       ca->acked = pkts_acked;
+
+       /* dup ack, no rtt sample */
+       if (rtt < 0)
+               return;
+
        /* ignore bogus values, this prevents wraparound in alpha math */
        if (rtt > RTT_MAX)
                rtt = RTT_MAX;
@@ -103,13 +109,6 @@ static void tcp_illinois_rtt_sample(struct sock *sk, u32 rtt)
        ca->sum_rtt += rtt;
 }
 
-/* Capture count of packets covered by ack, to adjust for delayed acks */
-static void tcp_illinois_acked(struct sock *sk, u32 pkts_acked)
-{
-       struct illinois *ca = inet_csk_ca(sk);
-       ca->acked = pkts_acked;
-}
-
 /* Maximum queuing delay */
 static inline u32 max_delay(const struct illinois *ca)
 {
@@ -257,8 +256,7 @@ static void tcp_illinois_state(struct sock *sk, u8 new_state)
 /*
  * Increase window in response to successful acknowledgment.
  */
-static void tcp_illinois_cong_avoid(struct sock *sk, u32 ack, u32 rtt,
-                                   u32 in_flight, int flag)
+static void tcp_illinois_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)
 {
        struct tcp_sock *tp = tcp_sk(sk);
        struct illinois *ca = inet_csk_ca(sk);
@@ -299,7 +297,7 @@ static u32 tcp_illinois_ssthresh(struct sock *sk)
        struct illinois *ca = inet_csk_ca(sk);
 
        /* Multiplicative decrease */
-       return max((tp->snd_cwnd * ca->beta) >> BETA_SHIFT, 2U);
+       return max(tp->snd_cwnd - ((tp->snd_cwnd * ca->beta) >> BETA_SHIFT), 2U);
 }
 
 
@@ -325,12 +323,12 @@ static void tcp_illinois_info(struct sock *sk, u32 ext,
 }
 
 static struct tcp_congestion_ops tcp_illinois = {
+       .flags          = TCP_CONG_RTT_STAMP,
        .init           = tcp_illinois_init,
        .ssthresh       = tcp_illinois_ssthresh,
        .min_cwnd       = tcp_reno_min_cwnd,
        .cong_avoid     = tcp_illinois_cong_avoid,
        .set_state      = tcp_illinois_state,
-       .rtt_sample     = tcp_illinois_rtt_sample,
        .get_info       = tcp_illinois_info,
        .pkts_acked     = tcp_illinois_acked,